diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index fc13644b888..d4a6195490a 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -31245,6 +31245,18 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag @TestMetadata("compiler/testData/diagnostics/tests/typealias") @TestDataPath("$PROJECT_ROOT") public class Typealias { + @Test + @TestMetadata("abbreviatedSupertypes.kt") + public void testAbbreviatedSupertypes() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt"); + } + + @Test + @TestMetadata("abbreviatedSupertypesErrors.kt") + public void testAbbreviatedSupertypesErrors() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt"); + } + @Test @TestMetadata("aliasesOnly.kt") public void testAliasesOnly() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index d22ae128b90..b943c06b740 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -31245,6 +31245,18 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti @TestMetadata("compiler/testData/diagnostics/tests/typealias") @TestDataPath("$PROJECT_ROOT") public class Typealias { + @Test + @TestMetadata("abbreviatedSupertypes.kt") + public void testAbbreviatedSupertypes() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt"); + } + + @Test + @TestMetadata("abbreviatedSupertypesErrors.kt") + public void testAbbreviatedSupertypesErrors() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt"); + } + @Test @TestMetadata("aliasesOnly.kt") public void testAliasesOnly() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index a6dfc33c376..11650b20057 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -31245,6 +31245,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac @TestMetadata("compiler/testData/diagnostics/tests/typealias") @TestDataPath("$PROJECT_ROOT") public class Typealias { + @Test + @TestMetadata("abbreviatedSupertypes.kt") + public void testAbbreviatedSupertypes() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt"); + } + + @Test + @TestMetadata("abbreviatedSupertypesErrors.kt") + public void testAbbreviatedSupertypesErrors() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt"); + } + @Test @TestMetadata("aliasesOnly.kt") public void testAliasesOnly() throws Exception { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/WarningAwareUpperBoundChecker.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/WarningAwareUpperBoundChecker.kt index 1cf668785b5..9eeccd4f89a 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/WarningAwareUpperBoundChecker.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/WarningAwareUpperBoundChecker.kt @@ -5,7 +5,10 @@ package org.jetbrains.kotlin.resolve.jvm.checkers +import org.jetbrains.kotlin.descriptors.ClassifierDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor +import org.jetbrains.kotlin.diagnostics.DiagnosticFactory3 +import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.psi.KtTypeReference @@ -14,7 +17,9 @@ import org.jetbrains.kotlin.resolve.UpperBoundChecker import org.jetbrains.kotlin.resolve.UpperBoundViolatedReporter import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm.UPPER_BOUND_VIOLATED_BASED_ON_JAVA_ANNOTATIONS import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm.UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION_BASED_ON_JAVA_ANNOTATIONS -import org.jetbrains.kotlin.types.* +import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.TypeSubstitutor +import org.jetbrains.kotlin.types.getEnhancementDeeply // TODO: remove this checker after removing support LV < 1.6 class WarningAwareUpperBoundChecker : UpperBoundChecker() { @@ -35,11 +40,13 @@ class WarningAwareUpperBoundChecker : UpperBoundChecker() { typeParameterDescriptor: TypeParameterDescriptor, substitutor: TypeSubstitutor, trace: BindingTrace, - typeAliasUsageElement: KtElement? + typeAliasUsageElement: KtElement?, + diagnosticForTypeAliases: DiagnosticFactory3, ) { checkBounds( argumentReference, argumentType, typeParameterDescriptor, substitutor, trace, typeAliasUsageElement, - withOnlyCheckForWarning = false + withOnlyCheckForWarning = false, + diagnosticForTypeAliases = diagnosticForTypeAliases, ) } @@ -50,11 +57,14 @@ class WarningAwareUpperBoundChecker : UpperBoundChecker() { substitutor: TypeSubstitutor, trace: BindingTrace, typeAliasUsageElement: KtElement? = null, - withOnlyCheckForWarning: Boolean = false + withOnlyCheckForWarning: Boolean = false, + diagnosticForTypeAliases: DiagnosticFactory3 = + Errors.UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION, ) { if (typeParameterDescriptor.upperBounds.isEmpty()) return - val diagnosticsReporter = UpperBoundViolatedReporter(trace, argumentType, typeParameterDescriptor) + val diagnosticsReporter = + UpperBoundViolatedReporter(trace, argumentType, typeParameterDescriptor, diagnosticForTypeAliases = diagnosticForTypeAliases) val diagnosticsReporterForWarnings = UpperBoundViolatedReporter( trace, argumentType, typeParameterDescriptor, baseDiagnostic = UPPER_BOUND_VIOLATED_BASED_ON_JAVA_ANNOTATIONS, diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 63274861c59..22d161ebbd4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -220,6 +220,8 @@ public interface Errors { DiagnosticFactory1 RECURSIVE_TYPEALIAS_EXPANSION = DiagnosticFactory1.create(ERROR); DiagnosticFactory3 UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION = DiagnosticFactory3.create(ERROR); + DiagnosticFactory3 UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION_WARNING = + DiagnosticFactory3.create(WARNING); DiagnosticFactory1 CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION = DiagnosticFactory1.create(ERROR); DiagnosticFactory1 TYPEALIAS_SHOULD_EXPAND_TO_CLASS = DiagnosticFactory1.create(ERROR); DiagnosticFactory2 TYPEALIAS_EXPANDED_TO_MALFORMED_TYPE = DiagnosticFactory2.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index b62ed4f14a1..3b44554bea4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -10,7 +10,6 @@ import kotlin.Pair; import kotlin.collections.CollectionsKt; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.config.LanguageVersion; import org.jetbrains.kotlin.descriptors.MemberDescriptor; import org.jetbrains.kotlin.diagnostics.DiagnosticFactory; import org.jetbrains.kotlin.diagnostics.Errors; @@ -607,6 +606,10 @@ public class DefaultErrorMessages { "Type argument resulting from type alias expansion is not within required bounds for ''{2}'': " + "should be subtype of ''{0}'', substituted type is ''{1}''", RENDER_TYPE, RENDER_TYPE, NAME); + MAP.put(UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION_WARNING, + "Type argument resulting from type alias expansion is not within required bounds for ''{2}'': " + + "should be subtype of ''{0}'', substituted type is ''{1}''. This warning will become an error since 1.8", + RENDER_TYPE, RENDER_TYPE, NAME); MAP.put(CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION, "Conflicting projection in type alias expansion in intermediate type ''{0}''", RENDER_TYPE); MAP.put(TYPEALIAS_SHOULD_EXPAND_TO_CLASS, "Type alias expands to {0}, which is not a class, an interface, or an object", RENDER_TYPE); MAP.put(TYPEALIAS_EXPANDED_TO_MALFORMED_TYPE, "Type alias expanded to malformed type {0}: {1}", RENDER_TYPE, STRING); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt index 3b6f9c9bf5a..2ab36985073 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt @@ -25,7 +25,6 @@ import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.diagnostics.DiagnosticFactory0 import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.diagnostics.Errors.* @@ -45,9 +44,11 @@ import org.jetbrains.kotlin.resolve.inline.isInlineOnly import org.jetbrains.kotlin.resolve.source.KotlinSourceElement import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.checker.KotlinTypeChecker -import org.jetbrains.kotlin.types.typeUtil.* +import org.jetbrains.kotlin.types.typeUtil.constituentTypes +import org.jetbrains.kotlin.types.typeUtil.contains +import org.jetbrains.kotlin.types.typeUtil.isArrayOfNothing +import org.jetbrains.kotlin.types.typeUtil.isNothing import org.jetbrains.kotlin.utils.addToStdlib.safeAs -import java.util.* internal class DeclarationsCheckerBuilder( private val descriptorResolver: DescriptorResolver, @@ -357,7 +358,7 @@ class DeclarationsChecker( for (delegationSpecifier in classOrObject.superTypeListEntries) { val typeReference = delegationSpecifier.typeReference ?: continue - typeReference.type()?.let { upperBoundChecker.checkBounds(typeReference, it, trace) } + typeReference.type()?.let { upperBoundChecker.checkBoundsInSupertype(typeReference, it, trace, languageVersionSettings) } } if (classOrObject !is KtClass) return @@ -380,7 +381,7 @@ class DeclarationsChecker( DescriptorResolver.checkUpperBoundTypes(trace, upperBoundCheckRequests, false) for (request in upperBoundCheckRequests) { - upperBoundChecker.checkBounds(request.upperBound, request.upperBoundType, trace) + upperBoundChecker.checkBoundsInSupertype(request.upperBound, request.upperBoundType, trace, languageVersionSettings) } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/UpperBoundChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/UpperBoundChecker.kt index 72a7a59e9c2..5687c996ead 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/UpperBoundChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/UpperBoundChecker.kt @@ -5,13 +5,14 @@ package org.jetbrains.kotlin.resolve +import org.jetbrains.kotlin.config.LanguageFeature +import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.container.DefaultImplementation import org.jetbrains.kotlin.descriptors.ClassifierDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor import org.jetbrains.kotlin.diagnostics.DiagnosticFactory2 import org.jetbrains.kotlin.diagnostics.DiagnosticFactory3 -import org.jetbrains.kotlin.diagnostics.Errors.UPPER_BOUND_VIOLATED -import org.jetbrains.kotlin.diagnostics.Errors.UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION +import org.jetbrains.kotlin.diagnostics.Errors.* import org.jetbrains.kotlin.diagnostics.reportDiagnosticOnce import org.jetbrains.kotlin.psi.KtElement import org.jetbrains.kotlin.psi.KtExpression @@ -34,17 +35,24 @@ open class UpperBoundChecker { substitutor: TypeSubstitutor, trace: BindingTrace, typeAliasUsageElement: KtElement? = null, + diagnosticForTypeAliases: DiagnosticFactory3 = UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION ) { if (typeParameterDescriptor.upperBounds.isEmpty()) return - val diagnosticsReporter = UpperBoundViolatedReporter(trace, argumentType, typeParameterDescriptor) + val diagnosticsReporter = + UpperBoundViolatedReporter(trace, argumentType, typeParameterDescriptor, diagnosticForTypeAliases = diagnosticForTypeAliases) for (bound in typeParameterDescriptor.upperBounds) { checkBound(bound, argumentType, argumentReference, substitutor, typeAliasUsageElement, diagnosticsReporter) } } - fun checkBounds(typeReference: KtTypeReference, type: KotlinType, trace: BindingTrace) { + fun checkBoundsInSupertype( + typeReference: KtTypeReference, + type: KotlinType, + trace: BindingTrace, + languageVersionSettings: LanguageVersionSettings, + ) { if (type.isError) return val typeElement = typeReference.typeElement ?: return @@ -63,8 +71,21 @@ open class UpperBoundChecker { } // it's really ft val flexibleType = type.asFlexibleType() - checkBounds(ktTypeArguments[0], flexibleType.lowerBound, trace) - checkBounds(ktTypeArguments[1], flexibleType.upperBound, trace) + checkBoundsInSupertype(ktTypeArguments[0], flexibleType.lowerBound, trace, languageVersionSettings) + checkBoundsInSupertype(ktTypeArguments[1], flexibleType.upperBound, trace, languageVersionSettings) + return + } + + if (type is AbbreviatedType) { + checkBoundsForAbbreviatedSupertype( + type, trace, typeReference, + // The errors have been reported previously if ktTypeArguments.size accidentally was equal to the amount of arguments + // in the expanded type + reportWarning = ktTypeArguments.size != arguments.size && + !languageVersionSettings.supportsFeature( + LanguageFeature.ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes + ) + ) return } @@ -75,11 +96,41 @@ open class UpperBoundChecker { for (i in ktTypeArguments.indices) { val ktTypeArgument = ktTypeArguments[i] ?: continue - checkBounds(ktTypeArgument, arguments[i].type, trace) + checkBoundsInSupertype(ktTypeArgument, arguments[i].type, trace, languageVersionSettings) checkBounds(ktTypeArgument, arguments[i].type, parameters[i], substitutor, trace) } } + private fun checkBoundsForAbbreviatedSupertype( + type: KotlinType, + trace: BindingTrace, + typeReference: KtTypeReference, + reportWarning: Boolean + ) { + val parameters = type.constructor.parameters + val arguments = type.arguments + val substitutor = TypeSubstitutor.create(type) + + val diagnostic = + if (reportWarning) + UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION_WARNING + else + UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION + + for (i in arguments.indices) { + if (arguments[i].isStarProjection) continue + val argumentType = arguments[i].type + + checkBoundsForAbbreviatedSupertype(argumentType, trace, typeReference, reportWarning) + + checkBounds( + argumentReference = null, + argumentType, parameters[i], substitutor, trace, + typeAliasUsageElement = typeReference, diagnosticForTypeAliases = diagnostic, + ) + } + } + protected fun checkBound( bound: KotlinType, argumentType: KotlinType, diff --git a/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.fir.kt b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.fir.kt new file mode 100644 index 00000000000..e0be30b9a98 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.fir.kt @@ -0,0 +1,27 @@ +// SKIP_TXT +// !LANGUAGE: -ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes + +interface I +open class TK + +typealias One = TK +typealias OneList = List> +typealias Both = TK +typealias BothList = List> + +object O1 : One() // compiler error expected +object O2 : Both() + +class A1One> +class A2One> + +interface IO1 : OneList {} +interface IO2 : BothList {} + +fun foo1(x: One) {} +fun foo2(x: Both) {} + +fun main() { + One() + Both() +} diff --git a/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt new file mode 100644 index 00000000000..f9b5caa8428 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt @@ -0,0 +1,27 @@ +// SKIP_TXT +// !LANGUAGE: -ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes + +interface I +open class TK + +typealias One = TK +typealias OneList = List> +typealias Both = TK +typealias BothList = List> + +object O1 : One() // compiler error expected +object O2 : Both() + +class A1One> +class A2> + +interface IO1 : OneList {} +interface IO2 : BothList {} + +fun foo1(x: One<Any>) {} +fun foo2(x: Both<Any, Any>) {} + +fun main() { + One<Any>() + Both<Any, Any>() +} diff --git a/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.fir.kt b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.fir.kt new file mode 100644 index 00000000000..bfc63fb9aab --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.fir.kt @@ -0,0 +1,27 @@ +// SKIP_TXT +// !LANGUAGE: +ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes + +interface I +open class TK + +typealias One = TK +typealias OneList = List> +typealias Both = TK +typealias BothList = List> + +object O1 : One() // compiler error expected +object O2 : Both() + +class A1One> +class A2One> + +interface IO1 : OneList {} +interface IO2 : BothList {} + +fun foo1(x: One) {} +fun foo2(x: Both) {} + +fun main() { + One() + Both() +} diff --git a/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt new file mode 100644 index 00000000000..74dc447cbcc --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt @@ -0,0 +1,27 @@ +// SKIP_TXT +// !LANGUAGE: +ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes + +interface I +open class TK + +typealias One = TK +typealias OneList = List> +typealias Both = TK +typealias BothList = List> + +object O1 : One() // compiler error expected +object O2 : Both() + +class A1One> +class A2> + +interface IO1 : OneList {} +interface IO2 : BothList {} + +fun foo1(x: One<Any>) {} +fun foo2(x: Both<Any, Any>) {} + +fun main() { + One<Any>() + Both<Any, Any>() +} diff --git a/compiler/testData/diagnostics/tests/typealias/kt19601.fir.kt b/compiler/testData/diagnostics/tests/typealias/kt19601.fir.kt deleted file mode 100644 index 7d01bb10612..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/kt19601.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -interface Order - -typealias Ord = Order - -class Test1> - -interface Num - -typealias N = Num - -class Test2N> diff --git a/compiler/testData/diagnostics/tests/typealias/kt19601.kt b/compiler/testData/diagnostics/tests/typealias/kt19601.kt index 3347ed4e3db..559b11a851b 100644 --- a/compiler/testData/diagnostics/tests/typealias/kt19601.kt +++ b/compiler/testData/diagnostics/tests/typealias/kt19601.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Order typealias Ord = Order @@ -8,4 +9,4 @@ interface Num typealias N = Num -class Test2String>> \ No newline at end of file +class Test2N> diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 3a6602183ff..dd8c7ab26f1 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -31335,6 +31335,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { @TestMetadata("compiler/testData/diagnostics/tests/typealias") @TestDataPath("$PROJECT_ROOT") public class Typealias { + @Test + @TestMetadata("abbreviatedSupertypes.kt") + public void testAbbreviatedSupertypes() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypes.kt"); + } + + @Test + @TestMetadata("abbreviatedSupertypesErrors.kt") + public void testAbbreviatedSupertypesErrors() throws Exception { + runTest("compiler/testData/diagnostics/tests/typealias/abbreviatedSupertypesErrors.kt"); + } + @Test @TestMetadata("aliasesOnly.kt") public void testAliasesOnly() throws Exception { diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index ac1d94d6f15..322b52e5348 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -257,6 +257,7 @@ enum class LanguageFeature( StopPropagatingDeprecationThroughOverrides(KOTLIN_1_8), // KT-47902 ProhibitNonExhaustiveIfInRhsOfElvis(KOTLIN_1_8, kind = BUG_FIX), // KT-44705 ProhibitAccessToEnumCompanionMembersInEnumConstructorCall(KOTLIN_1_8, kind = BUG_FIX), // KT-49110 + ReportMissingUpperBoundsViolatedErrorOnAbbreviationAtSupertypes(KOTLIN_1_8, kind = BUG_FIX), // KT-29168 // 1.9