KT-4372 Invalid error position and failing to resolve invoke with receiver from other module #KT-4372 Fixed
This commit is contained in:
+1
-4
@@ -101,10 +101,7 @@ public class VariableAsFunctionResolvedCall implements ResolvedCallWithTrace<Fun
|
|||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public ResolutionStatus getStatus() {
|
public ResolutionStatus getStatus() {
|
||||||
if (variableCall.getStatus() == ResolutionStatus.SUCCESS) {
|
return variableCall.getStatus().combine(functionCall.getStatus());
|
||||||
return functionCall.getStatus();
|
|
||||||
}
|
|
||||||
return variableCall.getStatus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||||
|
|
||||||
|
//KT-4372 Invalid error position and failing to resolve invoke with receiver from other module
|
||||||
|
|
||||||
|
class Foo<TInner, TOuter> {
|
||||||
|
fun invoke(content: TInner.() -> Unit) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// comment this function to fix the error below
|
||||||
|
fun <TInner, TOuter> Foo<TInner, TOuter>.invoke(name: String, content: TInner.() -> Unit) {}
|
||||||
|
|
||||||
|
enum class EnumClass(val x: String) {}
|
||||||
|
object Y {
|
||||||
|
val x = javaClass<EnumClass>() // javaClass unresolved in any file in this module
|
||||||
|
}
|
||||||
|
|
||||||
|
//declarations from library
|
||||||
|
val <T> T.javaClass : Class<T>
|
||||||
|
get() = throw Exception()
|
||||||
|
|
||||||
|
fun <reified T> javaClass() : Class<T> = throw Exception()
|
||||||
@@ -5953,6 +5953,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
|||||||
doTest("compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt");
|
doTest("compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("KT-4372.kt")
|
||||||
|
public void testKT_4372() throws Exception {
|
||||||
|
doTest("compiler/testData/diagnostics/tests/resolve/invoke/KT-4372.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("kt3772.kt")
|
@TestMetadata("kt3772.kt")
|
||||||
public void testKt3772() throws Exception {
|
public void testKt3772() throws Exception {
|
||||||
doTest("compiler/testData/diagnostics/tests/resolve/invoke/kt3772.kt");
|
doTest("compiler/testData/diagnostics/tests/resolve/invoke/kt3772.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user