Changed scope for initializer of extension property /*not to resolve things like val List.length = size() */

This commit is contained in:
Svetlana Isakova
2012-03-28 13:14:35 +04:00
parent 4e7070d2b1
commit cd6f3139f0
6 changed files with 40 additions and 10 deletions
@@ -30,7 +30,7 @@ package closures
val x = this@B : B
val y = this@A : A
val z = this : B
val Int.xx = this : Int
val Int.xx : Int get() = this : Int
fun Char.xx() : Any {
this : Char
val <!UNUSED_VARIABLE!>a<!> = {Double.() -> this : Double + this@xx : Char}
@@ -0,0 +1,31 @@
package i
import java.util.List
val <T> List<T>.length = <!UNRESOLVED_REFERENCE!>size<!>()
val <T> List<T>.length1 : Int get() = size()
val String.bd = <!NO_THIS!>this<!> + "!"
val String.bd1 : String get() = this + "!"
class A {
val ii : Int = 1
}
val A.foo = <!UNRESOLVED_REFERENCE!>ii<!>
val A.foo1 : Int get() = ii
class C {
class D {}
}
val C.foo : C.D = <!UNRESOLVED_REFERENCE!>D<!>()
val C.bar : C.D = C().D()
val C.foo1 : C.D get() = D()
+1 -1
View File
@@ -5,7 +5,7 @@ package qualified_this {
val x = `qtB`this`qtB`@B
val y = `qtA`this`qtA`@A
val z = `qtB`this
~xx~val Int.xx = `xx`this : Int
~xx~val Int.xx get() = `xx`this : Int
~xx()~fun Int.xx() {
`xx()`this : Int
val a = {Int.() -> `xx()`this`xx()`@xx + this}