Provide more precise check for ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
#KT-47542 Fixed
This commit is contained in:
+6
@@ -2054,6 +2054,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("notImplementedMembersAroundJava.kt")
|
||||
public void testNotImplementedMembersAroundJava() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembersAroundJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tooManyArguments.kt")
|
||||
public void testTooManyArguments() throws Exception {
|
||||
|
||||
+6
@@ -2054,6 +2054,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("notImplementedMembersAroundJava.kt")
|
||||
public void testNotImplementedMembersAroundJava() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembersAroundJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tooManyArguments.kt")
|
||||
public void testTooManyArguments() throws Exception {
|
||||
|
||||
@@ -705,6 +705,7 @@ class OverrideResolver(
|
||||
var overridesClassMember = false
|
||||
var overridesNonAbstractInterfaceMember = false
|
||||
var overridesAbstractInBaseClass: CallableMemberDescriptor? = null
|
||||
var overridesNonAbstractInBaseClass: CallableMemberDescriptor? = null
|
||||
var fakeOverrideInBaseClass: CallableMemberDescriptor? = null
|
||||
for (overridden in relevantDirectlyOverridden) {
|
||||
val containingDeclaration = overridden.containingDeclaration as? ClassDescriptor ?: continue
|
||||
@@ -719,6 +720,8 @@ class OverrideResolver(
|
||||
overridesClassMember = true
|
||||
if (overridden.modality === Modality.ABSTRACT) {
|
||||
overridesAbstractInBaseClass = overridden
|
||||
} else {
|
||||
overridesNonAbstractInBaseClass = overridden
|
||||
}
|
||||
} else if (containingDeclaration.kind == ClassKind.INTERFACE) {
|
||||
overriddenInterfaceMembers.add(overridden)
|
||||
@@ -728,7 +731,7 @@ class OverrideResolver(
|
||||
}
|
||||
}
|
||||
|
||||
if (overridesAbstractInBaseClass != null) {
|
||||
if (overridesAbstractInBaseClass != null && overridesNonAbstractInBaseClass == null) {
|
||||
reportingStrategy.abstractBaseClassMemberNotImplemented(overridesAbstractInBaseClass)
|
||||
} else if (!onlyBaseClassMembers && !overridesClassMember &&
|
||||
overridesNonAbstractInterfaceMember && overriddenInterfaceMembers.size > 1
|
||||
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// Ignored cause of KT-47542
|
||||
// IGNORE_BACKEND: JVM, JVM_IR
|
||||
// FULL_JDK
|
||||
// ISSUE: KT-45584
|
||||
|
||||
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// Ignored cause of KT-47542
|
||||
// IGNORE_BACKEND: JVM, JVM_IR
|
||||
// FULL_JDK
|
||||
// ISSUE: KT-45584
|
||||
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// FULL_JDK
|
||||
// ISSUE: KT-47542
|
||||
|
||||
// FILE: PlaceholderExceptionSupport.java
|
||||
|
||||
public interface PlaceholderExceptionSupport {
|
||||
String getMessage();
|
||||
}
|
||||
|
||||
// FILE: ExceptionWithAbstractMessage.java
|
||||
|
||||
public class ExceptionWithAbstractMessage extends RuntimeException implements PlaceholderExceptionSupport {
|
||||
public ExceptionWithAbstractMessage(String x) { super(x); }
|
||||
|
||||
abstract String getMessage();
|
||||
}
|
||||
|
||||
// FILE: PlaceholderException.java
|
||||
|
||||
public class PlaceholderException extends RuntimeException implements PlaceholderExceptionSupport {
|
||||
public PlaceholderException(String x) { super(x); }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
class KotlinTestSuccess : PlaceholderException("OK") {}
|
||||
|
||||
class KotlinTestFailure : ExceptionWithAbstractMessage("FAIL") {}
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
// FULL_JDK
|
||||
// ISSUE: KT-47542
|
||||
|
||||
// FILE: PlaceholderExceptionSupport.java
|
||||
|
||||
public interface PlaceholderExceptionSupport {
|
||||
String getMessage();
|
||||
}
|
||||
|
||||
// FILE: ExceptionWithAbstractMessage.java
|
||||
|
||||
public class ExceptionWithAbstractMessage extends RuntimeException implements PlaceholderExceptionSupport {
|
||||
public ExceptionWithAbstractMessage(String x) { super(x); }
|
||||
|
||||
abstract String getMessage();
|
||||
}
|
||||
|
||||
// FILE: PlaceholderException.java
|
||||
|
||||
public class PlaceholderException extends RuntimeException implements PlaceholderExceptionSupport {
|
||||
public PlaceholderException(String x) { super(x); }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
class KotlinTestSuccess : PlaceholderException("OK") {}
|
||||
|
||||
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class KotlinTestFailure<!> : ExceptionWithAbstractMessage("FAIL") {}
|
||||
Vendored
+90
@@ -0,0 +1,90 @@
|
||||
package
|
||||
|
||||
public open class ExceptionWithAbstractMessage : java.lang.RuntimeException, PlaceholderExceptionSupport {
|
||||
public constructor ExceptionWithAbstractMessage(/*0*/ x: kotlin.String!)
|
||||
public open override /*1*/ /*fake_override*/ val cause: kotlin.Throwable?
|
||||
public/*package*/ abstract override /*1*/ val message: kotlin.String?
|
||||
public final override /*1*/ /*fake_override*/ fun addSuppressed(/*0*/ p0: kotlin.Throwable!): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun fillInStackTrace(): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun getLocalizedMessage(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getStackTrace(): kotlin.Array<(out) java.lang.StackTraceElement!>!
|
||||
public final override /*1*/ /*fake_override*/ fun getSuppressed(): kotlin.Array<(out) kotlin.Throwable!>!
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun initCause(/*0*/ p0: kotlin.Throwable!): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintStream!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintWriter!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun setStackTrace(/*0*/ p0: kotlin.Array<(out) java.lang.StackTraceElement!>!): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val serialVersionUID: kotlin.Long = -7034897190745766939.toLong()
|
||||
}
|
||||
|
||||
public final class KotlinTestFailure : ExceptionWithAbstractMessage {
|
||||
public constructor KotlinTestFailure()
|
||||
public open override /*1*/ /*fake_override*/ val cause: kotlin.Throwable?
|
||||
public/*package*/ abstract override /*1*/ /*fake_override*/ val message: kotlin.String?
|
||||
public final override /*1*/ /*fake_override*/ fun addSuppressed(/*0*/ p0: kotlin.Throwable!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun fillInStackTrace(): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun getLocalizedMessage(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getStackTrace(): kotlin.Array<(out) java.lang.StackTraceElement!>!
|
||||
public final override /*1*/ /*fake_override*/ fun getSuppressed(): kotlin.Array<(out) kotlin.Throwable!>!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun initCause(/*0*/ p0: kotlin.Throwable!): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintStream!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintWriter!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun setStackTrace(/*0*/ p0: kotlin.Array<(out) java.lang.StackTraceElement!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class KotlinTestSuccess : PlaceholderException {
|
||||
public constructor KotlinTestSuccess()
|
||||
public open override /*1*/ /*fake_override*/ val cause: kotlin.Throwable?
|
||||
public open override /*1*/ /*fake_override*/ val message: kotlin.String?
|
||||
public final override /*1*/ /*fake_override*/ fun addSuppressed(/*0*/ p0: kotlin.Throwable!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun fillInStackTrace(): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun getLocalizedMessage(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getStackTrace(): kotlin.Array<(out) java.lang.StackTraceElement!>!
|
||||
public final override /*1*/ /*fake_override*/ fun getSuppressed(): kotlin.Array<(out) kotlin.Throwable!>!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun initCause(/*0*/ p0: kotlin.Throwable!): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintStream!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintWriter!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun setStackTrace(/*0*/ p0: kotlin.Array<(out) java.lang.StackTraceElement!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class PlaceholderException : java.lang.RuntimeException, PlaceholderExceptionSupport {
|
||||
public constructor PlaceholderException(/*0*/ x: kotlin.String!)
|
||||
public open override /*1*/ /*fake_override*/ val cause: kotlin.Throwable?
|
||||
public open override /*2*/ /*fake_override*/ val message: kotlin.String?
|
||||
public final override /*1*/ /*fake_override*/ fun addSuppressed(/*0*/ p0: kotlin.Throwable!): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun fillInStackTrace(): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun getLocalizedMessage(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun getStackTrace(): kotlin.Array<(out) java.lang.StackTraceElement!>!
|
||||
public final override /*1*/ /*fake_override*/ fun getSuppressed(): kotlin.Array<(out) kotlin.Throwable!>!
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun initCause(/*0*/ p0: kotlin.Throwable!): kotlin.Throwable!
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintStream!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun printStackTrace(/*0*/ p0: java.io.PrintWriter!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun setStackTrace(/*0*/ p0: kotlin.Array<(out) java.lang.StackTraceElement!>!): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake const final override /*1*/ /*fake_override*/ val serialVersionUID: kotlin.Long = -7034897190745766939.toLong()
|
||||
}
|
||||
|
||||
public interface PlaceholderExceptionSupport {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun getMessage(): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Generated
+6
@@ -2060,6 +2060,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("notImplementedMembersAroundJava.kt")
|
||||
public void testNotImplementedMembersAroundJava() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembersAroundJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tooManyArguments.kt")
|
||||
public void testTooManyArguments() throws Exception {
|
||||
|
||||
+10
-10
@@ -19018,16 +19018,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class JavaInterop extends AbstractLightAnalysisModeTest {
|
||||
@TestMetadata("conflictingOverloadsForThrowableInheritors.kt")
|
||||
public void ignoreConflictingOverloadsForThrowableInheritors() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/conflictingOverloadsForThrowableInheritors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("conflictingOverloadsForThrowableInheritors2.kt")
|
||||
public void ignoreConflictingOverloadsForThrowableInheritors2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/conflictingOverloadsForThrowableInheritors2.kt");
|
||||
}
|
||||
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
|
||||
}
|
||||
@@ -19041,6 +19031,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/javaInterop/ambiguousJavaVararg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("conflictingOverloadsForThrowableInheritors.kt")
|
||||
public void testConflictingOverloadsForThrowableInheritors() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/conflictingOverloadsForThrowableInheritors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("conflictingOverloadsForThrowableInheritors2.kt")
|
||||
public void testConflictingOverloadsForThrowableInheritors2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/conflictingOverloadsForThrowableInheritors2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("genericSamProjectedOut.kt")
|
||||
public void testGenericSamProjectedOut() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/javaInterop/genericSamProjectedOut.kt");
|
||||
|
||||
+6
@@ -2054,6 +2054,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembers.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("notImplementedMembersAroundJava.kt")
|
||||
public void testNotImplementedMembersAroundJava() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/rendering/notImplementedMembersAroundJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tooManyArguments.kt")
|
||||
public void testTooManyArguments() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user