changed local extensions priority
local extensions aren't longer chosen before members
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun B.foo() = 2
|
||||
}
|
||||
|
||||
class B {
|
||||
~A.foo~fun A.foo() = 1
|
||||
|
||||
fun A.bar() = `A.foo`foo()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A
|
||||
|
||||
class B {
|
||||
fun A.bar() = `A.foo`foo()
|
||||
}
|
||||
|
||||
~A.foo~fun A.foo() = 1
|
||||
|
||||
fun B.foo() = 2
|
||||
@@ -0,0 +1,7 @@
|
||||
class A
|
||||
class B {
|
||||
fun foo() = 1
|
||||
~A.foo~fun A.foo() = 2
|
||||
|
||||
fun A.bar() = `A.foo`foo()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class A
|
||||
fun A.foo() = 2
|
||||
|
||||
class B {
|
||||
~foo~fun A.foo() = 1
|
||||
|
||||
fun A.bar() = `foo`foo()
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
class A {
|
||||
fun foo() = 1
|
||||
}
|
||||
class B {
|
||||
}
|
||||
~B.foo~fun B.foo() = 2
|
||||
|
||||
fun test(a: A, b: B) {
|
||||
with (a) {
|
||||
with (b) {
|
||||
`B.foo`foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun <T, R> with(receiver: T, f: T.() -> R) : R = receiver.f()
|
||||
@@ -0,0 +1,12 @@
|
||||
class A {
|
||||
}
|
||||
~extension~fun A.foo() = 1
|
||||
fun foo() = 2
|
||||
|
||||
fun test(a: A) {
|
||||
with (a) {
|
||||
`extension`foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun <T, R> with(receiver: T, f: T.() -> R) : R = receiver.f()
|
||||
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
fun foo() = 1
|
||||
|
||||
fun test() {
|
||||
fun ~local~foo() = 2
|
||||
`local`foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun ~member~foo() = 1
|
||||
|
||||
fun test() {
|
||||
this.`member`foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun A.foo() = 2
|
||||
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
fun ~member~foo() = 1
|
||||
|
||||
fun test() {
|
||||
this.`member`foo()
|
||||
}
|
||||
|
||||
fun A.foo() = 2
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
class A {
|
||||
fun ~member~foo() = 1
|
||||
}
|
||||
|
||||
fun A.foo() = 2
|
||||
|
||||
fun test(a: A) {
|
||||
with (a) {
|
||||
this.`member`foo()
|
||||
}
|
||||
}
|
||||
|
||||
fun <T, R> with(receiver: T, f: T.() -> R) : R = receiver.f()
|
||||
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
fun ~member~foo() = 1
|
||||
|
||||
fun test() {
|
||||
fun A.foo() = 2
|
||||
this.`member`foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
~A.foo~fun foo() = 1
|
||||
}
|
||||
|
||||
class B {
|
||||
fun foo() = 2
|
||||
|
||||
fun A.bar() = `A.foo`foo()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A
|
||||
|
||||
class B {
|
||||
fun foo() = 2
|
||||
|
||||
fun A.bar() = `A.foo`foo()
|
||||
}
|
||||
|
||||
~A.foo~fun A.foo() = 1
|
||||
Reference in New Issue
Block a user