[FIR-TEST] Add test with nullability annotation problem

#KT-36770
This commit is contained in:
Dmitriy Novozhilov
2020-02-17 13:35:26 +03:00
parent 47d5bbc224
commit e302e06c73
4 changed files with 29 additions and 0 deletions
@@ -0,0 +1,15 @@
// Original problem was discovered in `backend.main/org/jetbrains/kotlin/codegen/inline/InlineCache.kt`
// FILE: SLRUMap.java
import org.jetbrains.annotations.NotNull;
public interface SLRUMap<V> {
void takeV(@NotNull V value);
}
// FILE: main.kt
fun <V> SLRUMap<V>.getOrPut(value: V) {
<!INAPPLICABLE_CANDIDATE!>takeV<!>(value)
}
@@ -0,0 +1,4 @@
FILE: main.kt
public final fun <V> R|SLRUMap<V>|.getOrPut(value: R|V|): R|kotlin/Unit| {
<Inapplicable(INAPPLICABLE): [/SLRUMap.takeV]>#(R|<local>/value|)
}
@@ -1289,6 +1289,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/resolve/testData/resolve/problems/definetelyNotNullForTypeParameter.kt");
}
@TestMetadata("definitelyNotNullAndOriginalType.kt")
public void testDefinitelyNotNullAndOriginalType() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAndOriginalType.kt");
}
@TestMetadata("javaAccessorConversion.kt")
public void testJavaAccessorConversion() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
@@ -1289,6 +1289,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/resolve/testData/resolve/problems/definetelyNotNullForTypeParameter.kt");
}
@TestMetadata("definitelyNotNullAndOriginalType.kt")
public void testDefinitelyNotNullAndOriginalType() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/definitelyNotNullAndOriginalType.kt");
}
@TestMetadata("javaAccessorConversion.kt")
public void testJavaAccessorConversion() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");