[FIR] Add object support as implicit invoke receiver

This commit is contained in:
Mikhail Glukhikh
2020-02-12 18:08:41 +03:00
parent a8a696c7e1
commit abfe566255
6 changed files with 38 additions and 20 deletions
@@ -7,9 +7,9 @@ object TestClass {
}
fun test(s: String): String {
val a = <!INAPPLICABLE_CANDIDATE!>TestClass<!> { <!INAPPLICABLE_CANDIDATE!>TestClass<!> { TestClass } }
a <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><TestClass>() }
val a = TestClass { TestClass { TestClass } }
a checkType { <!UNRESOLVED_REFERENCE!>_<!><TestClass>() }
val b = <!INAPPLICABLE_CANDIDATE!>TestClass<!> { return s }
b <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Nothing>() }
val b = TestClass { return s }
b checkType { <!UNRESOLVED_REFERENCE!>_<!><Nothing>() }
}
@@ -30,7 +30,7 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
with.NestedWithClassObject.foo()
with.NestedEnum.A
with.NestedObj
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
with.NestedObj()
with.NestedObj.foo()
without.<!UNRESOLVED_REFERENCE!>Nested<!>()
@@ -39,7 +39,7 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
without.NestedWithClassObject.foo()
without.NestedEnum.A
without.NestedObj
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
without.NestedObj()
without.NestedObj.foo()
obj.<!UNRESOLVED_REFERENCE!>Nested<!>()
@@ -48,6 +48,6 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
obj.NestedWithClassObject.foo()
obj.NestedEnum.A
obj.NestedObj
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
obj.NestedObj()
obj.NestedObj.foo()
}
@@ -3,5 +3,5 @@ object Foo {
}
fun main() {
<!INAPPLICABLE_CANDIDATE!>Foo<!><Int>()
Foo<Int>()
}