added test for obsolete task
#KT-2336 Fixed
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
fun main(args: Array<String>) {
|
||||
val b: Boolean? = null
|
||||
if (b != null) {
|
||||
if (!<!DEBUG_INFO_AUTOCAST!>b<!>) {} // OK
|
||||
if (<!DEBUG_INFO_AUTOCAST!>b<!>) {} // Error: Condition must be of type jet.Boolean, but is of type jet.Boolean?
|
||||
if (b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) {} // WARN: Unnecessary non-null assertion (!!) on a non-null receiver of type jet.Boolean?
|
||||
foo(<!DEBUG_INFO_AUTOCAST!>b<!>) // OK
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(a: Boolean) = a
|
||||
@@ -4672,6 +4672,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt2234.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt2336.kt")
|
||||
public void testKt2336() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt2336.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt244.kt")
|
||||
public void testKt244() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt244.kt");
|
||||
|
||||
Reference in New Issue
Block a user