Files
kotlin-fork/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt2234.kt
T
Andrey Breslav 3d8d92c7d3 JetDiagnosticsTest migrated to TestGenerator
- test data files renamed from *.jet to *.kt
2012-07-10 14:48:11 +04:00

20 lines
502 B
Kotlin

package a
//KT-2234 'period!!' has type Int?
fun main(args : Array<String>) {
val d : Long = 1
val period : Int? = null
if (period != null) #(d, period<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!> : Int) else #(d, 1)
if (period != null) #(d, period : Int) else #(d, 1)
}
fun foo() {
val x : Int? = 3
if (x != null) {
val <!UNUSED_VARIABLE!>u<!> = x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!> : Int
val y = x : Int
val <!UNUSED_VARIABLE!>z<!> : Int = y
}
}