Skip to content

Commit 98f770d

Browse files
committed
intellij: fix narrowed types
1 parent 7bb763e commit 98f770d

File tree

15 files changed

+880
-21
lines changed

15 files changed

+880
-21
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
intellij/src/test/java/** linguist-vendored

.idea/basedtyping.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

intellij/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44

55
## [Unreleased]
66

7+
## [0.1.3]
8+
79
### Added
810
- Callable literal types `() -> int`
11+
### Fixed
12+
- Narrowed types were broken
913

1014
## [0.1.2] - 2023-01-12
1115

intellij/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ dependencies {
2626

2727
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
2828
kotlin {
29-
@Suppress("UnstableApiUsage")
3029
jvmToolchain {
3130
languageVersion = JavaLanguageVersion.of(17)
31+
@Suppress("UnstableApiUsage")
3232
vendor = JvmVendorSpec.JETBRAINS
3333
}
3434
}

intellij/gradle.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ pluginGroup = org.basedsoft.plugins.basedtyping
44
pluginName = basedtyping
55
pluginRepositoryUrl = https://github.com/KotlinIsland/basedtyping
66
# SemVer format -> https://semver.org
7-
pluginVersion = 0.1.2
7+
pluginVersion = 0.1.3
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 233
11-
pluginUntilBuild = 233.*
11+
pluginUntilBuild = 241.*
1212

1313
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
14-
platformType = IC
15-
platformVersion = 2023.3.2
14+
platformType = PC
15+
platformVersion = 2023.3.3
1616

1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1818
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
19-
platformPlugins = PythonCore:233.11799.300
19+
platformPlugins = PythonCore
2020

2121
# Gradle Releases -> https://github.com/gradle/gradle/releases
22-
gradleVersion = 8.5
22+
gradleVersion = 8.6
2323

2424
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2525
kotlin.stdlib.default.dependency = false

intellij/gradle/libs.versions.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
annotations = "24.1.0"
44

55
# plugins
6-
kotlin = "1.9.21"
6+
kotlin = "1.9.22"
77
changelog = "2.2.0"
8-
gradleIntelliJPlugin = "1.16.1"
8+
gradleIntelliJPlugin = "1.17.1"
99
kover = "0.7.5"
1010

11+
1112
[libraries]
1213
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
1314

intellij/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

intellij/gradlew.bat

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

intellij/src/main/kotlin/org/basedsoft/plugins/basedtyping/BasedTypingTypeProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private class BasedTypingTypeProvider : PyTypeProviderBase() {
4545
val param = referenceExpression.followAssignmentsChain(PyResolveContext.defaultContext(context)).element
4646
if (param !is PyNamedParameter) return null
4747
val annotation = param.annotation?.value ?: return null
48-
return getType(annotation, context)
48+
return getType(annotation, context, simple=true)
4949
}
5050
/**
5151
* Needed to work around a limitation in PyTypingTypeProvider
@@ -137,6 +137,7 @@ fun getOverload(param: PyNamedParameter, func: PyFunction, context: TypeEvalCont
137137
.filterNotNull()
138138
.toSet()
139139
.takeIf { it.isNotEmpty() }
140+
// TODO: keep the correct order
140141
?.let { PyUnionType.union(it) }
141142

142143
fun getOverloadReturn(func: PyFunction, context: TypeEvalContext) =

0 commit comments

Comments
 (0)