KT-2472: Wrong "multiple implementations inherited" diagnostics for JFrame.
Check whether member is visible when creating fake overrides. #KT-2472 Fixed
This commit is contained in:
@@ -190,18 +190,22 @@ public class OverrideResolver {
|
|||||||
OverridingUtil.OverrideCompatibilityInfo.Result result =
|
OverridingUtil.OverrideCompatibilityInfo.Result result =
|
||||||
OverridingUtil.isOverridableBy(fromSupertype, fromCurrent).getResult();
|
OverridingUtil.isOverridableBy(fromSupertype, fromCurrent).getResult();
|
||||||
|
|
||||||
if (Visibilities.isVisible(fromSupertype, current)) {
|
boolean isVisible = Visibilities.isVisible(fromSupertype, current);
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case OVERRIDABLE:
|
case OVERRIDABLE:
|
||||||
|
if (isVisible) {
|
||||||
OverridingUtil.bindOverride(fromCurrent, fromSupertype);
|
OverridingUtil.bindOverride(fromCurrent, fromSupertype);
|
||||||
iterator.remove();
|
}
|
||||||
break;
|
iterator.remove();
|
||||||
case CONFLICT:
|
break;
|
||||||
|
case CONFLICT:
|
||||||
|
if (isVisible) {
|
||||||
sink.conflict(fromSupertype, fromCurrent);
|
sink.conflict(fromSupertype, fromCurrent);
|
||||||
break;
|
}
|
||||||
case INCOMPATIBLE:
|
iterator.remove();
|
||||||
break;
|
break;
|
||||||
}
|
case INCOMPATIBLE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import javax.swing.JFrame
|
import javax.swing.JFrame
|
||||||
/* waiting for KT-1725
|
|
||||||
class KFrame() : JFrame() {
|
class KFrame() : JFrame() {
|
||||||
{
|
{
|
||||||
val x = this.accessibleContext // make sure field is visible
|
val x = this.accessibleContext // make sure field is visible
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
Reference in New Issue
Block a user