FIR: Add problem test
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
interface Out<out E>
|
||||
|
||||
fun <X> id(x: Out<X>): Out<X> = TODO()
|
||||
|
||||
fun <F : Any> foo(computable: Out<F?>)
|
||||
|
||||
fun <T : Any> bar(computable: Out<T?>) {
|
||||
// Should be resolved but fails during inference
|
||||
// Failed incorporated constraint: T? <: Any (from T? <: X!! and X!! <: F and F <: Any)
|
||||
// Hypothesis: DefinetelyNotNull(T?) = should just remove "?" while it actually gets created
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>(id(computable))
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
FILE: definetelyNotNullForTypeParameter.kt
|
||||
public abstract interface Out<out E> : R|kotlin/Any| {
|
||||
}
|
||||
public final fun <X> id(x: R|Out<X>|): R|Out<X>| {
|
||||
^id R|kotlin/TODO|()
|
||||
}
|
||||
public final fun <F : R|kotlin/Any|> foo(computable: R|Out<F?>|): R|kotlin/Unit|
|
||||
public final fun <T : R|kotlin/Any|> bar(computable: R|Out<T?>|): R|kotlin/Unit| {
|
||||
<Inapplicable(INAPPLICABLE): [/foo]>#(R|/id|<R|T?|>(R|<local>/computable|))
|
||||
}
|
||||
+5
@@ -1091,6 +1091,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/defaultJavaImportHiding.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definetelyNotNullForTypeParameter.kt")
|
||||
public void testDefinetelyNotNullForTypeParameter() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/definetelyNotNullForTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definitelyNotNullAmbiguity.kt")
|
||||
public void testDefinitelyNotNullAmbiguity() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAmbiguity.kt");
|
||||
|
||||
Generated
+5
@@ -1091,6 +1091,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/defaultJavaImportHiding.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definetelyNotNullForTypeParameter.kt")
|
||||
public void testDefinetelyNotNullForTypeParameter() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/definetelyNotNullForTypeParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("definitelyNotNullAmbiguity.kt")
|
||||
public void testDefinitelyNotNullAmbiguity() throws Exception {
|
||||
runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAmbiguity.kt");
|
||||
|
||||
Reference in New Issue
Block a user