JS frontend: remove diagnostics about the secondary constructors are not supported
This commit is contained in:
-15
@@ -1,15 +0,0 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class A {
|
||||
<!SECONDARY_CONSTRUCTOR!>constructor()<!> {}
|
||||
}
|
||||
|
||||
class B {
|
||||
<!SECONDARY_CONSTRUCTOR!>constructor()<!> {}
|
||||
<!SECONDARY_CONSTRUCTOR!>constructor(a: Int)<!> {}
|
||||
}
|
||||
|
||||
class C(a: Int) {
|
||||
<!SECONDARY_CONSTRUCTOR!>constructor()<!> : this(1) {}
|
||||
<!SECONDARY_CONSTRUCTOR!>constructor(a: String)<!> : this(2) {}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class B {
|
||||
public constructor B()
|
||||
public constructor B(/*0*/ a: kotlin.Int)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
internal final class C {
|
||||
public constructor C()
|
||||
public constructor C(/*0*/ a: kotlin.Int)
|
||||
public constructor C(/*0*/ a: kotlin.String)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
-6
@@ -564,11 +564,5 @@ public class JetDiagnosticsTestWithJsStdLibGenerated extends AbstractJetDiagnost
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/unsupportedFeatures/nestedInnerClassifier.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("secondaryConstructor.kt")
|
||||
public void testSecondaryConstructor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/unsupportedFeatures/secondaryConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -37,7 +37,6 @@ private val DIAGNOSTIC_FACTORY_TO_RENDERER by Delegates.lazy {
|
||||
put(ErrorsJs.NOT_SUPPORTED, "Cannot translate (not supported yet): ''{0}''", RenderFirstLineOfElementText)
|
||||
put(ErrorsJs.REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED, "Callable references for builtin members are not supported yet: ''{0}''", RenderFirstLineOfElementText)
|
||||
put(ErrorsJs.NON_TOPLEVEL_CLASS_DECLARATION, "Non-toplevel {0} declarations not supported yet", Renderers.STRING)
|
||||
put(ErrorsJs.SECONDARY_CONSTRUCTOR, "Secondary constructors not supported yet")
|
||||
put(ErrorsJs.JSCODE_NO_JAVASCRIPT_PRODUCED, "Argument must be non-empty JavaScript code")
|
||||
|
||||
this
|
||||
|
||||
@@ -43,7 +43,6 @@ public interface ErrorsJs {
|
||||
DiagnosticFactory1<JetElement, JetElement> NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
|
||||
DiagnosticFactory1<JetElement, JetElement> REFERENCE_TO_BUILTIN_MEMBERS_NOT_SUPPORTED = DiagnosticFactory1.create(ERROR, DEFAULT);
|
||||
DiagnosticFactory1<JetNamedDeclaration, String> NON_TOPLEVEL_CLASS_DECLARATION = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
|
||||
DiagnosticFactory0<JetNamedDeclaration> SECONDARY_CONSTRUCTOR = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE_OR_DEFAULT);
|
||||
DiagnosticFactory0<JetExpression> JSCODE_NO_JAVASCRIPT_PRODUCED = DiagnosticFactory0.create(ERROR, DEFAULT);
|
||||
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
|
||||
@@ -34,12 +34,6 @@ class ClassDeclarationChecker : DeclarationChecker {
|
||||
|
||||
if (declaration !is JetClassOrObject || declaration is JetObjectDeclaration || declaration is JetEnumEntry) return
|
||||
|
||||
if (declaration is JetClass) {
|
||||
declaration.getSecondaryConstructors().forEach {
|
||||
diagnosticHolder.report(ErrorsJs.SECONDARY_CONSTRUCTOR.on(it))
|
||||
}
|
||||
}
|
||||
|
||||
// hack to avoid to get diagnostics when compile kotlin builtins
|
||||
val fqNameUnsafe = DescriptorUtils.getFqName(descriptor)
|
||||
if (fqNameUnsafe.asString().startsWith("kotlin.")) return
|
||||
|
||||
Reference in New Issue
Block a user