Skip to content

Commit 5f57866

Browse files
authored
Merge pull request #100 from KotlinIsland/fix-constructors
intellij: Fix constructors returning `None`
2 parents 4a459f2 + 9f0670d commit 5f57866

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

intellij/CHANGELOG.md

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

55
## [Unreleased]
66

7+
### Fixed
8+
- Constructors incorrectly returning `None`
79

810
## [0.1.0] - 2023-12-20
911

intellij/gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ 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.0
7+
pluginVersion = 0.1.1
88

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

1313
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
1414
platformType = IC
15-
platformVersion = 2023.3.1
15+
platformVersion = 2023.3.2
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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private class BasedTypingTypeProvider : PyTypeProviderBase() {
3333

3434
override fun getCallType(function: PyFunction, callSite: PyCallSiteExpression, context: TypeEvalContext): Ref<PyType>? {
3535
val annotation = function.annotation?.value ?: return null
36-
return Ref.create(getType(annotation, context))
36+
return Ref.create(getType(annotation, context, simple = true))
3737
}
3838

3939
/**
@@ -63,11 +63,11 @@ class BasedPyFunctionTypeImpl(val callable: PyFunction) : PyFunctionTypeImpl(cal
6363
}
6464
}
6565

66-
fun getType(expression: PyExpression, context: TypeEvalContext): PyType? {
66+
fun getType(expression: PyExpression, context: TypeEvalContext, simple: Boolean = false): PyType? {
6767
return getLiteralType(expression, context)
6868
?: getUnionType(expression, context)
6969
?: getTupleType(expression, context)
70-
?: Ref.deref(PyTypingTypeProvider.getType(expression, context))
70+
?: if (simple) null else PyTypingTypeProvider.getType(expression, context)?.get()
7171
}
7272

7373
fun getLiteralType(target: PyExpression, context: TypeEvalContext): PyType? {

0 commit comments

Comments
 (0)