Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/noErrorCheckForPackageLevelVal.kt
T
2013-05-31 16:29:07 +04:00

25 lines
358 B
Kotlin
Vendored

//FILE: bar.kt
package bar
val i: Int? = 2
//FILE: foo.kt
package foo
val i: Int? = 1
class A(val i: Int?) {
fun testUseFromClass() {
if (foo.i != null) {
useInt(<!TYPE_MISMATCH!>i<!>)
}
}
}
fun testUseFromOtherPackage() {
if (bar.i != null) {
useInt(<!TYPE_MISMATCH!>i<!>)
}
}
fun useInt(i: Int) = i