Files
kotlin-fork/compiler/testData/diagnostics/tests/nullabilityAndAutoCasts/kt2234.kt
T
Andrey Breslav 5eaa5b396b Removing usages of tuples from test data
(KT-2358 Drop tuples)
 #KT-2358 In progress
2012-09-18 20:27:09 +04:00

22 lines
552 B
Kotlin

package a
//KT-2234 'period!!' has type Int?
class Pair<A, B>(val a: A, val b: B)
fun main(args : Array<String>) {
val d : Long = 1
val period : Int? = null
if (period != null) Pair(d, period<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!> : Int) else Pair(d, 1)
if (period != null) Pair(d, period : Int) else Pair(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
}
}