Check componentN functions for overload conflicts
This commit is contained in:
@@ -210,7 +210,9 @@ public class OverloadResolver {
|
||||
if (!overloadable.isSuccess()) {
|
||||
JetDeclaration jetDeclaration = (JetDeclaration) BindingContextUtils
|
||||
.descriptorToDeclaration(trace.getBindingContext(), member);
|
||||
redeclarations.add(Pair.create(jetDeclaration, member));
|
||||
if (jetDeclaration != null) {
|
||||
redeclarations.add(Pair.create(jetDeclaration, member));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
data class A(val x: Int, val y: String) {
|
||||
<!CONFLICTING_OVERLOADS!>fun component1()<!> = 1
|
||||
<!CONFLICTING_OVERLOADS!>fun component2()<!> = 2
|
||||
}
|
||||
@@ -977,6 +977,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("conflictingOverloads.kt")
|
||||
public void testConflictingOverloads() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("dataClassOverrideConflict.kt")
|
||||
public void testDataClassOverrideConflict() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/dataClasses/dataClassOverrideConflict.kt");
|
||||
|
||||
Reference in New Issue
Block a user