Update test affected by SafeCallsAreAlwaysNullable feature
This commit is contained in:
+6
@@ -680,6 +680,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiver2.kt")
|
||||
public void testSafeCallNonNullReceiver2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiverReturnNull.kt")
|
||||
public void testSafeCallNonNullReceiverReturnNull() throws Exception {
|
||||
|
||||
+6
@@ -680,6 +680,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiver2.kt")
|
||||
public void testSafeCallNonNullReceiver2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiverReturnNull.kt")
|
||||
public void testSafeCallNonNullReceiverReturnNull() throws Exception {
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ object Test {
|
||||
val a = "OK"
|
||||
}
|
||||
|
||||
fun box(): String = Test?.a
|
||||
fun box(): String? = Test?.a
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ fun test(s: String) = s?.length
|
||||
// 0 IFNULL
|
||||
// 0 IFNONNULL
|
||||
// 0 intValue
|
||||
// 0 valueOf
|
||||
// 1 valueOf
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
// !API_VERSION: LATEST_STABLE
|
||||
|
||||
// !LANGUAGE: -SafeCallsAreAlwaysNullable
|
||||
fun test(s: String) = s?.length
|
||||
|
||||
// 0 IFNULL
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -SafeCallsAreAlwaysNullable
|
||||
// http://youtrack.jetbrains.net/issue/KT-418
|
||||
|
||||
fun ff() {
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
// http://youtrack.jetbrains.net/issue/KT-418
|
||||
|
||||
fun ff() {
|
||||
val i: Int = 1
|
||||
val a: Int? = i<!UNNECESSARY_SAFE_CALL!>?.<!>plus(2)
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun ff(): kotlin.Unit
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -SafeCallsAreAlwaysNullable
|
||||
// See KT-10913 Bogus unreachable code warning
|
||||
|
||||
fun fn() : String? = null
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// !LANGUAGE: -SafeCallsAreAlwaysNullable
|
||||
// See KT-10913 Bogus unreachable code warning
|
||||
|
||||
fun fn() : String? = null
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ interface B {
|
||||
|
||||
fun test(u: A?, x: A?, y: A?, z: A?, w: A, v: A?) {
|
||||
u?.b?.foo()!! // was UNNECESSARY_SAFE_CALL everywhere, because result type (of 'foo()') wasn't made nullable
|
||||
u!!.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
u!!.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()!!
|
||||
x?.b!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
// x?.b is not null
|
||||
x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
@@ -22,7 +22,7 @@ fun test(u: A?, x: A?, y: A?, z: A?, w: A, v: A?) {
|
||||
// z?.nb is not null
|
||||
z<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.nb!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
|
||||
w.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
w.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()!!
|
||||
w.b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
w.nb?.foo()!!
|
||||
w.nb!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
|
||||
@@ -8,5 +8,5 @@ fun ff() {
|
||||
val a = Test.FOO
|
||||
val b = <!NO_COMPANION_OBJECT!>Test<!><!UNEXPECTED_SAFE_CALL!>?.<!>FOO
|
||||
System.out.println(a + b)
|
||||
<!NO_COMPANION_OBJECT!>System<!><!UNEXPECTED_SAFE_CALL!>?.<!>out.println(a + b)
|
||||
<!NO_COMPANION_OBJECT!>System<!><!UNEXPECTED_SAFE_CALL!>?.<!>out<!UNSAFE_CALL!>.<!>println(a + b)
|
||||
}
|
||||
|
||||
Generated
+6
@@ -680,6 +680,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiver2.kt")
|
||||
public void testSafeCallNonNullReceiver2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiverReturnNull.kt")
|
||||
public void testSafeCallNonNullReceiverReturnNull() throws Exception {
|
||||
|
||||
+6
@@ -680,6 +680,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiver2.kt")
|
||||
public void testSafeCallNonNullReceiver2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/SafeCallNonNullReceiver2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SafeCallNonNullReceiverReturnNull.kt")
|
||||
public void testSafeCallNonNullReceiverReturnNull() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user