Make proper scope for property declaration
Make sure same scope is used for both property creation and for properly body resolution. This fixes KT-421 Strange 'unresolved' bug with backing fields.
This commit is contained in:
+2
-2
@@ -243,7 +243,7 @@ class Outer() {
|
||||
}
|
||||
|
||||
class ForwardAccessToBackingField() { //kt-147
|
||||
val a = <!UNRESOLVED_REFERENCE, UNINITIALIZED_VARIABLE!>$a<!> // error
|
||||
val a = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, UNINITIALIZED_VARIABLE!>$a<!> // error
|
||||
val b = <!UNINITIALIZED_VARIABLE!>$c<!> // error
|
||||
val c = 1
|
||||
}
|
||||
@@ -349,4 +349,4 @@ fun test(m : M) {
|
||||
fun test1(m : M) {
|
||||
<!VAL_REASSIGNMENT!>m.x<!>++
|
||||
m.y--
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
class Cyclic() {
|
||||
val a = <!UNRESOLVED_REFERENCE, UNINITIALIZED_VARIABLE!>$a<!>
|
||||
val a = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, UNINITIALIZED_VARIABLE!>$a<!>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// http://youtrack.jetbrains.net/issue/KT-421
|
||||
// KT-421 Strange 'unresolved' bug with backing fields
|
||||
|
||||
class A() {
|
||||
val c = 1
|
||||
val a = <!UNINITIALIZED_VARIABLE!>b<!>
|
||||
val b = $c // '$c' is unresolved
|
||||
}
|
||||
Reference in New Issue
Block a user