[FIR] Fix isMyTypeVariable in ConeInferenceContext
This commit is contained in:
+1
-1
@@ -241,7 +241,7 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext,
|
|||||||
|
|
||||||
override fun KotlinTypeMarker.mayBeTypeVariable(): Boolean {
|
override fun KotlinTypeMarker.mayBeTypeVariable(): Boolean {
|
||||||
require(this is ConeKotlinType)
|
require(this is ConeKotlinType)
|
||||||
return this is ConeTypeVariableType
|
return this.typeConstructor() is ConeTypeVariableTypeConstructor
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun CapturedTypeMarker.typeConstructorProjection(): TypeArgumentMarker {
|
override fun CapturedTypeMarker.typeConstructorProjection(): TypeArgumentMarker {
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
// FULL_JDK
|
||||||
|
// FILE: U.java
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
public class U {
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public <T> T getValue(Box<@NotNull T> box) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: Box.java
|
||||||
|
|
||||||
|
public class Box<T> {}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: useSite.kt
|
||||||
|
fun foo(holder: U, box: Box<Int>): Int {
|
||||||
|
|
||||||
|
return holder.getValue(box)
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
FILE: useSite.kt
|
||||||
|
public final fun foo(holder: R|U|, box: R|Box<kotlin/Int>|): R|kotlin/Int| {
|
||||||
|
^foo R|<local>/holder|.R|/U.getValue|<R|kotlin/Int|>(R|<local>/box|)
|
||||||
|
}
|
||||||
Generated
+5
@@ -513,6 +513,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic
|
|||||||
public void testStaticGenericMethod() throws Exception {
|
public void testStaticGenericMethod() throws Exception {
|
||||||
runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/StaticGenericMethod.kt");
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/StaticGenericMethod.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("typeParameterUse.kt")
|
||||||
|
public void testTypeParameterUse() throws Exception {
|
||||||
|
runTest("compiler/fir/resolve/testData/resolve/stdlib/j+k/typeParameterUse.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("compiler/fir/resolve/testData/resolve/stdlib/problems")
|
@TestMetadata("compiler/fir/resolve/testData/resolve/stdlib/problems")
|
||||||
|
|||||||
Reference in New Issue
Block a user