JET-65 Identifier in initializer block resolves to constructor parameter instead of property

+
Scopes for secondary constructors fixed
This commit is contained in:
Andrey Breslav
2011-06-02 13:35:45 +04:00
parent 826936785a
commit 7a8ea7fd88
3 changed files with 56 additions and 16 deletions
+18 -1
View File
@@ -1,6 +1,6 @@
class A(~a~val a : Int) {
this() {`$a`a}
~b~val b = `a`a
~b~val b = `$a`a
~f~fun f() = `$a`a
}
@@ -10,3 +10,20 @@ fun test() {
a.`b`b`:std::Int`
a.`f`f()`:std::Int`
}
namespace Jet65 {
class Foo(~bar~var bar : Int, ~barr~barr : Int, ~barrr~val barrr : Int) {
{
`$bar`bar = 1
`barr`barr = 1
`$barrr`barrr = 1
}
this(~s.bar~val bar : Int) : this(1, 1, 1) {
`s.bar`bar = 1
this.`$bar`bar
}
}
}