From 5741374883ec93f137ee78d401edf5a21cd07206 Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Wed, 9 Jun 2021 18:31:48 +0300 Subject: [PATCH] [FIR] Report UPPER_BOUND_VIOLATED only on checkers stage, fix detection of missing cases and testData --- .../resolve/diagnostics/multipleBounds.kt | 6 +- .../propertyTypeMismatchOnOverride.kt | 2 +- .../returnTypeMismatchOnOverride.kt | 2 +- .../diagnostics/upperBoundViolated.fir.txt | 10 +- .../resolve/diagnostics/upperBoundViolated.kt | 6 +- .../testData/resolve/types/castToBareType.kt | 2 +- .../checkers/CommonDeclarationCheckers.kt | 4 +- .../checkers/CommonExpressionCheckers.kt | 2 +- .../FirUpperBoundViolatedChecker.kt | 225 ++++++++++-------- .../coneDiagnosticToFirDiagnostic.kt | 10 +- .../nonReifiedTypeParameters/innerGeneric.kt | 1 - .../nonReifiedTypeParameters/innerGeneric.kt | 1 - .../codegen/box/vararg/varargsOverride3.kt | 1 - .../testData/diagnostics/tests/Bounds.fir.kt | 4 +- .../diagnostics/tests/MultipleBounds.fir.kt | 6 +- .../kClassInSignature.fir.kt | 2 +- .../duplicateJvmSignature/missingNames.fir.kt | 8 +- .../tests/enum/enumInheritance.fir.kt | 2 +- .../generics/RecursiveUpperBoundCheck.fir.kt | 3 - .../generics/RecursiveUpperBoundCheck.kt | 1 + ...RecursiveUpperBoundWithTwoArguments.fir.kt | 1 - .../RecursiveUpperBoundWithTwoArguments.kt | 1 + .../innerClasses/checkBoundsOuter.fir.kt | 5 - .../generics/innerClasses/checkBoundsOuter.kt | 1 + .../declarationsBoundsViolation.fir.kt | 13 - .../declarationsBoundsViolation.kt | 1 + .../expressionsBoundsViolation.fir.kt | 4 +- .../nullability/tpBoundsViolation.fir.kt | 6 +- .../tpBoundsViolationVariance.fir.kt | 20 +- .../typeParameterBounds.fir.kt | 8 +- .../tests/objects/upperBoundViolated.fir.kt | 9 - .../tests/objects/upperBoundViolated.kt | 1 + .../tests/recovery/namelessMembers.kt | 1 - .../namelessToplevelDeclarations.fir.kt | 2 +- .../tests/regressions/kt7585/base.fir.kt | 2 +- .../tests/regressions/kt7585/java.fir.kt | 2 +- .../substitutions/starProjections.fir.kt | 2 +- ...oundViolationInTypeAliasConstructor.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/25.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/26.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/27.fir.kt | 2 +- idea/testData/checker/Bounds.fir.kt | 6 +- .../checker/BoundsWithSubstitutors.fir.kt | 4 +- idea/testData/checker/MultipleBounds.fir.kt | 10 +- .../checker/recovery/namelessMembers.fir.kt | 2 +- .../namelessToplevelDeclarations.fir.kt | 2 +- 46 files changed, 203 insertions(+), 208 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/upperBoundViolated.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.kt index cad212e0616..5393e980c76 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/multipleBounds.kt @@ -45,7 +45,7 @@ class Foo() {} class BarFoo> -class Buzz where T : Bar, T : nioho +class Buzz where T : Bar<Int>, T : nioho class XFoo> class Y<T> where T : Foo, T : Bar @@ -62,8 +62,8 @@ fun test2(t : T) t.bar() } -val t1 = test2(A()) -val t2 = test2(C()) +val t1 = test2<A>(A()) +val t2 = test2<B>(C()) val t3 = test2(C()) val <T, B : T> x : Int = 0 diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt index 9f8d1902b4c..85502ea44e4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt @@ -26,7 +26,7 @@ class GDouble>(val balue: E) : F(balue) { override var rest: E = balue } -class HString>(val balue: E) : F(balue) { +class HString>(val balue: E) : F<E>(balue) { override var rest: E = balue // no report because of INAPPLICABLE_CANDIDATE } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt index 6dc8902e693..f53bfbedc42 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt @@ -27,7 +27,7 @@ class GDouble>(val balue: E) : F(balue) { override fun rest(): E = balue } -class HString>(val balue: E) : F(balue) { +class HString>(val balue: E) : F<E>(balue) { override fun rest(): E = balue // no report because of INAPPLICABLE_CANDIDATE } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt index eb0e058b6b8..b472efdcd77 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.fir.txt @@ -41,14 +41,14 @@ FILE: upperBoundViolated.kt } } - public final class P : R|kotlin/Any| { - public constructor(): R|P| { + public final class P : R|kotlin/Any| { + public constructor(): R|P| { super() } } - public final class P1 : R|kotlin/Any| { - public constructor(): R|P1| { + public final class P1 : R|kotlin/Any| { + public constructor(): R|P1| { super() } @@ -62,7 +62,7 @@ FILE: upperBoundViolated.kt lval o5: R|S, T>| = #|, R|T|>() lval o6: R|S, kotlin/String>>| = R|/S.S|, kotlin/String>|>() lval o7: R|S, kotlin/Nothing>>| = R|/S.S|, kotlin/Nothing>|>() - lval o8: R|P>| = R|/P.P||>() + lval o8: R|P>| = #|>() } public final class NumColl|> : R|kotlin/Any| { public constructor|>(): R|NumColl| { diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt index ccb68fdd696..3175b732681 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt @@ -24,8 +24,8 @@ fun test() { open class S class T : S() -class P -class P1 +class P +class P1 fun rest() { @@ -39,7 +39,7 @@ fun rest() { val o6 = S, String>>() val o7 = S, Nothing>>() - val o8 = PString, String>>() + val o8 = P<String, P1<String, String>>() } class NumColl> diff --git a/compiler/fir/analysis-tests/testData/resolve/types/castToBareType.kt b/compiler/fir/analysis-tests/testData/resolve/types/castToBareType.kt index eed7c886290..e601551638f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/types/castToBareType.kt +++ b/compiler/fir/analysis-tests/testData/resolve/types/castToBareType.kt @@ -1,7 +1,7 @@ interface FirDeclaration interface FirSymbolOwner> { - val symbol: AbstractFirBasedSymbol + val symbol: AbstractFirBasedSymbol<E> } interface FirFunction> : FirSymbolOwner, FirDeclaration diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt index 60304affd4c..1a305b22090 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonDeclarationCheckers.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.analysis.checkers.syntax.FirDelegationInInterfac import org.jetbrains.kotlin.fir.analysis.checkers.syntax.FirFunctionTypeParametersSyntaxChecker import org.jetbrains.kotlin.fir.analysis.checkers.syntax.FirTypeParameterSyntaxChecker import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirReservedUnderscoreDeclarationChecker +import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirUpperBoundViolatedClassChecker object CommonDeclarationCheckers : DeclarationCheckers() { override val basicDeclarationCheckers: Set @@ -23,7 +24,8 @@ object CommonDeclarationCheckers : DeclarationCheckers() { FirConflictsChecker, FirProjectionRelationChecker, FirTypeConstraintsChecker, - FirReservedUnderscoreDeclarationChecker + FirReservedUnderscoreDeclarationChecker, + FirUpperBoundViolatedClassChecker ) override val memberDeclarationCheckers: Set diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonExpressionCheckers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonExpressionCheckers.kt index a1d6c75ed4c..efb710c26b1 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonExpressionCheckers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/CommonExpressionCheckers.kt @@ -30,7 +30,7 @@ object CommonExpressionCheckers : ExpressionCheckers() { FirAbstractSuperCallChecker, FirQualifiedSupertypeExtendedByOtherSupertypeChecker, FirProjectionsOnNonClassTypeArgumentChecker, - FirUpperBoundViolatedChecker, + FirUpperBoundViolatedExpressionChecker, FirTypeArgumentsNotAllowedExpressionChecker, FirTypeParameterInQualifiedAccessChecker, FirSealedClassConstructorCallChecker, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUpperBoundViolatedChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUpperBoundViolatedChecker.kt index 5c346294d2f..6243b7ef12a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUpperBoundViolatedChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirUpperBoundViolatedChecker.kt @@ -7,142 +7,171 @@ package org.jetbrains.kotlin.fir.analysis.checkers.expression import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirBasicDeclarationChecker import org.jetbrains.kotlin.fir.analysis.checkers.extractTypeRefAndSourceFromTypeArgument import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn -import org.jetbrains.kotlin.fir.declarations.FirRegularClass -import org.jetbrains.kotlin.fir.declarations.FirTypeParameterRefsOwner +import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression +import org.jetbrains.kotlin.fir.references.FirErrorNamedReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeInapplicableCandidateError import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol import org.jetbrains.kotlin.fir.typeContext import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability import org.jetbrains.kotlin.types.AbstractTypeChecker import org.jetbrains.kotlin.utils.addToStdlib.safeAs -object FirUpperBoundViolatedChecker : FirQualifiedAccessExpressionChecker() { +object FirUpperBoundViolatedClassChecker : FirBasicDeclarationChecker() { + override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) { + if (declaration is FirClass<*>) { + for (typeParameter in declaration.typeParameters) { + if (typeParameter is FirTypeParameter) { + for (bound in typeParameter.bounds) { + analyzeTypeParameters(bound, context, reporter) + } + } + } + + for (superTypeRef in declaration.superTypeRefs) { + analyzeTypeParameters(superTypeRef, context, reporter) + } + } else if (declaration is FirCallableDeclaration<*>) { + analyzeTypeParameters(declaration.returnTypeRef, context, reporter) + } + } +} + +object FirUpperBoundViolatedExpressionChecker : FirQualifiedAccessExpressionChecker() { override fun check(expression: FirQualifiedAccessExpression, context: CheckerContext, reporter: DiagnosticReporter) { // something that contains the type parameters // declarations with their declared bounds. // it may be the called function declaration // or the class declaration - val calleeFir = expression.calleeReference.safeAs() - ?.resolvedSymbol - ?.fir.safeAs() - ?: return - - val coneType = expression.typeRef.coneType - if (coneType is ConeClassLikeType) { - analyzeTypeParameters( - coneType, - expression.typeRef, - calleeFir.typeParameters.map { it.symbol }, - expression.typeArguments, - context, - reporter - ) + val calleReference = expression.calleeReference + var calleeFir: FirTypeParameterRefsOwner? = null + if (calleReference is FirResolvedNamedReference) { + calleeFir = calleReference.safeAs()?.resolvedSymbol?.fir.safeAs() + } else if (calleReference is FirErrorNamedReference) { + val diagnostic = calleReference.diagnostic + if (diagnostic is ConeInapplicableCandidateError && + diagnostic.applicability == CandidateApplicability.INAPPLICABLE_WRONG_RECEIVER + ) { + return + } + calleeFir = calleReference.candidateSymbol?.fir.safeAs() } + + analyzeTypeParameters( + expression.typeRef, + context, + reporter, + calleeFir?.typeParameters?.map { it.symbol }, + expression.typeArguments + ) + } +} + +/** + * Recursively analyzes type parameters and reports the diagnostic on the given source calculated using typeRef + * Returns true if an error occurred + */ +private fun analyzeTypeParameters( + typeRef: FirTypeRef?, + context: CheckerContext, + reporter: DiagnosticReporter, + typeParameters: List? = null, + typeArguments: List? = null +) { + val type = when (typeRef) { + is ConeKotlinType -> typeRef + is FirResolvedTypeRef -> typeRef.type + else -> return } - /** - * Recursively analyzes type parameters and reports the diagnostic on the given source calculated using typeRef - * Returns true if an error occurred - */ - private fun analyzeTypeParameters( - type: ConeClassLikeType, - typeRef: FirTypeRef?, - typeParameters: List?, - typeArguments: List?, - context: CheckerContext, - reporter: DiagnosticReporter - ) { - fun getTypeArgument(index: Int): Any { - return typeArguments?.elementAt(index) ?: type.typeArguments[index] - } + val typeArgumentsCount = typeArguments?.size ?: type.typeArguments.size + if (typeArgumentsCount == 0) { + return + } - val typeArgumentsCount = typeArguments?.size ?: type.typeArguments.size - if (typeArgumentsCount == 0) { - return - } - - val typeParameterSymbols = if (typeParameters != null) { - typeParameters - } else { + val typeParameterSymbols = typeParameters + ?: if (type is ConeClassLikeType) { val prototypeClass = type.lookupTag.toSymbol(context.session) ?.fir.safeAs() ?: return prototypeClass.typeParameters.map { it.symbol } + } else { + listOf() } - if (typeParameterSymbols.isEmpty()) { - return - } + if (typeParameterSymbols.isEmpty()) { + return + } - val count = minOf(typeParameterSymbols.size, typeArgumentsCount) - val substitution = mutableMapOf() + val count = minOf(typeParameterSymbols.size, typeArgumentsCount) + val substitution = mutableMapOf() - for (index in 0 until count) { - val typeArgument = getTypeArgument(index) - val typeParameterSymbol = typeParameterSymbols[index] + for (index in 0 until count) { + val typeArgument = typeArguments?.elementAt(index) ?: type.typeArguments[index] + val typeParameterSymbol = typeParameterSymbols[index] - if (typeArgument is FirTypeProjectionWithVariance) { - substitution[typeParameterSymbol] = typeArgument.typeRef.coneType - } else if (typeArgument is ConeClassLikeType) { - substitution[typeParameterSymbol] = typeArgument.type - } - } - - val substitutor = substitutorByMap(substitution, context.session) - val typeSystemContext = context.session.typeContext - - for (index in 0 until count) { - var typeArgument: ConeClassLikeType? = null - var typeArgumentTypeRef: FirTypeRef? = null - var typeArgumentSource: FirSourceElement? = null - - if (typeArguments != null) { - val localTypeArgument = typeArguments[index] - if (localTypeArgument is FirTypeProjectionWithVariance) { - typeArgumentTypeRef = localTypeArgument.typeRef - typeArgument = typeArgumentTypeRef.coneType as? ConeClassLikeType - typeArgumentSource = localTypeArgument.source - } - } else { - typeArgument = type.typeArguments[index] as? ConeClassLikeType - val argTypeRefSource = extractTypeRefAndSourceFromTypeArgument(typeRef, index) - typeArgumentTypeRef = argTypeRefSource?.first - typeArgumentSource = argTypeRefSource?.second - } - - if (typeArgument != null && typeArgumentSource != null) { - val upperBound = getSubstitutedUpperBound(typeParameterSymbols[index], substitutor, typeSystemContext) - if (upperBound != null && !satisfiesBounds(upperBound, typeArgument.type, typeSystemContext)) { - reporter.reportOn(typeArgumentSource, FirErrors.UPPER_BOUND_VIOLATED, upperBound, context) - } else { - analyzeTypeParameters(typeArgument, typeArgumentTypeRef, null, null, context, reporter) - } - } + if (typeArgument is FirTypeProjectionWithVariance) { + substitution[typeParameterSymbol] = typeArgument.typeRef.coneType + } else if (typeArgument is ConeKotlinType) { + substitution[typeParameterSymbol] = typeArgument.type } } - private fun getSubstitutedUpperBound( - prototypeSymbol: FirTypeParameterSymbol, - substitutor: ConeSubstitutor, - typeSystemContext: ConeTypeContext - ): ConeKotlinType? { - val intersection = typeSystemContext.intersectTypes( - prototypeSymbol.fir.bounds.map { it.coneType } - ).safeAs() ?: return null + val substitutor = substitutorByMap(substitution, context.session) + val typeSystemContext = context.session.typeContext - return substitutor.substituteOrSelf(intersection) - } + for (index in 0 until count) { + var typeArgument: ConeKotlinType? = null + var typeArgumentTypeRef: FirTypeRef? = null + var typeArgumentSource: FirSourceElement? = null - private fun satisfiesBounds(upperBound: ConeKotlinType, target: ConeKotlinType, typeSystemContext: ConeTypeContext): Boolean { - return AbstractTypeChecker.isSubtypeOf(typeSystemContext, target, upperBound, stubTypesEqualToAnything = false) + if (typeArguments != null) { + val localTypeArgument = typeArguments[index] + if (localTypeArgument is FirTypeProjectionWithVariance) { + typeArgumentTypeRef = localTypeArgument.typeRef + typeArgument = typeArgumentTypeRef.coneType + typeArgumentSource = localTypeArgument.source + } + } else { + typeArgument = type.typeArguments[index] as? ConeKotlinType + val argTypeRefSource = extractTypeRefAndSourceFromTypeArgument(typeRef, index) + if (argTypeRefSource != null) { + typeArgumentTypeRef = argTypeRefSource.first + typeArgumentSource = argTypeRefSource.second + } + } + + if (typeArgument != null && typeArgumentSource != null) { + val upperBound = getSubstitutedUpperBound(typeParameterSymbols[index], substitutor, typeSystemContext) + if (upperBound != null && !satisfiesBounds(upperBound, typeArgument.type, typeSystemContext)) { + reporter.reportOn(typeArgumentSource, FirErrors.UPPER_BOUND_VIOLATED, upperBound, context) + } + + analyzeTypeParameters(typeArgumentTypeRef, context, reporter) + } } } + +private fun getSubstitutedUpperBound( + prototypeSymbol: FirTypeParameterSymbol, + substitutor: ConeSubstitutor, + typeSystemContext: ConeTypeContext +): ConeKotlinType? { + val intersection = typeSystemContext.intersectTypes(prototypeSymbol.fir.bounds.map { it.coneType }) as? ConeKotlinType ?: return null + return substitutor.substituteOrSelf(intersection) +} + +private fun satisfiesBounds(upperBound: ConeKotlinType, target: ConeKotlinType, typeSystemContext: ConeTypeContext): Boolean { + return AbstractTypeChecker.isSubtypeOf(typeSystemContext, target, upperBound, stubTypesEqualToAnything = false) +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index 9513c9c9cca..fbc6785007e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt @@ -286,15 +286,7 @@ private fun ConstraintSystemError.toDiagnostic( FirErrors.TYPE_MISMATCH.createOn(qualifiedAccessSource ?: source, upperConeType, inferredType) } - is ExplicitTypeParameterConstraintPosition<*> -> { - val conePosition = position as ConeExplicitTypeParameterConstraintPosition - val typeArgument = conePosition.typeArgument - - FirErrors.UPPER_BOUND_VIOLATED.createOn( - typeArgument.source ?: qualifiedAccessSource ?: source, - upperConeType, - ) - } + is ExplicitTypeParameterConstraintPosition<*>, is DelegatedPropertyConstraintPosition<*> -> { errorsToIgnore.add(this) return null diff --git a/compiler/testData/codegen/box/reflection/typeOf/noReflect/nonReifiedTypeParameters/innerGeneric.kt b/compiler/testData/codegen/box/reflection/typeOf/noReflect/nonReifiedTypeParameters/innerGeneric.kt index 8f9f3a4a258..bae963c80b5 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/noReflect/nonReifiedTypeParameters/innerGeneric.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/noReflect/nonReifiedTypeParameters/innerGeneric.kt @@ -1,4 +1,3 @@ -// IGNORE_FIR_DIAGNOSTICS // !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi // TARGET_BACKEND: JVM // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/innerGeneric.kt b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/innerGeneric.kt index ab7a22b0ee3..1d333a6345c 100644 --- a/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/innerGeneric.kt +++ b/compiler/testData/codegen/box/reflection/typeOf/nonReifiedTypeParameters/innerGeneric.kt @@ -1,4 +1,3 @@ -// IGNORE_FIR_DIAGNOSTICS // !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi // WITH_REFLECT // KJS_WITH_FULL_RUNTIME diff --git a/compiler/testData/codegen/box/vararg/varargsOverride3.kt b/compiler/testData/codegen/box/vararg/varargsOverride3.kt index 77175577048..020b0c7a18f 100644 --- a/compiler/testData/codegen/box/vararg/varargsOverride3.kt +++ b/compiler/testData/codegen/box/vararg/varargsOverride3.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // MODULE: lib // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/Bounds.fir.kt b/compiler/testData/diagnostics/tests/Bounds.fir.kt index e722893a7b9..a3e9131d1e9 100644 --- a/compiler/testData/diagnostics/tests/Bounds.fir.kt +++ b/compiler/testData/diagnostics/tests/Bounds.fir.kt @@ -20,10 +20,10 @@ package boundsWithSubstitutors class Pair - abstract class C, X : (B) -> Pair, B>>() : B() { // 2 errors + abstract class CInt>, X : (B<Char>) -> PairAny>, B>>() : B<Any>() { // 2 errors val a = B<Char>() // error - abstract val x : (B) -> B + abstract val x : (B<Char>) -> B<Any> } diff --git a/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt b/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt index cad212e0616..5393e980c76 100644 --- a/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt +++ b/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt @@ -45,7 +45,7 @@ class Foo() {} class BarFoo> -class Buzz where T : Bar, T : nioho +class Buzz where T : Bar<Int>, T : nioho class XFoo> class Y<T> where T : Foo, T : Bar @@ -62,8 +62,8 @@ fun test2(t : T) t.bar() } -val t1 = test2(A()) -val t2 = test2(C()) +val t1 = test2<A>(A()) +val t2 = test2<B>(C()) val t3 = test2(C()) val <T, B : T> x : Int = 0 diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt index 8ce920d8631..53df97bcf8a 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kClassInSignature.fir.kt @@ -8,7 +8,7 @@ val test4 get() = T:: fun test5() = listOf(T::class) -fun test6(): kotlin.reflect.KClass = T::class +fun test6(): kotlin.reflect.KClass<T> = T::class fun test7(): kotlin.reflect.KClass<*> = T::class fun test8() = String?::class diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.fir.kt index 8cfced5f4b5..9f5dda53c4d 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.fir.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/missingNames.fir.kt @@ -21,9 +21,9 @@ interface { } -enum class { +enum class { -} +} annotation class { @@ -48,9 +48,9 @@ class Outer { } - enum class { + enum class { - } + } annotation class { diff --git a/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt b/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt index 6fb7a3df010..cac2450a5f1 100644 --- a/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/enumInheritance.fir.kt @@ -2,7 +2,7 @@ // FILE: test.kt enum class MyEnum(): MyClass() {} enum class MyEnum2(): MyTrait {} -enum class MyEnum3(): MyEnumBase() {} +enum class MyEnum3(): MyEnumBase() {} open class MyClass() {} diff --git a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt deleted file mode 100644 index 667fdbd573c..00000000000 --- a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -open class C> -class TestOK : C() -class TestFail : C>() diff --git a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.kt b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.kt index 33add95e801..377ea7dccb0 100644 --- a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.kt +++ b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundCheck.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class C> class TestOK : C() class TestFail : C<C<TestFail>>() diff --git a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.fir.kt b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.fir.kt deleted file mode 100644 index ceed755ac5d..00000000000 --- a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.fir.kt +++ /dev/null @@ -1 +0,0 @@ -class D, B : D> diff --git a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.kt b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.kt index 3e58ee5012a..98b8d97e241 100644 --- a/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.kt +++ b/compiler/testData/diagnostics/tests/generics/RecursiveUpperBoundWithTwoArguments.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL class DString>, B : D> diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.fir.kt deleted file mode 100644 index f273fb31857..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -class Outer { - inner class Inner -} - -val x: Outer.Inner = null!! diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.kt index 9004f84bb51..bb9b8d8f865 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/checkBoundsOuter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { inner class Inner } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.fir.kt deleted file mode 100644 index 3e4dd070b0a..00000000000 --- a/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface A - -fun foo1(a: A) {} - -class B1 : A -class B2 : A -class B3 : A - -class B4 : A - -fun foo(a: A, b: A, c: A) {} diff --git a/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.kt b/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.kt index b53d005d90a..821756ec634 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/declarationsBoundsViolation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface A diff --git a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt index 457375011b1..8c4559c5794 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/expressionsBoundsViolation.fir.kt @@ -7,10 +7,10 @@ fun E.foo2() {} fun bar(x: F) { A(x) - A(x) + A<F>(x) foo1(x) - foo1(x) + foo1<F>(x) x.foo2() x.foo2() diff --git a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt index cc72d5e866f..636d4af17dd 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolation.fir.kt @@ -16,7 +16,7 @@ class A { val x2 = foo2(x) x2.checkType { _() } - foo1(y) + foo1<F?>(y) foo1(y) foo2(y) @@ -36,13 +36,13 @@ class A { val x5 = foo2(z) x4.checkType { _() } - foo1(w) + foo1<W>(w) foo1(w) foo2(w) val x6 = foo2(w) x6.checkType { _() } - foo1(w) + foo1<W>(w) } } diff --git a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.fir.kt index e8301245153..8ceb682dc70 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/tpBoundsViolationVariance.fir.kt @@ -17,7 +17,7 @@ class A { fun bar() { // F fooInv1>(Inv()) - fooInv2>(Inv()) + fooInv2<Inv>(Inv()) fooInv1(Inv()) fooInv2(Inv()) @@ -32,13 +32,13 @@ class A { fooOut2(Out()) // Z - fooInv1>(Inv()) - fooInv2>(Inv()) + fooInv1<Inv>(Inv()) + fooInv2<Inv>(Inv()) fooInv1(Inv()) fooInv2(Inv()) - fooIn1>(In()) - fooIn2>(In()) + fooIn1<In>(In()) + fooIn2<In>(In()) fooIn1(In()) fooIn2(In()) @@ -48,17 +48,17 @@ class A { fooOut2(Out()) // W - fooInv1>(Inv()) - fooInv2>(Inv()) + fooInv1<Inv>(Inv()) + fooInv2<Inv>(Inv()) fooInv1(Inv()) fooInv2(Inv()) - fooIn1>(In()) - fooIn2>(In()) + fooIn1<In>(In()) + fooIn2<In>(In()) fooIn1(In()) fooIn2(In()) - fooOut1>(Out()) + fooOut1<Out>(Out()) fooOut2>(Out()) fooOut1(Out()) fooOut2(Out()) diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt index d34eb310c3f..2bb5231c42f 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/typeParameterBounds.fir.kt @@ -13,14 +13,14 @@ class A { fun foo2(a: A, b: A) { a.foo1(Out()) - a.foo1>(Out()) + a.foo1<Out>(Out()) a.foo1(Out()) a.foo1(Out()) a.foo2(Inv()) a.foo2(Inv()) - a.foo2>(Inv()) + a.foo2<Inv>(Inv()) a.foo3(In()) a.foo3(In()) @@ -32,11 +32,11 @@ fun foo2(a: A, b: A) { b.foo2(Inv()) b.foo2(Inv()) - b.foo2>(Inv()) + b.foo2<Inv>(Inv()) b.foo3(In()) - b.foo3>(In()) + b.foo3<In>(In()) b.foo3(In()) b.foo3(In()) diff --git a/compiler/testData/diagnostics/tests/objects/upperBoundViolated.fir.kt b/compiler/testData/diagnostics/tests/objects/upperBoundViolated.fir.kt deleted file mode 100644 index 86ba09f738d..00000000000 --- a/compiler/testData/diagnostics/tests/objects/upperBoundViolated.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -interface Trait - -object O1 : Trait - -object O2 : Trait - -class C { - companion object : Trait -} diff --git a/compiler/testData/diagnostics/tests/objects/upperBoundViolated.kt b/compiler/testData/diagnostics/tests/objects/upperBoundViolated.kt index 7482dad5350..dd6aadff40b 100644 --- a/compiler/testData/diagnostics/tests/objects/upperBoundViolated.kt +++ b/compiler/testData/diagnostics/tests/objects/upperBoundViolated.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Trait object O1 : Trait diff --git a/compiler/testData/diagnostics/tests/recovery/namelessMembers.kt b/compiler/testData/diagnostics/tests/recovery/namelessMembers.kt index 75fdd6de850..81531142adb 100644 --- a/compiler/testData/diagnostics/tests/recovery/namelessMembers.kt +++ b/compiler/testData/diagnostics/tests/recovery/namelessMembers.kt @@ -1,5 +1,4 @@ // FIR_IDENTICAL -// FIR_IDE_IGNORE // !DIAGNOSTICS: -REDECLARATION -DUPLICATE_CLASS_NAMES class C { diff --git a/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.fir.kt b/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.fir.kt index cd991c43268..54973f749d1 100644 --- a/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.fir.kt +++ b/compiler/testData/diagnostics/tests/recovery/namelessToplevelDeclarations.fir.kt @@ -21,6 +21,6 @@ object { } -enum class {} +enum class {} annotation class {} diff --git a/compiler/testData/diagnostics/tests/regressions/kt7585/base.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt7585/base.fir.kt index 787912a190b..93698f68846 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt7585/base.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt7585/base.fir.kt @@ -7,7 +7,7 @@ abstract class Wrapper(protected val t: T) class MyWrapper(a: A): Wrapper(a) // This wrapper is not legal -class TheirWrapper(e: E): Wrapper(e) +class TheirWrapper(e: E): Wrapper<E>(e) data class Pair(val a: T, val b: T) diff --git a/compiler/testData/diagnostics/tests/regressions/kt7585/java.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt7585/java.fir.kt index ae842e22e14..ec88029e9a7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt7585/java.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt7585/java.fir.kt @@ -17,7 +17,7 @@ class E class MyWrapper(a: A): Wrapper(a) // This wrapper is not legal -class TheirWrapper(e: E): Wrapper(e) +class TheirWrapper(e: E): Wrapper<E>(e) data class Pair(val a: T, val b: T) diff --git a/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt b/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt index 5738953c8c6..182a5d52bec 100644 --- a/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt +++ b/compiler/testData/diagnostics/tests/substitutions/starProjections.fir.kt @@ -10,7 +10,7 @@ fun testA(a: A<*, *>) { a.t().checkType { _>() } } -interface B, T>> { +interface B, T>> { fun r(): R fun t(): T } diff --git a/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt b/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt index 7699ca8a113..1d587359492 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/boundViolationInTypeAliasConstructor.fir.kt @@ -3,7 +3,7 @@ class Num(val x: T) typealias N = Num typealias N2 = N -val x1 = Num("") +val x1 = Num<String>("") val x2 = N("") val x3 = N2("") @@ -12,6 +12,6 @@ class TColl> typealias TC = TColl typealias TC2 = TC -val y1 = TCollAny>() +val y1 = TCollAny>() val y2 = TC() val y3 = TC2() diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt index ac30b24745f..1b8377b9557 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt @@ -8,7 +8,7 @@ */ open class Case1 { open inner class Case1_1: Case1() where L : CharSequence { - inner class Case1_2: Case1.Case1_1() where M : Map { + inner class Case1_2: Case1.Case1_1<M>() where M : Map { inline fun case_1(x: Any?) { x as M x as L diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt index ac30b24745f..1b8377b9557 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt @@ -8,7 +8,7 @@ */ open class Case1 { open inner class Case1_1: Case1() where L : CharSequence { - inner class Case1_2: Case1.Case1_1() where M : Map { + inner class Case1_2: Case1.Case1_1<M>() where M : Map { inline fun case_1(x: Any?) { x as M x as L diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt index ac30b24745f..1b8377b9557 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt @@ -8,7 +8,7 @@ */ open class Case1 { open inner class Case1_1: Case1() where L : CharSequence { - inner class Case1_2: Case1.Case1_1() where M : Map { + inner class Case1_2: Case1.Case1_1<M>() where M : Map { inline fun case_1(x: Any?) { x as M x as L diff --git a/idea/testData/checker/Bounds.fir.kt b/idea/testData/checker/Bounds.fir.kt index 1ac222a40b9..913d7de5f78 100644 --- a/idea/testData/checker/Bounds.fir.kt +++ b/idea/testData/checker/Bounds.fir.kt @@ -1,10 +1,12 @@ +// EXPECTED_DUPLICATED_HIGHLIGHTING open class A {} open class B() class Pair - abstract class C, X : (B) -> Pair, B>>() : B() { // 2 errors + abstract class CInt>, X : (B<Char>) -> PairAny>, B>>() : B<Any>() { // 2 errors val a = B<Char>() // error - abstract val x : (B) -> B + abstract val x : (B<Char>) -> B<Any> } + diff --git a/idea/testData/checker/BoundsWithSubstitutors.fir.kt b/idea/testData/checker/BoundsWithSubstitutors.fir.kt index 0b219846797..17231341156 100644 --- a/idea/testData/checker/BoundsWithSubstitutors.fir.kt +++ b/idea/testData/checker/BoundsWithSubstitutors.fir.kt @@ -6,10 +6,10 @@ class C : A() val a = B() - val a1 = B<Int>() + val a1 = B<Int>() class X() val b = X, C>>() val b0 = XAny?>() - val b1 = XX, String>>() + val b1 = X, String>>() diff --git a/idea/testData/checker/MultipleBounds.fir.kt b/idea/testData/checker/MultipleBounds.fir.kt index 5ecd4981bac..e510bfc7179 100644 --- a/idea/testData/checker/MultipleBounds.fir.kt +++ b/idea/testData/checker/MultipleBounds.fir.kt @@ -30,8 +30,8 @@ class Test1() } fun test() { - Test1<B>() - Test1<A>() + Test1<B>() + Test1<A>() Test1() } @@ -39,7 +39,7 @@ class Foo() {} class Bar -class Buzz where T : Bar, T : nioho +class Buzz where T : Bar<Int>, T : nioho class X class Y<T> where T : Foo, T : Bar @@ -56,8 +56,8 @@ fun test2(t : T) t.bar() } -val t1 = test2(A()) -val t2 = test2(C()) +val t1 = test2<A>(A()) +val t2 = test2<B>(C()) val t3 = test2(C()) val Pair.x : Int get() = 0 diff --git a/idea/testData/checker/recovery/namelessMembers.fir.kt b/idea/testData/checker/recovery/namelessMembers.fir.kt index 94558750fe7..4575656dc66 100644 --- a/idea/testData/checker/recovery/namelessMembers.fir.kt +++ b/idea/testData/checker/recovery/namelessMembers.fir.kt @@ -7,7 +7,7 @@ class C { class {} - enum class {} + enum class {} } class C1<in> {} diff --git a/idea/testData/checker/recovery/namelessToplevelDeclarations.fir.kt b/idea/testData/checker/recovery/namelessToplevelDeclarations.fir.kt index ea27e8ab56c..0ef27de8c1f 100644 --- a/idea/testData/checker/recovery/namelessToplevelDeclarations.fir.kt +++ b/idea/testData/checker/recovery/namelessToplevelDeclarations.fir.kt @@ -19,6 +19,6 @@ object { } -enum class {} +enum class {} annotation class {}