mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
incremental java make: handle ambiguous resolution problems after constructor overloading (IDEA-223826)
GitOrigin-RevId: a59bbcd14330165c518991157503c0eb89297a18
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a4ab89af44
commit
cddc167959
@@ -0,0 +1,14 @@
|
||||
Cleaning output files:
|
||||
out/production/AddOverloadingConstructor/A.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/A.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/AddOverloadingConstructor/ASub.class
|
||||
out/production/AddOverloadingConstructor/C.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/ASub.java
|
||||
src/C.java
|
||||
End of files
|
||||
@@ -0,0 +1,6 @@
|
||||
public class A {
|
||||
public A(String x) {
|
||||
}
|
||||
public A(Integer x) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
public class A {
|
||||
public A(String x) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class ASub extends A {
|
||||
public ASub(String s) {
|
||||
super(s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class C {
|
||||
void f (){
|
||||
A a = new A(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class D {
|
||||
void f (){
|
||||
A a = new ASub(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
Cleaning output files:
|
||||
out/production/AddOverloadingMethod/A.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/A.java
|
||||
End of files
|
||||
Cleaning output files:
|
||||
out/production/AddOverloadingMethod/C.class
|
||||
End of files
|
||||
Compiling files:
|
||||
src/C.java
|
||||
End of files
|
||||
@@ -0,0 +1,6 @@
|
||||
public class A {
|
||||
void f (String x) {
|
||||
}
|
||||
void f (Integer x) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
public class A {
|
||||
void f (String x) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
public class C {
|
||||
void f (A a){
|
||||
a.f(null);
|
||||
}
|
||||
}
|
||||
@@ -1266,7 +1266,7 @@ public class Mappings {
|
||||
|
||||
TIntHashSet propagated = null;
|
||||
|
||||
if (!m.isPrivate() && m.name != myInitName) {
|
||||
if (!m.isPrivate()) {
|
||||
if (oldItRef == null) {
|
||||
oldItRef = new Ref<>(getClassReprByName(null, it.name)); // lazy init
|
||||
}
|
||||
@@ -1274,7 +1274,10 @@ public class Mappings {
|
||||
|
||||
if (oldIt == null || !myPresent.hasOverriddenMethods(oldIt, MethodRepr.equalByJavaRules(m), null)) {
|
||||
if (m.myArgumentTypes.length > 0) {
|
||||
propagated = myFuture.propagateMethodAccess(m, it.name);
|
||||
if (m.name != myInitName) {
|
||||
// do not propagate constructors access, since constructors are always concrete and not accessible via references to subclasses
|
||||
propagated = myFuture.propagateMethodAccess(m, it.name);
|
||||
}
|
||||
debug("Conservative case on overriding methods, affecting method usages");
|
||||
myFuture.affectMethodUsages(m, propagated, m.createMetaUsage(myContext, it.name), state.myAffectedUsages, state.myDependants);
|
||||
}
|
||||
|
||||
@@ -207,6 +207,14 @@ public class MemberChangeTest extends IncrementalTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddOverloadingMethod() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddOverloadingConstructor() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAddVarargMethod() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user