FIR: Add problematic test case
^KT-37318 Open
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass<T> {
|
||||
public JavaClass(T t) {}
|
||||
|
||||
public T foo() {}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun main() {
|
||||
// See https://github.com/JetBrains/kotlin/commit/437a26684d3529ee2cfdbe54e59d50f4a6f0a611#diff-ba68311bbe28b71196c36a6246000382L176
|
||||
// In simplifyLowerConstraint, we add constraint Nothing? <: T!, approximating it with Nothing? <: T
|
||||
// But before it we already had T <: String from the explicit types
|
||||
// That lead us to constraint contradiction: Nothing? !<: String
|
||||
// We need to discuss the commit above at some point
|
||||
<!INAPPLICABLE_CANDIDATE!>JavaClass<!><String>(null).<!UNRESOLVED_REFERENCE!>foo<!>().<!UNRESOLVED_REFERENCE!>length<!>
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
FILE: main.kt
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
<Inapplicable(INAPPLICABLE): [/JavaClass.JavaClass]>#<R|kotlin/String|>(Null(null)).<Unresolved name: foo>#().<Unresolved name: length>#
|
||||
}
|
||||
+5
@@ -1407,6 +1407,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAndOriginalType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("flexibleTypeVarAgainstNull.kt")
|
||||
public void testFlexibleTypeVarAgainstNull() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/flexibleTypeVarAgainstNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("javaAccessorConversion.kt")
|
||||
public void testJavaAccessorConversion() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
|
||||
|
||||
Generated
+5
@@ -1407,6 +1407,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAndOriginalType.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("flexibleTypeVarAgainstNull.kt")
|
||||
public void testFlexibleTypeVarAgainstNull() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/flexibleTypeVarAgainstNull.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("javaAccessorConversion.kt")
|
||||
public void testJavaAccessorConversion() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
|
||||
|
||||
Reference in New Issue
Block a user