Refactoring & clarification: implement new FIR tower resolver
This commit is contained in:
@@ -2,6 +2,6 @@ fun bar(doIt: Int.() -> Int) {
|
||||
1.doIt()
|
||||
1?.doIt()
|
||||
val i: Int? = 1
|
||||
i.<!UNRESOLVED_REFERENCE!>doIt<!>()
|
||||
i.doIt()
|
||||
i?.doIt()
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ class X {}
|
||||
val s = java
|
||||
val ss = System
|
||||
val sss = X
|
||||
val x = "${System}"
|
||||
val x = "${<!UNRESOLVED_REFERENCE!>System<!>}"
|
||||
val xs = java.lang
|
||||
val xss = java.lang.System
|
||||
val xsss = foo.X
|
||||
|
||||
+1
-1
@@ -5,5 +5,5 @@ class Outer {
|
||||
|
||||
fun test() {
|
||||
Outer()::Inner
|
||||
Outer()::Nested
|
||||
<!UNRESOLVED_REFERENCE!>Outer()::Nested<!>
|
||||
}
|
||||
|
||||
compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.fir.kt
Vendored
+2
-2
@@ -9,6 +9,6 @@ public class A {
|
||||
enum class E { EN }
|
||||
|
||||
fun test() {
|
||||
A()::test
|
||||
E.EN::valueOf
|
||||
<!UNRESOLVED_REFERENCE!>A()::test<!>
|
||||
<!UNRESOLVED_REFERENCE!>E.EN::valueOf<!>
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,6 +16,6 @@ fun test() {
|
||||
|
||||
Outer.Companion::Wrapper
|
||||
(Outer.Companion)::Wrapper
|
||||
Outer::Wrapper
|
||||
(Outer)::Wrapper
|
||||
<!UNRESOLVED_REFERENCE!>Outer::Wrapper<!>
|
||||
<!UNRESOLVED_REFERENCE!>(Outer)::Wrapper<!>
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,5 +15,5 @@ fun take(f: () -> Unit) {}
|
||||
fun test() {
|
||||
B::foo checkType { <!UNRESOLVED_REFERENCE!>_<!><KFunction1<B, Unit>>() }
|
||||
|
||||
take(B::foo)
|
||||
<!INAPPLICABLE_CANDIDATE!>take<!>(B::foo)
|
||||
}
|
||||
|
||||
+3
-3
@@ -18,7 +18,7 @@ import test.A
|
||||
|
||||
fun foo(args: Array<String>) {
|
||||
val main2 = A::main
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction1<Array<String>, Unit>>(main2)
|
||||
<!INAPPLICABLE_CANDIDATE!>main2<!>(args)
|
||||
<!INAPPLICABLE_CANDIDATE!>(A::main)(args)<!>
|
||||
checkSubtype<KFunction1<Array<String>, Unit>>(main2)
|
||||
main2(args)
|
||||
(A::main)(args)
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -10,7 +10,7 @@ class A {
|
||||
val y = A::Nested
|
||||
|
||||
checkSubtype<KFunction0<Nested>>(x)
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction0<Nested>>(y)
|
||||
checkSubtype<KFunction0<Nested>>(y)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@@ -18,7 +18,7 @@ class A {
|
||||
::Nested
|
||||
val y = A::Nested
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction0<A.Nested>>(y)
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,6 @@ class B {
|
||||
<!UNRESOLVED_REFERENCE!>::Nested<!>
|
||||
val y = A::Nested
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction0<A.Nested>>(y)
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
}
|
||||
compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.fir.kt
Vendored
+3
-3
@@ -7,15 +7,15 @@ class A {
|
||||
}
|
||||
|
||||
fun A.main() {
|
||||
::Nested
|
||||
<!UNRESOLVED_REFERENCE!>::Nested<!>
|
||||
val y = A::Nested
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction0<A.Nested>>(y)
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
|
||||
fun Int.main() {
|
||||
<!UNRESOLVED_REFERENCE!>::Nested<!>
|
||||
val y = A::Nested
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction0<A.Nested>>(y)
|
||||
checkSubtype<KFunction0<A.Nested>>(y)
|
||||
}
|
||||
Vendored
+1
-1
@@ -9,5 +9,5 @@ class A {
|
||||
fun main() {
|
||||
val x = A::Nested
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>checkSubtype<!><KFunction0<A.Nested>>(x)
|
||||
checkSubtype<KFunction0<A.Nested>>(x)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
package foo
|
||||
|
||||
fun test() {
|
||||
<!UNRESOLVED_REFERENCE!>foo::test<!>
|
||||
foo::test
|
||||
}
|
||||
|
||||
// FILE: qualifiedName.kt
|
||||
@@ -12,5 +12,5 @@ fun test() {
|
||||
package foo.bar
|
||||
|
||||
fun test() {
|
||||
<!UNRESOLVED_REFERENCE!>foo.bar::test<!>
|
||||
foo.bar::test
|
||||
}
|
||||
|
||||
+2
-2
@@ -14,14 +14,14 @@ class A {
|
||||
|
||||
fun A.foo(): String = "A"
|
||||
|
||||
val x0 = A::foo
|
||||
val x0 = <!UNRESOLVED_REFERENCE!>A::foo<!>
|
||||
|
||||
val x1 = ofType<(A) -> Unit>(A::foo)
|
||||
val x2 = ofType<KProperty1<A, Int>>(A::foo)
|
||||
val x3: KProperty1<A, Int> = A::foo
|
||||
val x4: (A) -> String = A::foo
|
||||
|
||||
val y0 = A::bar
|
||||
val y0 = <!UNRESOLVED_REFERENCE!>A::bar<!>
|
||||
val y1 = ofType<(A) -> Unit>(A::bar)
|
||||
val y2 = ofType<KProperty1<A, Int>>(A::bar)
|
||||
val y3: KProperty1<A, Int> = A::bar
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ class A() {
|
||||
val x = 1
|
||||
|
||||
companion object {
|
||||
val y = x
|
||||
val y = <!UNRESOLVED_REFERENCE!>x<!>
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -21,7 +21,7 @@ enum class C {
|
||||
C.A()
|
||||
A()
|
||||
//TODO: should be resolved with error
|
||||
this.A()
|
||||
this.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ enum class C {
|
||||
|
||||
fun f() {
|
||||
C.E1.A
|
||||
C.E1.A()
|
||||
C.E1.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
C.E2.B()
|
||||
|
||||
C.E2.O
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ enum class C {
|
||||
C.A()
|
||||
A()
|
||||
//TODO: should be resolved with error
|
||||
this.A()
|
||||
this.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@ enum class C {
|
||||
|
||||
fun f() {
|
||||
C.E1.A
|
||||
C.E1.A()
|
||||
C.E1.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
C.E2.B()
|
||||
|
||||
C.E2.O
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ class Test {
|
||||
fun test(): Int = 12
|
||||
|
||||
companion object {
|
||||
val a = test() // Check if resolver will be able to infer type of a variable
|
||||
val a = <!UNRESOLVED_REFERENCE!>test<!>() // Check if resolver will be able to infer type of a variable
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ class My {
|
||||
|
||||
companion object {
|
||||
|
||||
val y = foo()
|
||||
val y = <!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
|
||||
val u = bar()
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@ class TopLevel {
|
||||
fun useNested() {
|
||||
val d = TopLevel.Nested.use()
|
||||
TopLevel.Nested.Nested2()
|
||||
TopLevel.Nested.CompanionNested2()
|
||||
TopLevel.Nested.<!UNRESOLVED_REFERENCE!>CompanionNested2<!>()
|
||||
}
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ enum class A {
|
||||
A1,
|
||||
A2;
|
||||
|
||||
fun valueOf(s: String): A = <!AMBIGUITY!>valueOf<!>(s)
|
||||
fun valueOf(s: String): A = valueOf(s)
|
||||
|
||||
fun valueOf() = "OK"
|
||||
|
||||
|
||||
@@ -10,6 +10,6 @@ public enum A {
|
||||
|
||||
fun main() {
|
||||
val c: A = A.ENTRY
|
||||
val c2: String? = c.<!AMBIGUITY!>ENTRY<!>
|
||||
val c3: String? = A.ANOTHER.<!AMBIGUITY!>ENTRY<!>
|
||||
val c2: String? = c.ENTRY
|
||||
val c3: String? = A.ANOTHER.ENTRY
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ public class A {
|
||||
// FILE: B.kt
|
||||
fun Any?.bar() = 42
|
||||
|
||||
fun f1() = A.bar()
|
||||
fun f2() = A.Nested.bar()
|
||||
fun f1() = A.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
fun f2() = A.Nested.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
|
||||
+1
-1
@@ -12,5 +12,5 @@ fun <V, T : V?> G<T>.foo(vararg values: V2<V?>) = build()
|
||||
fun forReference(ref: Any?) {}
|
||||
|
||||
fun test() {
|
||||
forReference(<!UNRESOLVED_REFERENCE!>G<Int?>::foo<!>)
|
||||
<!INAPPLICABLE_CANDIDATE!>forReference<!>(<!UNRESOLVED_REFERENCE!>G<Int?>::foo<!>)
|
||||
}
|
||||
|
||||
@@ -23,6 +23,6 @@ class Outer {
|
||||
|
||||
fun Outer.foo() {
|
||||
Outer()
|
||||
Nested()
|
||||
<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
Inner()
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ class Test {
|
||||
fun more(): InnerClass {
|
||||
val b = InnerClass()
|
||||
|
||||
val testVal = inClass
|
||||
foo()
|
||||
val testVal = <!UNRESOLVED_REFERENCE!>inClass<!>
|
||||
<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ class Test {
|
||||
fun more(): InnerClass {
|
||||
val b = InnerClass()
|
||||
|
||||
val testVal = inClass
|
||||
foo()
|
||||
val testVal = <!UNRESOLVED_REFERENCE!>inClass<!>
|
||||
<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
|
||||
return b
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ class Outer {
|
||||
class Nested {
|
||||
fun foo() {
|
||||
class Local {
|
||||
val state = outerState
|
||||
val state = <!UNRESOLVED_REFERENCE!>outerState<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-9
@@ -24,30 +24,30 @@ object Obj {
|
||||
}
|
||||
|
||||
fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
||||
with.Nested()
|
||||
with.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
with.NestedWithClassObject
|
||||
with.NestedWithClassObject()
|
||||
with.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
||||
with.NestedWithClassObject.foo()
|
||||
with.NestedEnum.A
|
||||
with.NestedObj
|
||||
with.<!INAPPLICABLE_CANDIDATE!>NestedObj<!>()
|
||||
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||
with.NestedObj.foo()
|
||||
|
||||
without.Nested()
|
||||
without.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
without.NestedWithClassObject
|
||||
without.NestedWithClassObject()
|
||||
without.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
||||
without.NestedWithClassObject.foo()
|
||||
without.NestedEnum.A
|
||||
without.NestedObj
|
||||
without.<!INAPPLICABLE_CANDIDATE!>NestedObj<!>()
|
||||
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||
without.NestedObj.foo()
|
||||
|
||||
obj.Nested()
|
||||
obj.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
obj.NestedWithClassObject
|
||||
obj.NestedWithClassObject()
|
||||
obj.<!UNRESOLVED_REFERENCE!>NestedWithClassObject<!>()
|
||||
obj.NestedWithClassObject.foo()
|
||||
obj.NestedEnum.A
|
||||
obj.NestedObj
|
||||
obj.<!INAPPLICABLE_CANDIDATE!>NestedObj<!>()
|
||||
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||
obj.NestedObj.foo()
|
||||
}
|
||||
+2
-2
@@ -5,8 +5,8 @@ class Outer {
|
||||
val property = ""
|
||||
|
||||
class Nested {
|
||||
fun f() = function()
|
||||
fun g() = property
|
||||
fun f() = <!UNRESOLVED_REFERENCE!>function<!>()
|
||||
fun g() = <!UNRESOLVED_REFERENCE!>property<!>
|
||||
fun h() = this@Outer.function()
|
||||
fun i() = this@Outer.property
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ open class Base {
|
||||
|
||||
class Derived : Base() {
|
||||
class Nested {
|
||||
fun bar() = foo()
|
||||
fun bar() = <!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
}
|
||||
}
|
||||
Vendored
+2
-2
@@ -119,8 +119,8 @@ class C : O.B() {
|
||||
val b = O.A::foo
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = <!UNRESOLVED_REFERENCE!>O.A.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionA<!>::foo<!>
|
||||
val f = <!UNRESOLVED_REFERENCE!>O.B.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionB<!>::foo<!>
|
||||
val e = O.A.Companion.FromCompanionA::foo
|
||||
val f = O.B.Companion.FromCompanionB::foo
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha::foo
|
||||
|
||||
Vendored
+2
-2
@@ -119,8 +119,8 @@ class C : O.B() {
|
||||
val b = O.A::foo
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = <!UNRESOLVED_REFERENCE!>O.A.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionA<!>::foo<!>
|
||||
val f = <!UNRESOLVED_REFERENCE!>O.B.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionB<!>::foo<!>
|
||||
val e = O.A.Companion.FromCompanionA::foo
|
||||
val f = O.B.Companion.FromCompanionB::foo
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha::foo
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ class Derived : Base() {
|
||||
syntheticSam { }
|
||||
|
||||
// Instance members shouldn't be affected, but we check them, just in case
|
||||
val y = <!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!>
|
||||
<!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!> = 43
|
||||
val y = instanceSyntheticProperty
|
||||
instanceSyntheticProperty = 43
|
||||
|
||||
// Note that statics actually aren't converted into synthetic property in Kotlin
|
||||
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ class Derived : Base() {
|
||||
syntheticSam { }
|
||||
|
||||
// Instance members shouldn't be affected, but we check them, just in case
|
||||
val y = <!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!>
|
||||
<!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!> = 43
|
||||
val y = instanceSyntheticProperty
|
||||
instanceSyntheticProperty = 43
|
||||
|
||||
// Note that statics actually aren't converted into synthetic property in Kotlin
|
||||
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
|
||||
|
||||
Vendored
+2
-2
@@ -39,8 +39,8 @@ class Derived : Base() {
|
||||
syntheticSam { }
|
||||
|
||||
// Instance members shouldn't be affected, but we check them, just in case
|
||||
val y = <!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!>
|
||||
<!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!> = 43
|
||||
val y = instanceSyntheticProperty
|
||||
instanceSyntheticProperty = 43
|
||||
|
||||
// Note that statics actually aren't converted into synthetic property in Kotlin
|
||||
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
|
||||
|
||||
Vendored
+2
-2
@@ -39,8 +39,8 @@ class Derived : Base() {
|
||||
syntheticSam { }
|
||||
|
||||
// Instance members shouldn't be affected, but we check them, just in case
|
||||
val y = <!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!>
|
||||
<!UNRESOLVED_REFERENCE!>instanceSyntheticProperty<!> = 43
|
||||
val y = instanceSyntheticProperty
|
||||
instanceSyntheticProperty = 43
|
||||
|
||||
// Note that statics actually aren't converted into synthetic property in Kotlin
|
||||
val x = <!UNRESOLVED_REFERENCE!>syntheticProperty<!>
|
||||
|
||||
+2
-2
@@ -77,8 +77,8 @@ class C : O.B() {
|
||||
val b = O.B()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = O.A.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionA<!>()
|
||||
val f = O.B.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionB<!>()
|
||||
val e = O.A.Companion.FromCompanionA()
|
||||
val f = O.B.Companion.FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha()
|
||||
|
||||
+2
-2
@@ -77,8 +77,8 @@ class C : O.B() {
|
||||
val b = O.B()
|
||||
|
||||
// DEPRECATED: Classifiers from companions of direct superclasses
|
||||
val e = O.A.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionA<!>()
|
||||
val f = O.B.<!AMBIGUITY!>Companion<!>.<!UNRESOLVED_REFERENCE!>FromCompanionB<!>()
|
||||
val e = O.A.Companion.FromCompanionA()
|
||||
val f = O.B.Companion.FromCompanionB()
|
||||
|
||||
// INVISIBLE: "cousin" supertypes themselves
|
||||
val g = O.Alpha()
|
||||
|
||||
@@ -11,7 +11,7 @@ interface TypeConstructor
|
||||
|
||||
class Refiner {
|
||||
val memoizedFunctionLambda = createMemoizedFunction { it.<!INAPPLICABLE_CANDIDATE!>foo<!>() } // error type infered, no diagnostic, BAD, backend fails
|
||||
val memoizedFunctionReference = createMemoizedFunction(TypeConstructor::foo) // EXTENSION_IN_CLASS_REFERENCE_IS_NOT_ALLOWED, fine
|
||||
val memoizedFunctionReference = <!INAPPLICABLE_CANDIDATE!>createMemoizedFunction<!>(<!UNRESOLVED_REFERENCE!>TypeConstructor::foo<!>) // EXTENSION_IN_CLASS_REFERENCE_IS_NOT_ALLOWED, fine
|
||||
val memoizedFunctionTypes = createMemoizedFunction<TypeConstructor, Boolean> { it.foo() } // works fine
|
||||
|
||||
private fun TypeConstructor.foo(): Boolean = true
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// KT-5362 Compiler crashes on access to extension method from nested class
|
||||
class Outer {
|
||||
class Nested{
|
||||
fun foo(s: String) = s.extension()
|
||||
fun foo(s: String) = s.<!UNRESOLVED_REFERENCE!>extension<!>()
|
||||
}
|
||||
|
||||
private fun String.extension(): String = this
|
||||
@@ -12,7 +12,7 @@ class Outer {
|
||||
fun Activity.toast() = Unit
|
||||
class Activity(){
|
||||
class Fragment{
|
||||
fun call() = toast()
|
||||
fun call() = <!INAPPLICABLE_CANDIDATE!>toast<!>()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ fun test() {
|
||||
with(D()) {
|
||||
x()
|
||||
}
|
||||
A().<!UNRESOLVED_REFERENCE!>x<!>()
|
||||
A().x()
|
||||
}
|
||||
|
||||
foo2 {
|
||||
|
||||
Vendored
+2
-2
@@ -6,8 +6,8 @@ fun test1() {
|
||||
}
|
||||
|
||||
fun test2(f: String.(Int) -> Unit) {
|
||||
11.(<!UNRESOLVED_REFERENCE!>f<!>)(1)
|
||||
11.(<!UNRESOLVED_REFERENCE!>f<!>)()
|
||||
11.(<!INAPPLICABLE_CANDIDATE!>f<!>)(1)
|
||||
11.(<!INAPPLICABLE_CANDIDATE!>f<!>)()
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
|
||||
Vendored
+1
-1
@@ -10,5 +10,5 @@ fun test(identifier: SomeClass, fn: String.() -> Unit) {
|
||||
<!INAPPLICABLE_CANDIDATE!>identifier<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>identifier<!>(123)
|
||||
<!INAPPLICABLE_CANDIDATE!>identifier<!>(1, 2)
|
||||
1.<!UNRESOLVED_REFERENCE!>fn<!>()
|
||||
1.<!INAPPLICABLE_CANDIDATE!>fn<!>()
|
||||
}
|
||||
+2
-2
@@ -15,8 +15,8 @@ fun test(a: A) {
|
||||
a.<!INAPPLICABLE_CANDIDATE!>x<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>(a.x)()<!>
|
||||
if (a.x != null) {
|
||||
a.x() // todo
|
||||
(a.x)()
|
||||
a.<!INAPPLICABLE_CANDIDATE!>x<!>() // todo
|
||||
<!INAPPLICABLE_CANDIDATE!>(a.x)()<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+9
-9
@@ -13,9 +13,9 @@ fun test(a: A, b: B) {
|
||||
a.foo(b)
|
||||
|
||||
with(a) {
|
||||
b.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
b.foo()
|
||||
|
||||
b.(<!UNRESOLVED_REFERENCE!>foo<!>)()
|
||||
b.(foo)()
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>(b.<!INAPPLICABLE_CANDIDATE!>foo<!>)()<!>
|
||||
|
||||
@@ -24,10 +24,10 @@ fun test(a: A, b: B) {
|
||||
}
|
||||
|
||||
with(b) {
|
||||
a.foo()
|
||||
a.(foo)()
|
||||
a.<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
a.(<!INAPPLICABLE_CANDIDATE!>foo<!>)()
|
||||
|
||||
(a.foo)()
|
||||
<!INAPPLICABLE_CANDIDATE!>(a.foo)()<!>
|
||||
|
||||
(a.foo)(this)
|
||||
a.foo(this)
|
||||
@@ -59,17 +59,17 @@ fun test(a: A, b: B) {
|
||||
|
||||
b.(foo)()
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>(b.foo)()<!>
|
||||
<!UNRESOLVED_REFERENCE!>(b.<!UNRESOLVED_REFERENCE!>foo<!>)()<!>
|
||||
|
||||
foo(b)
|
||||
(foo)(b)
|
||||
}
|
||||
|
||||
with(b) {
|
||||
a.foo()
|
||||
a.(foo)()
|
||||
a.<!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
a.(<!INAPPLICABLE_CANDIDATE!>foo<!>)()
|
||||
|
||||
(a.foo)()
|
||||
<!INAPPLICABLE_CANDIDATE!>(a.foo)()<!>
|
||||
|
||||
(a.foo)(this)
|
||||
a.foo(this)
|
||||
|
||||
@@ -20,7 +20,7 @@ val D.attr: B
|
||||
|
||||
fun main() {
|
||||
val b = D()
|
||||
b.attr {} // overload resolution ambiguity
|
||||
b.<!AMBIGUITY!>attr<!> {} // overload resolution ambiguity
|
||||
|
||||
val d = b.attr
|
||||
d {} // no error
|
||||
|
||||
@@ -6,11 +6,11 @@ class B
|
||||
|
||||
fun test(a: A, b: B) {
|
||||
with(b) {
|
||||
a.foo() // here must be error, because a is not extension receiver
|
||||
a.<!INAPPLICABLE_CANDIDATE!>foo<!>() // here must be error, because a is not extension receiver
|
||||
|
||||
a.foo(this)
|
||||
|
||||
(a.foo)()
|
||||
<!INAPPLICABLE_CANDIDATE!>(a.foo)()<!>
|
||||
|
||||
(a.foo)(this)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -9,5 +9,5 @@ fun test(identifier: SomeClass, fn: String.() -> Unit) {
|
||||
<!INAPPLICABLE_CANDIDATE!>identifier<!>()
|
||||
<!INAPPLICABLE_CANDIDATE!>identifier<!>(123)
|
||||
<!INAPPLICABLE_CANDIDATE!>identifier<!>(1, 2)
|
||||
1.<!UNRESOLVED_REFERENCE!>fn<!>()
|
||||
1.<!INAPPLICABLE_CANDIDATE!>fn<!>()
|
||||
}
|
||||
Vendored
+1
-1
@@ -34,6 +34,6 @@ fun test(x: X) {
|
||||
val interface_as_fun = x.<!UNRESOLVED_REFERENCE!>A<!>()
|
||||
val interface_as_val = x.A
|
||||
|
||||
val object_as_fun = x.<!INAPPLICABLE_CANDIDATE!>B<!>()
|
||||
val object_as_fun = x.<!UNRESOLVED_REFERENCE!>B<!>()
|
||||
val class_as_val = x.C
|
||||
}
|
||||
@@ -12,9 +12,9 @@ enum class Foo {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
Foo.<!AMBIGUITY!>values<!>() <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Array<Foo>>() }
|
||||
Foo.values() checkType { <!UNRESOLVED_REFERENCE!>_<!><Array<Foo>>() }
|
||||
Foo.Companion.values() checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
||||
|
||||
Foo.<!AMBIGUITY!>valueOf<!>("") <!INAPPLICABLE_CANDIDATE!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Foo>() }
|
||||
Foo.valueOf("") checkType { <!UNRESOLVED_REFERENCE!>_<!><Foo>() }
|
||||
Foo.Companion.valueOf("") checkType { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
||||
}
|
||||
+2
-2
@@ -24,7 +24,7 @@ class C: B(), A {
|
||||
C.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
A.A_()
|
||||
A.<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
A.Companion.A_()
|
||||
C.<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
|
||||
@@ -34,7 +34,7 @@ class C: B(), A {
|
||||
C.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
|
||||
B_()
|
||||
B.B_()
|
||||
B.<!UNRESOLVED_REFERENCE!>B_<!>()
|
||||
B.Companion.B_()
|
||||
C.<!UNRESOLVED_REFERENCE!>B_<!>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ class D: C() {
|
||||
D.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
A.A_()
|
||||
A.<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
A.Companion.A_()
|
||||
C.<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
D.<!UNRESOLVED_REFERENCE!>A_<!>()
|
||||
@@ -44,7 +44,7 @@ class D: C() {
|
||||
D.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
|
||||
B_()
|
||||
B.B_()
|
||||
B.<!UNRESOLVED_REFERENCE!>B_<!>()
|
||||
B.Companion.B_()
|
||||
C.<!UNRESOLVED_REFERENCE!>B_<!>()
|
||||
D.<!UNRESOLVED_REFERENCE!>B_<!>()
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ open class A {
|
||||
fun bar() = 1
|
||||
}
|
||||
init {
|
||||
val a: Int = <!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
val a: Int = foo()
|
||||
val b: Int = bar()
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ open class B: A() {
|
||||
fun bar() = ""
|
||||
}
|
||||
init {
|
||||
val a: String = <!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
val a: String = foo()
|
||||
val b: String = bar()
|
||||
}
|
||||
}
|
||||
@@ -24,14 +24,14 @@ fun B.Companion.foo() = ""
|
||||
|
||||
class C: A() {
|
||||
init {
|
||||
val a: Int = <!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
val a: Int = foo()
|
||||
val b: Int = bar()
|
||||
}
|
||||
}
|
||||
|
||||
class D: B() {
|
||||
init {
|
||||
val a: String = <!INAPPLICABLE_CANDIDATE!>foo<!>()
|
||||
val a: String = foo()
|
||||
val b: String = bar()
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -27,14 +27,14 @@ open class C: A() {
|
||||
|
||||
init {
|
||||
val a: String = foo()
|
||||
val b: String = <!AMBIGUITY!>bar<!>
|
||||
val b: String = bar
|
||||
}
|
||||
}
|
||||
|
||||
class E: C() {
|
||||
init {
|
||||
val a: String = foo()
|
||||
val b: String = <!AMBIGUITY!>bar<!>
|
||||
val b: String = bar
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user