Set reference target and report custom error instead unresolved reference for cases: interface, generic parameter, object + invoke, class without companion.
#KT-2787 Fixed.
This commit is contained in:
+1
-1
@@ -27,7 +27,7 @@ fun test(<!UNUSED_PARAMETER!>l<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util
|
||||
checkSubtype<Set<Int>?>(Collections.singleton<Int>(1))
|
||||
Collections.singleton<Int>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1.0<!>)
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>List<!><Int>
|
||||
<!RESOLUTION_TO_CLASSIFIER!>List<!><Int>
|
||||
|
||||
|
||||
val <!UNUSED_VARIABLE!>o<!> = "sdf" as <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Object<!>
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
||||
with.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedWithClassObject<!>.foo()
|
||||
with.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedEnum<!>.A
|
||||
with.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedObj<!>
|
||||
with.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||
with.<!RESOLUTION_TO_CLASSIFIER!>NestedObj<!>()
|
||||
with.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedObj<!>.foo()
|
||||
|
||||
without.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
@@ -39,7 +39,7 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
||||
without.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedWithClassObject<!>.foo()
|
||||
without.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedEnum<!>.A
|
||||
without.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedObj<!>
|
||||
without.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||
without.<!RESOLUTION_TO_CLASSIFIER!>NestedObj<!>()
|
||||
without.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedObj<!>.foo()
|
||||
|
||||
obj.<!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
@@ -48,6 +48,6 @@ fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) {
|
||||
obj.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedWithClassObject<!>.foo()
|
||||
obj.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedEnum<!>.A
|
||||
obj.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedObj<!>
|
||||
obj.<!UNRESOLVED_REFERENCE!>NestedObj<!>()
|
||||
obj.<!RESOLUTION_TO_CLASSIFIER!>NestedObj<!>()
|
||||
obj.<!NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>NestedObj<!>.foo()
|
||||
}
|
||||
@@ -11,6 +11,6 @@ class C {
|
||||
}
|
||||
|
||||
fun f() {
|
||||
<!UNRESOLVED_REFERENCE!>TestInterface<!>()
|
||||
<!RESOLUTION_TO_CLASSIFIER!>TestInterface<!>()
|
||||
C.<!UNRESOLVED_REFERENCE!>I<!>()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
interface MutableMatrix<T> {
|
||||
}
|
||||
|
||||
fun <T> toMutableMatrix(): MutableMatrix<T> {
|
||||
return <!RESOLUTION_TO_CLASSIFIER!>MutableMatrix<!><T>()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> toMutableMatrix(): MutableMatrix<T>
|
||||
|
||||
public interface MutableMatrix</*0*/ T> {
|
||||
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
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
interface A
|
||||
|
||||
object B
|
||||
class C
|
||||
|
||||
fun test() {
|
||||
val interface_as_fun = <!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||
val interface_as_val = <!NO_COMPANION_OBJECT!>A<!>
|
||||
|
||||
val object_as_fun = <!FUNCTION_EXPECTED!>B<!>()
|
||||
val class_as_val = <!NO_COMPANION_OBJECT!>C<!>
|
||||
}
|
||||
|
||||
fun <T> bar() {
|
||||
val typeParameter_as_val = <!TYPE_PARAMETER_IS_NOT_AN_EXPRESSION!>T<!>
|
||||
val typeParameter_as_fun = <!RESOLUTION_TO_CLASSIFIER!>T<!>()
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T> bar(): kotlin.Unit
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
public interface A {
|
||||
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
|
||||
}
|
||||
|
||||
public object B {
|
||||
private constructor B()
|
||||
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
|
||||
}
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
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
|
||||
}
|
||||
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
|
||||
object X {
|
||||
interface A
|
||||
|
||||
object B
|
||||
class C
|
||||
}
|
||||
|
||||
fun testX() {
|
||||
val interface_as_fun = X.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||
val interface_as_val = X.<!NO_COMPANION_OBJECT!>A<!>
|
||||
|
||||
val object_as_fun = X.<!FUNCTION_EXPECTED!>B<!>()
|
||||
val class_as_val = X.<!NO_COMPANION_OBJECT!>C<!>
|
||||
}
|
||||
|
||||
class Y {
|
||||
interface A
|
||||
|
||||
object B
|
||||
class C
|
||||
}
|
||||
|
||||
fun testY() {
|
||||
val interface_as_fun = Y.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||
val interface_as_val = Y.<!NO_COMPANION_OBJECT!>A<!>
|
||||
|
||||
val object_as_fun = Y.<!FUNCTION_EXPECTED!>B<!>()
|
||||
val class_as_val = Y.<!NO_COMPANION_OBJECT!>C<!>
|
||||
}
|
||||
|
||||
fun test(x: X) {
|
||||
val interface_as_fun = x.<!RESOLUTION_TO_CLASSIFIER!>A<!>()
|
||||
val interface_as_val = x.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>A<!>
|
||||
|
||||
val object_as_fun = x.<!RESOLUTION_TO_CLASSIFIER!>B<!>()
|
||||
val class_as_val = x.<!NO_COMPANION_OBJECT, NESTED_CLASS_ACCESSED_VIA_INSTANCE_REFERENCE!>C<!>
|
||||
}
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ x: X): kotlin.Unit
|
||||
public fun testX(): kotlin.Unit
|
||||
public fun testY(): kotlin.Unit
|
||||
|
||||
public object X {
|
||||
private constructor X()
|
||||
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
|
||||
|
||||
public interface A {
|
||||
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
|
||||
}
|
||||
|
||||
public object B {
|
||||
private constructor B()
|
||||
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
|
||||
}
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
public final class Y {
|
||||
public constructor Y()
|
||||
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
|
||||
|
||||
public interface A {
|
||||
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
|
||||
}
|
||||
|
||||
public object B {
|
||||
private constructor B()
|
||||
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
|
||||
}
|
||||
|
||||
public final class C {
|
||||
public constructor C()
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ object AnObject
|
||||
typealias TO = AnObject
|
||||
|
||||
val test6 = <!UNRESOLVED_REFERENCE!>TI<!>()
|
||||
val test6a = <!UNRESOLVED_REFERENCE!>Interface<!>()
|
||||
val test6a = <!RESOLUTION_TO_CLASSIFIER!>Interface<!>()
|
||||
|
||||
val test7 = <!FUNCTION_EXPECTED!>TO<!>()
|
||||
val test7a = <!FUNCTION_EXPECTED!>AnObject<!>()
|
||||
|
||||
Reference in New Issue
Block a user