Frontend: fixed explicit receiver kind for dynamic call with implicit dispatch receiver.
Additionally added tests for other cases.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
fun bar(a: dynamic ) {
|
||||
a.<caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fun bar(a: dynamic ) {
|
||||
a.<caret>foo()
|
||||
}
|
||||
|
||||
|
||||
Resolved call:
|
||||
|
||||
Resulting descriptor: fun foo(): dynamic defined in bar
|
||||
|
||||
Explicit receiver kind = DISPATCH_RECEIVER
|
||||
Dispatch receiver = a {('Nothing'..'Any?')}
|
||||
Extension receiver = NO_RECEIVER
|
||||
@@ -0,0 +1,5 @@
|
||||
fun dynamic.foo() {}
|
||||
|
||||
fun bar(a: dynamic) {
|
||||
a.<caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fun dynamic.foo() {}
|
||||
|
||||
fun bar(a: dynamic) {
|
||||
a.<caret>foo()
|
||||
}
|
||||
|
||||
|
||||
Resolved call:
|
||||
|
||||
Resulting descriptor: fun dynamic.foo(): Unit defined in root package
|
||||
|
||||
Explicit receiver kind = EXTENSION_RECEIVER
|
||||
Dispatch receiver = NO_RECEIVER
|
||||
Extension receiver = a {('Nothing'..'Any?')}
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun dynamic.foo() {}
|
||||
}
|
||||
|
||||
fun bar(a: A, b: dynamic) {
|
||||
with (a) {
|
||||
b.<caret>foo()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
class A {
|
||||
fun dynamic.foo() {}
|
||||
}
|
||||
|
||||
fun bar(a: A, b: dynamic) {
|
||||
with (a) {
|
||||
b.<caret>foo()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Resolved call:
|
||||
|
||||
Resulting descriptor: fun dynamic.foo(): Unit defined in A
|
||||
|
||||
Explicit receiver kind = EXTENSION_RECEIVER
|
||||
Dispatch receiver = AExt{fun A.<anonymous>(): Unit defined in bar}
|
||||
Extension receiver = b {('Nothing'..'Any?')}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class A {
|
||||
fun dynamic.foo() {}
|
||||
}
|
||||
|
||||
fun bar(a: A, b: dynamic) {
|
||||
with (a) {
|
||||
with (b) {
|
||||
<caret>foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
class A {
|
||||
fun dynamic.foo() {}
|
||||
}
|
||||
|
||||
fun bar(a: A, b: dynamic) {
|
||||
with (a) {
|
||||
with (b) {
|
||||
<caret>foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Resolved call:
|
||||
|
||||
Resulting descriptor: fun dynamic.foo(): Unit defined in A
|
||||
|
||||
Explicit receiver kind = NO_EXPLICIT_RECEIVER
|
||||
Dispatch receiver = AExt{fun A.<anonymous>(): Unit defined in bar}
|
||||
Extension receiver = ('Nothing'..'Any?')Ext{fun dynamic.<anonymous>(): Unit defined in bar.<anonymous>}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun dynamic.bar() {
|
||||
<caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fun dynamic.bar() {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
|
||||
Resolved call:
|
||||
|
||||
Resulting descriptor: fun foo(): dynamic defined in bar
|
||||
|
||||
Explicit receiver kind = NO_EXPLICIT_RECEIVER
|
||||
Dispatch receiver = ('Nothing'..'Any?')Ext{fun dynamic.bar(): Unit defined in root package}
|
||||
Extension receiver = NO_RECEIVER
|
||||
@@ -0,0 +1,5 @@
|
||||
fun dynamic.foo() {}
|
||||
|
||||
fun dynamic.bar() {
|
||||
<caret>foo()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fun dynamic.foo() {}
|
||||
|
||||
fun dynamic.bar() {
|
||||
<caret>foo()
|
||||
}
|
||||
|
||||
|
||||
Resolved call:
|
||||
|
||||
Resulting descriptor: fun dynamic.foo(): Unit defined in root package
|
||||
|
||||
Explicit receiver kind = NO_EXPLICIT_RECEIVER
|
||||
Dispatch receiver = NO_RECEIVER
|
||||
Extension receiver = ('Nothing'..'Any?')Ext{fun dynamic.bar(): Unit defined in root package}
|
||||
Reference in New Issue
Block a user