9c1551bca9
DataFlowValueFactory and its environment refactoring: containing declaration is added into factory functions as an argument and used to determine identifier stability. A few minor fixes. #KT-5907 Fixed. #KT-4450 Fixed. #KT-4409 Fixed. New tests for KT-4409, KT-4450, KT-5907 (public and protected value properties used from the same module or not, open properties, variable properties, delegated properties, properties with non-default getter). Public val test and KT-362 test changed accordingly.
36 lines
529 B
Kotlin
36 lines
529 B
Kotlin
// MODULE: m1
|
|
// FILE: a.kt
|
|
|
|
package a
|
|
|
|
public class X {
|
|
public val x : String? = null
|
|
}
|
|
|
|
// MODULE: m2(m1)
|
|
// FILE: b.kt
|
|
|
|
package b
|
|
|
|
import a.X
|
|
|
|
public fun X.gav(): Int {
|
|
if (x != null)
|
|
// Smart cast is not possible if definition is in another module
|
|
return x<!UNSAFE_CALL!>.<!>length()
|
|
else
|
|
return 0
|
|
}
|
|
|
|
// FILE: c.kt
|
|
|
|
package a
|
|
|
|
public fun X.gav(): Int {
|
|
if (x != null)
|
|
// Even if it's in the same package
|
|
return x<!UNSAFE_CALL!>.<!>length()
|
|
else
|
|
return 0
|
|
}
|