$field is only allowed in property accessors

This commit is contained in:
Andrey Breslav
2011-04-20 16:25:35 +04:00
parent 9add2b6114
commit ca579e25b7
3 changed files with 21 additions and 3 deletions
+10
View File
@@ -8,3 +8,13 @@
val xx : Int = 1 + x
get() : Int = 1
<error>set(ref value : Long) {$x = value}</error>
class Test {
var a : Int
var b : Int get() = <error>$a</error>; set(x) {a = x; <error>$a</error> = x}
this() {
<error>$b</error> = <error>$a</error>
a = <error>$b</error>
}
}
@@ -15,6 +15,8 @@ class Test {
<info>get</info>() { return 1 }
val c4 : Int
<info>get</info>() { 1 }
val <info>c5</info> : Int
<info>get</info>() { $c5 + 1 }
<info>abstract</info> var y : Int
<info>abstract</info> var y1 : Int <info>get</info>
@@ -28,4 +30,7 @@ class Test {
var <info>v2</info> : Int <info>get</info> <info>set</info>
var <info>v3</info> : Int <info>get</info>() = 1; <info>set</info>
var v4 : Int <info>get</info>() = 1; <info>set</info>(x){}
var <info>v5</info> : Int <info>get</info>() = 1; <info>set</info>(x){$v5 = x}
var <info>v6</info> : Int <info>get</info>() = $v6 + 1; <info>set</info>(x){}
}