diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt new file mode 100644 index 00000000000..8ac7aeef381 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt @@ -0,0 +1,6 @@ +enum class A { + A(1), B(2), C("test"); + + constructor(x: Int) : super() + constructor(t: String) : this(10) +} \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.txt new file mode 100644 index 00000000000..eb7031915a0 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.txt @@ -0,0 +1,38 @@ +FILE: delegationSuperCallInEnumConstructor.kt + public final enum class A : R|kotlin/Enum| { + public final static enum entry A: R|A| = object : R|A| { + private constructor(): R|| { + super(Int(1)) + } + + } + + public final static enum entry B: R|A| = object : R|A| { + private constructor(): R|| { + super(Int(2)) + } + + } + + public final static enum entry C: R|A| = object : R|A| { + private constructor(): R|| { + super(String(test)) + } + + } + + private constructor(x: R|kotlin/Int|): R|A| { + super|>() + } + + private constructor(t: R|kotlin/String|): R|A| { + this(Int(10)) + } + + public final static fun values(): R|kotlin/Array| { + } + + public final static fun valueOf(value: R|kotlin/String|): R|A| { + } + + } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt new file mode 100644 index 00000000000..467e4dd41d1 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt @@ -0,0 +1,18 @@ +class A(x: Int) { + constructor(z: String) : this(10) +} + +class B : A { + constructor() + constructor(z: String) : this() +} + +class C : A(20) { + constructor() + constructor(z: String) : this() +} + +class D() : A(20) { + constructor(x: Int) + constructor(z: String) : this() +} \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.txt new file mode 100644 index 00000000000..a34ea3e3ac5 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.txt @@ -0,0 +1,45 @@ +FILE: explicitDelegationCallRequired.kt + public final class A : R|kotlin/Any| { + public constructor(x: R|kotlin/Int|): R|A| { + super() + } + + public constructor(z: R|kotlin/String|): R|A| { + this(Int(10)) + } + + } + public final class B : R|A| { + public constructor(): R|B| { + super() + } + + public constructor(z: R|kotlin/String|): R|B| { + this() + } + + } + public final class C : R|A| { + public constructor(): R|C| { + super() + } + + public constructor(z: R|kotlin/String|): R|C| { + this() + } + + } + public final class D : R|A| { + public constructor(): R|D| { + super(Int(20)) + } + + public constructor(x: R|kotlin/Int|): R|D| { + super() + } + + public constructor(z: R|kotlin/String|): R|D| { + this() + } + + } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt new file mode 100644 index 00000000000..74cf32556d9 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt @@ -0,0 +1,9 @@ +data class A {} + +data class B { + constructor() +} + +data class C { + constructor(x: Int) +} \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.txt new file mode 100644 index 00000000000..e773beff3de --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.txt @@ -0,0 +1,21 @@ +FILE: primaryConstructorRequiredForDataClass.kt + public final data class A : R|kotlin/Any| { + public constructor(): R|A| { + super() + } + + public final fun copy(): R|A| + + } + public final data class B : R|kotlin/Any| { + public constructor(): R|B| { + super() + } + + } + public final data class C : R|kotlin/Any| { + public constructor(x: R|kotlin/Int|): R|C| { + super() + } + + } diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java index f36dc679ef8..e906bb20da3 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsTestGenerated.java @@ -921,6 +921,16 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt"); } + @TestMetadata("delegationSuperCallInEnumConstructor.kt") + public void testDelegationSuperCallInEnumConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt"); + } + + @TestMetadata("explicitDelegationCallRequired.kt") + public void testExplicitDelegationCallRequired() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt"); + } + @TestMetadata("incompatibleModifiers.kt") public void testIncompatibleModifiers() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/incompatibleModifiers.kt"); @@ -951,6 +961,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt"); } + @TestMetadata("primaryConstructorRequiredForDataClass.kt") + public void testPrimaryConstructorRequiredForDataClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt"); + } + @TestMetadata("projectionsOnNonClassTypeArguments.kt") public void testProjectionsOnNonClassTypeArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/projectionsOnNonClassTypeArguments.kt"); diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java index 3fccb9fb92f..b16cd11d7ad 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithLightTreeTestGenerated.java @@ -921,6 +921,16 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt"); } + @TestMetadata("delegationSuperCallInEnumConstructor.kt") + public void testDelegationSuperCallInEnumConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt"); + } + + @TestMetadata("explicitDelegationCallRequired.kt") + public void testExplicitDelegationCallRequired() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt"); + } + @TestMetadata("incompatibleModifiers.kt") public void testIncompatibleModifiers() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/incompatibleModifiers.kt"); @@ -951,6 +961,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt"); } + @TestMetadata("primaryConstructorRequiredForDataClass.kt") + public void testPrimaryConstructorRequiredForDataClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt"); + } + @TestMetadata("projectionsOnNonClassTypeArguments.kt") public void testProjectionsOnNonClassTypeArguments() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/projectionsOnNonClassTypeArguments.kt"); diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/DefaultDeclarationCheckers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/DefaultDeclarationCheckers.kt index 28b43c8772e..d257fdc4254 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/DefaultDeclarationCheckers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/DefaultDeclarationCheckers.kt @@ -20,8 +20,10 @@ object CommonDeclarationCheckers : DeclarationCheckers() { override val memberDeclarationCheckers: List = listOf( FirInfixFunctionDeclarationChecker, FirExposedVisibilityDeclarationChecker, - FirCyclicConstructorDelegationCallChecker, + FirCommonConstructorDelegationIssuesChecker, FirSupertypeInitializedWithoutPrimaryConstructor, + FirDelegationSuperCallInEnumConstructorChecker, + FirPrimaryConstructorRequiredForDataClassChecker, ) override val constructorCheckers: List = listOf( diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirCyclicConstructorDelegationCallChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirCommonConstructorDelegationIssuesChecker.kt similarity index 71% rename from compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirCyclicConstructorDelegationCallChecker.kt rename to compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirCommonConstructorDelegationIssuesChecker.kt index 80d38d7619f..a2db96ab9f9 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirCyclicConstructorDelegationCallChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirCommonConstructorDelegationIssuesChecker.kt @@ -12,12 +12,12 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.declarations.FirConstructor import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration import org.jetbrains.kotlin.fir.declarations.FirRegularClass +import org.jetbrains.kotlin.fir.references.FirErrorNamedReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.FirTypeRef +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeAmbiguityError import org.jetbrains.kotlin.utils.addToStdlib.safeAs -object FirCyclicConstructorDelegationCallChecker : FirMemberDeclarationChecker() { +object FirCommonConstructorDelegationIssuesChecker : FirMemberDeclarationChecker() { override fun check(declaration: FirMemberDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { if (declaration !is FirRegularClass) { return @@ -26,9 +26,15 @@ object FirCyclicConstructorDelegationCallChecker : FirMemberDeclarationChecker() val cyclicConstructors = mutableSetOf() var hasPrimaryConstructor = false + // secondary; non-cyclic; + // candidates for further analysis + val otherConstructors = mutableSetOf() + for (it in declaration.declarations) { if (it is FirConstructor) { if (!it.isPrimary) { + otherConstructors += it + it.findCycle(cyclicConstructors)?.let { visited -> cyclicConstructors += visited } @@ -38,15 +44,26 @@ object FirCyclicConstructorDelegationCallChecker : FirMemberDeclarationChecker() } } + otherConstructors -= cyclicConstructors + if (hasPrimaryConstructor) { - for (it in declaration.declarations) { - if ( - it is FirConstructor && !it.isPrimary && it !in cyclicConstructors && - it.delegatedConstructor?.constructedTypeRef?.getType() != it.returnTypeRef.getType() - ) { + for (it in otherConstructors) { + if (it.delegatedConstructor?.isThis == false) { reporter.reportPrimaryConstructorDelegationCallExpected(it.delegatedConstructor?.source) } } + } else { + for (it in otherConstructors) { + val callee = it.delegatedConstructor?.calleeReference + + // couldn't find proper super() constructor implicitly + if ( + callee is FirErrorNamedReference && callee.diagnostic is ConeAmbiguityError && + it.delegatedConstructor?.source?.startOffset == it.delegatedConstructor?.source?.endOffset + ) { + reporter.reportExplicitDelegationCallRequired(it.source) + } + } } cyclicConstructors.forEach { @@ -78,11 +95,6 @@ object FirCyclicConstructorDelegationCallChecker : FirMemberDeclarationChecker() ?.resolvedSymbol ?.fir.safeAs() - private fun FirTypeRef.getType() = when (this) { - is FirResolvedTypeRef -> type - else -> null - } - private fun DiagnosticReporter.reportCyclicConstructorDelegationCall(source: FirSourceElement?) { source?.let { report(FirErrors.CYCLIC_CONSTRUCTOR_DELEGATION_CALL.on(it)) } } @@ -90,4 +102,8 @@ object FirCyclicConstructorDelegationCallChecker : FirMemberDeclarationChecker() private fun DiagnosticReporter.reportPrimaryConstructorDelegationCallExpected(source: FirSourceElement?) { source?.let { report(FirErrors.PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED.on(it)) } } + + private fun DiagnosticReporter.reportExplicitDelegationCallRequired(source: FirSourceElement?) { + source?.let { report(FirErrors.EXPLICIT_DELEGATION_CALL_REQUIRED.on(it)) } + } } \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDelegationSuperCallInEnumConstructorChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDelegationSuperCallInEnumConstructorChecker.kt new file mode 100644 index 00000000000..323c23f2176 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDelegationSuperCallInEnumConstructorChecker.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers.declaration + +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.fir.FirSourceElement +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.declarations.FirConstructor +import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration +import org.jetbrains.kotlin.fir.declarations.FirRegularClass + +object FirDelegationSuperCallInEnumConstructorChecker : FirMemberDeclarationChecker() { + override fun check(declaration: FirMemberDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { + if (declaration !is FirRegularClass || declaration.classKind != ClassKind.ENUM_CLASS) { + return + } + + for (it in declaration.declarations) { + // checking offsets is needed because we + // still have a real source element ("") here, + // even if the user hasn't written anything + if ( + it is FirConstructor && !it.isPrimary && + it.delegatedConstructor?.isThis == false && + it.delegatedConstructor?.source?.startOffset != it.delegatedConstructor?.source?.endOffset + ) { + reporter.report(it.delegatedConstructor?.source) + } + } + } + + private fun DiagnosticReporter.report(source: FirSourceElement?) { + source?.let { report(FirErrors.DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR.on(it)) } + } +} \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPrimaryConstructorRequiredForDataClassChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPrimaryConstructorRequiredForDataClassChecker.kt new file mode 100644 index 00000000000..db09e9ed991 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirPrimaryConstructorRequiredForDataClassChecker.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers.declaration + +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.fir.FirSourceElement +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.declarations.FirConstructor +import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration +import org.jetbrains.kotlin.fir.declarations.FirRegularClass +import org.jetbrains.kotlin.fir.declarations.isData + +object FirPrimaryConstructorRequiredForDataClassChecker : FirMemberDeclarationChecker() { + override fun check(declaration: FirMemberDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { + if (declaration !is FirRegularClass || declaration.classKind != ClassKind.CLASS || !declaration.isData) { + return + } + + val hasPrimaryConstructor = declaration.declarations.any { it is FirConstructor && it.isPrimary } + + if (!hasPrimaryConstructor) { + reporter.report(declaration.source) + } + } + + private fun DiagnosticReporter.report(source: FirSourceElement?) { + source?.let { report(FirErrors.PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS.on(it)) } + } +} \ No newline at end of file diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 17a9c293347..20b599c4df6 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -67,6 +67,9 @@ object FirErrors { val CYCLIC_CONSTRUCTOR_DELEGATION_CALL by warning0() val PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED by warning0() val SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR by warning0() + val DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR by warning0() + val PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS by warning0() + val EXPLICIT_DELEGATION_CALL_REQUIRED by warning0() // Exposed visibility group val EXPOSED_TYPEALIAS_EXPANDED_TYPE by error3() diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt index 1e5a623615a..eabd11e3505 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt @@ -8,7 +8,7 @@ expect open class A { } expect class B : A { - constructor(i: Int) + constructor(i: Int) constructor() : super("B") } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.fir.kt index 5c47d816dbc..673c093b93b 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.fir.kt @@ -7,8 +7,8 @@ data class A2(val y: String, val z: Int) { constructor(x: String): this(x, 0) } -data class A3 { +data class A3 { constructor() -} +} data class A4 internal constructor() diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/enums.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/enums.fir.kt index 4035ec25be1..21872ec6350 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/enums.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/enums.fir.kt @@ -6,7 +6,7 @@ enum class A { constructor(x: Int) constructor(x: Int, y: Int): this(x+y) constructor(x: Double): this(x.toInt(), 1) - constructor(x: String): super(x, 1) + constructor(x: String): super(x, 1) } enum class B(x: Int) { @@ -14,7 +14,7 @@ enum class B(x: Int) { constructor(x: Int, y: Int): this(x+y) constructor(x: Double): this(x.toInt(), 1) - constructor(x: String): super(x, 1) + constructor(x: String): super(x, 1) } enum class C { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt index 519cceb2ace..87af2354284 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt @@ -26,7 +26,7 @@ open class B2 { } class A2 : B2 { - constructor() + constructor() constructor(x: Int) : super() } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt index df8a596f983..accb18c92dc 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt @@ -6,5 +6,5 @@ open class B(x: Double) { interface C class A : B, C { constructor(): super(' ') - constructor(x: Int) + constructor(x: Int) }