Files
kotlin-fork/idea/testData/intentions/moveOutOfCompanion/movePropertyWithExternalRefs.kt
T
Alexey Sedunov 963747ce04 Move: Optimize conflict analysis
- Do not process conflicts twice wgen moving a directory
- Check move target before resolving usage context declaration
- Skip visibility check for usages referring to public declarations
- Skip module conflict check for declarations with unchanged module
- Do not report lambdas as usage container (use enclosing declaration)
2017-09-25 14:40:16 +03:00

25 lines
531 B
Kotlin
Vendored

// WITH_RUNTIME
// SHOULD_FAIL_WITH: 'foo' in class B will require class instance, 'foo' in function test() will require class instance, 'foo' in function test() will require class instance, 'foo' in function test() will require class instance
class A {
companion object {
class B {
init {
foo + 1
}
}
val <caret>foo: Int = 1
}
fun bar() {
foo + 1
}
}
fun test() {
A.foo + 1
A.Companion.foo + 1
with(A) {
foo + 1
}
}