NI: Do not resolve static callable references on generic types
As they weren't resolved in old inference ^KT-35920 Fixed
This commit is contained in:
Generated
+5
@@ -2638,6 +2638,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.kt");
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt35920.kt")
|
||||||
|
public void testKt35920() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35920.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt8596.kt")
|
@TestMetadata("kt8596.kt")
|
||||||
public void testKt8596() throws Exception {
|
public void testKt8596() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt");
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt");
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ class PSICallResolver(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is DoubleColonLHS.Type -> {
|
is DoubleColonLHS.Type -> {
|
||||||
val qualifiedExpression = ktExpression.receiverExpression!!.let { it.referenceExpression() ?: it }
|
val qualifiedExpression = ktExpression.receiverExpression!!
|
||||||
val qualifier = expressionTypingContext.trace.get(BindingContext.QUALIFIER, qualifiedExpression)
|
val qualifier = expressionTypingContext.trace.get(BindingContext.QUALIFIER, qualifiedExpression)
|
||||||
LHSResult.Type(qualifier, lhsResult.type.unwrap())
|
LHSResult.Type(qualifier, lhsResult.type.unwrap())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// SKIP_TXT
|
||||||
|
// !LANGUAGE: +NewInference
|
||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
// FILE: JavaClass.java
|
||||||
|
public class JavaClass<R> {
|
||||||
|
public static String baz(int x) { return ""; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun foo(x: (Int) -> String) {}
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
foo(JavaClass<*>::baz)
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// SKIP_TXT
|
||||||
|
// !LANGUAGE: +NewInference
|
||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
// FILE: JavaClass.java
|
||||||
|
public class JavaClass<R> {
|
||||||
|
public static String baz(int x) { return ""; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun foo(x: (Int) -> String) {}
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
foo(JavaClass<*>::<!UNRESOLVED_REFERENCE!>baz<!>)
|
||||||
|
}
|
||||||
@@ -2645,6 +2645,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.kt");
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt35920.kt")
|
||||||
|
public void testKt35920() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35920.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt8596.kt")
|
@TestMetadata("kt8596.kt")
|
||||||
public void testKt8596() throws Exception {
|
public void testKt8596() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt");
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt");
|
||||||
|
|||||||
Generated
+5
@@ -2640,6 +2640,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
|
|||||||
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.kt");
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt35920.kt")
|
||||||
|
public void testKt35920() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt35920.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt8596.kt")
|
@TestMetadata("kt8596.kt")
|
||||||
public void testKt8596() throws Exception {
|
public void testKt8596() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt");
|
runTest("compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user