Discriminate calls with implicit dynamic receivers
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// !MARK_DYNAMIC_CALLS
|
||||
|
||||
fun foo() {
|
||||
fun test() {
|
||||
dynamic {
|
||||
<!DEBUG_INFO_DYNAMIC!>foo<!>()
|
||||
<!DEBUG_INFO_DYNAMIC!>bar<!>.<!DEBUG_INFO_DYNAMIC!>baz<!>(0)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package
|
||||
|
||||
internal fun </*0*/ T> dynamic(/*0*/ body: dynamic.() -> T): T
|
||||
internal fun foo(): kotlin.Unit
|
||||
internal fun test(): kotlin.Unit
|
||||
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
// !MARK_DYNAMIC_CALLS
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun dynamic.test() {
|
||||
<!DEBUG_INFO_DYNAMIC!>foo<!>()
|
||||
<!DEBUG_INFO_DYNAMIC!>ext<!>()
|
||||
|
||||
bar()
|
||||
this.<!DEBUG_INFO_DYNAMIC!>bar<!>()
|
||||
|
||||
baz = 2
|
||||
this.<!DEBUG_INFO_DYNAMIC!>baz<!> = 2
|
||||
|
||||
"".ext()
|
||||
<!DEBUG_INFO_DYNAMIC!>ext<!>()
|
||||
|
||||
"".extValFun()
|
||||
<!DEBUG_INFO_DYNAMIC!>extValFun<!>()
|
||||
|
||||
"".extVal
|
||||
<!DEBUG_INFO_DYNAMIC!>extVal<!>
|
||||
|
||||
baz.extExtVal()
|
||||
<!DEBUG_INFO_DYNAMIC!>extExtVal<!>()
|
||||
|
||||
""()
|
||||
<!DEBUG_INFO_DYNAMIC!>this<!>()
|
||||
|
||||
C() + C()
|
||||
<!NO_VALUE_FOR_PARAMETER!>+<!>C()
|
||||
|
||||
this <!DEBUG_INFO_DYNAMIC!>+<!> C()
|
||||
|
||||
0.<!UNRESOLVED_REFERENCE!>missing<!>()
|
||||
}
|
||||
|
||||
fun bar() {}
|
||||
var baz = 1
|
||||
|
||||
fun Any.ext() {}
|
||||
|
||||
val Any.extValFun: () -> Unit get() = null!!
|
||||
val Any.extVal: () -> Unit get() = null!!
|
||||
|
||||
val Any.extExtVal: Any.() -> Unit get() = null!!
|
||||
|
||||
fun Any.invoke() {}
|
||||
|
||||
fun Any.plus(a: Any) {}
|
||||
|
||||
class C {
|
||||
|
||||
fun String.invoke() {}
|
||||
val foo: String.() -> Unit = null!!
|
||||
|
||||
val s: String = ""
|
||||
|
||||
val withInvoke = WithInvoke()
|
||||
|
||||
fun dynamic.test() {
|
||||
s()
|
||||
<!DEBUG_INFO_DYNAMIC!>this<!>()
|
||||
|
||||
s.foo()
|
||||
this.<!DEBUG_INFO_DYNAMIC!>foo<!>()
|
||||
|
||||
withInvoke()
|
||||
this@C.withInvoke()
|
||||
}
|
||||
}
|
||||
|
||||
class WithInvoke {
|
||||
fun invoke() {}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package
|
||||
|
||||
internal var baz: kotlin.Int
|
||||
internal val kotlin.Any.extExtVal: kotlin.Any.() -> kotlin.Unit
|
||||
internal val kotlin.Any.extVal: () -> kotlin.Unit
|
||||
internal val kotlin.Any.extValFun: () -> kotlin.Unit
|
||||
internal fun bar(): kotlin.Unit
|
||||
internal fun kotlin.Any.ext(): kotlin.Unit
|
||||
internal fun kotlin.Any.invoke(): kotlin.Unit
|
||||
internal fun kotlin.Any.plus(/*0*/ a: kotlin.Any): kotlin.Unit
|
||||
internal fun dynamic.test(): kotlin.Unit
|
||||
|
||||
internal final class C {
|
||||
public constructor C()
|
||||
internal final val foo: kotlin.String.() -> kotlin.Unit
|
||||
internal final val s: kotlin.String = ""
|
||||
internal final val withInvoke: WithInvoke
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
internal final fun kotlin.String.invoke(): kotlin.Unit
|
||||
internal final fun dynamic.test(): kotlin.Unit
|
||||
}
|
||||
|
||||
internal final class WithInvoke {
|
||||
public constructor WithInvoke()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
internal final fun invoke(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user