diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt index d3c15ddac4d..2763a3e4dd2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt @@ -7,8 +7,8 @@ abstract class Foo { } fun foo() { - bar<T>() - barT>>>() + bar<T>() + barT>>>() } fun bar() {} @@ -27,8 +27,8 @@ fun gest() {} fun fest() { val b: List<T> - gest<T>() + gest<T>() gest() val c: ListT>>> - gestT>>>() + gestT>>>() } \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt index 2dbc6b6b1d9..3a1cca555b7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt @@ -14,8 +14,8 @@ fun test() { val b1 = B<Int>() val b2 = B() val b3 = B<Any?>() - val b4 = B<UnexistingType>() - val b5 = B<B>() + val b4 = B<UnexistingType>() + val b5 = B<B>() fest<Boolean>() fest() fest() diff --git a/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt b/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt index 9ce2d49bfb6..7abe15c411b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt +++ b/compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt @@ -1,5 +1,5 @@ import incorrect.directory.Your -typealias My = incorrect.directory.My +typealias My = incorrect.directory.My typealias Your = Your \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt b/compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt index 19b178b5232..b062b6db320 100644 --- a/compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt +++ b/compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt @@ -15,7 +15,7 @@ package other import test.Test.* abstract class Factory { - abstract fun createTest(): Test + abstract fun createTest(): Test abstract fun createObj(): O diff --git a/compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt b/compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt index e652d43431d..d9e6671eed0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt +++ b/compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt @@ -9,9 +9,9 @@ abstract class My { abstract fun foo(arg: T) - abstract val y: My.T + abstract val y: My.T - abstract val z: test.My.T + abstract val z: test.My.T class Some : T() } diff --git a/compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt b/compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt index 3ef73ef7c30..f78eb42830c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt +++ b/compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt @@ -10,4 +10,4 @@ class A { fun foo(c: A.B.C) {} -fun foo(c: A.B.C) {} \ No newline at end of file +fun foo(c: A.B.C) {} \ No newline at end of file diff --git a/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt b/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt index 540afd11c7a..7fc4f2897e9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt +++ b/compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt @@ -58,6 +58,6 @@ class Test6 : E, C.CPublic { } -class Test7 : D.PublicButProtected { +class Test7 : D.PublicButProtected { } \ No newline at end of file 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 8da746854b7..e1faa222081 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 @@ -47,7 +47,11 @@ object FirUpperBoundViolatedChecker : FirQualifiedAccessChecker() { functionCall.typeArguments[it].safeAs() ?.typeRef.safeAs() ?.let { that -> - parameterPairs[calleeFir.typeParameters[it].symbol] = that + if (that !is FirErrorTypeRef) { + parameterPairs[calleeFir.typeParameters[it].symbol] = that + } else { + return + } } } @@ -124,7 +128,11 @@ object FirUpperBoundViolatedChecker : FirQualifiedAccessChecker() { for (it in 0 until count) { actualConstructor.typeArguments[it].safeAs() ?.let { that -> - constructorsParameterPairs[protoConstructor.typeParameters[it].symbol] = that + if (that !is ConeClassErrorType) { + constructorsParameterPairs[protoConstructor.typeParameters[it].symbol] = that + } else { + return + } } } @@ -180,7 +188,11 @@ object FirUpperBoundViolatedChecker : FirQualifiedAccessChecker() { for (it in 0 until count) { type.typeArguments[it].safeAs() ?.let { that -> - parameterPairs[prototypeClass.typeParameters[it].symbol] = that + if (that !is ConeClassErrorType) { + parameterPairs[prototypeClass.typeParameters[it].symbol] = that + } else { + return true + } } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index 7e265f122f5..82ea99d968a 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -89,6 +89,8 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect is ConeUnexpectedTypeArgumentsError -> FirErrors.TYPE_ARGUMENTS_NOT_ALLOWED.on(diagnostic.source.safeAs() ?: source) is ConeSimpleDiagnostic -> if (source.kind is FirFakeSourceElementKind) { null + } else if (diagnostic.kind == SymbolNotFound) { + FirErrors.UNRESOLVED_REFERENCE.on(source, "") } else { diagnostic.getFactory().on(source) } @@ -120,6 +122,10 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect JumpOutsideLoop -> FirErrors.BREAK_OR_CONTINUE_OUTSIDE_A_LOOP NotLoopLabel -> FirErrors.NOT_A_LOOP_LABEL VariableExpected -> FirErrors.VARIABLE_EXPECTED + NoTypeForTypeParameter -> FirErrors.NO_TYPE_FOR_TYPE_PARAMETER + UnknownCallableKind -> FirErrors.UNKNOWN_CALLABLE_KIND + IllegalProjectionUsage -> FirErrors.ILLEGAL_PROJECTION_USAGE + MissingStdlibClass -> FirErrors.MISSING_STDLIB_CLASS Other -> FirErrors.OTHER_ERROR else -> throw IllegalArgumentException("Unsupported diagnostic kind: $kind at $javaClass") } 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 b27325cf6d3..7c71ed884cd 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 @@ -88,6 +88,11 @@ object FirErrors { val LOCAL_INTERFACE_NOT_ALLOWED by error0() val TYPE_PARAMETERS_IN_OBJECT by error0() + val NO_TYPE_FOR_TYPE_PARAMETER by error0() + val UNKNOWN_CALLABLE_KIND by error0() + val ILLEGAL_PROJECTION_USAGE by error0() + val MISSING_STDLIB_CLASS by error0() + // Control flow diagnostics val UNINITIALIZED_VARIABLE by error1() diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt index 5d19ec1b384..48b5cbb9501 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt @@ -75,7 +75,7 @@ internal fun FirTypeRef.toConeKotlinTypeProbablyFlexible( type.toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack) } else -> ConeKotlinErrorType( - ConeSimpleDiagnostic("Unexpected type reference in JavaClassUseSiteMemberScope: ${this::class.java}") + ConeSimpleDiagnostic("Unexpected type reference in JavaClassUseSiteMemberScope: ${this::class.java}", DiagnosticKind.Java) ) } @@ -321,7 +321,7 @@ private fun JavaClassifierType.toConeKotlinTypeForFlexibleBound( val symbol = javaTypeParameterStack[classifier] ConeTypeParameterTypeImpl(symbol.toLookupTag(), isNullable = !isLowerBound) } - else -> ConeKotlinErrorType(ConeSimpleDiagnostic("Unexpected classifier: $classifier")) + else -> ConeKotlinErrorType(ConeSimpleDiagnostic("Unexpected classifier: $classifier", DiagnosticKind.Java)) } } @@ -396,7 +396,7 @@ private fun JavaType?.toConeProjectionWithoutEnhancement( } is JavaClassifierType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack) is JavaArrayType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack) - else -> ConeClassErrorType(ConeSimpleDiagnostic("Unexpected type argument: $this")) + else -> ConeClassErrorType(ConeSimpleDiagnostic("Unexpected type argument: $this", DiagnosticKind.Java)) } } @@ -501,7 +501,7 @@ private fun JavaType.toFirResolvedTypeRef( forTypeParameterBounds = false ) return buildResolvedTypeRef { - type = ConeClassErrorType(ConeSimpleDiagnostic("Unexpected JavaType: $this")) + type = ConeClassErrorType(ConeSimpleDiagnostic("Unexpected JavaType: $this", DiagnosticKind.Java)) } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt index b5b904d7c1a..cc7ef4c83bc 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirTypeDeserializer.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.fir.declarations.FirTypeParameterRefsOwner import org.jetbrains.kotlin.fir.declarations.addDefaultBoundIfNecessary import org.jetbrains.kotlin.fir.declarations.builder.FirTypeParameterBuilder import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic +import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.resolve.transformers.body.resolve.firUnsafe import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag @@ -104,7 +105,7 @@ class FirTypeDeserializer( //c.components.flexibleTypeDeserializer.create(proto, id, lowerBound, upperBound) } - return simpleType(proto, attributes) ?: ConeKotlinErrorType(ConeSimpleDiagnostic("?!id:0")) + return simpleType(proto, attributes) ?: ConeKotlinErrorType(ConeSimpleDiagnostic("?!id:0", DiagnosticKind.DeserializationError)) } private fun typeParameterSymbol(typeParameterId: Int): ConeTypeParameterLookupTag? = @@ -204,7 +205,10 @@ class FirTypeDeserializer( else -> null } return result ?: ConeClassErrorType( - ConeSimpleDiagnostic("Bad suspend function in metadata with constructor: $functionTypeConstructor") + ConeSimpleDiagnostic( + "Bad suspend function in metadata with constructor: $functionTypeConstructor", + DiagnosticKind.DeserializationError + ) ) } @@ -230,7 +234,7 @@ class FirTypeDeserializer( val variance = ProtoEnumFlags.variance(typeArgumentProto.projection) val type = typeArgumentProto.type(typeTable) - ?: return ConeKotlinErrorType(ConeSimpleDiagnostic("No type recorded")) + ?: return ConeKotlinErrorType(ConeSimpleDiagnostic("No type recorded", DiagnosticKind.DeserializationError)) // TODO: check that here we don't have any attributes val coneType = type(type, ConeAttributes.Empty) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt index 8c907da8339..4f17bbd1edd 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/ResolveUtils.kt @@ -10,10 +10,7 @@ import org.jetbrains.kotlin.builtins.functions.FunctionClassDescriptor import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.declarations.* -import org.jetbrains.kotlin.fir.diagnostics.ConeIntermediateDiagnostic -import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic -import org.jetbrains.kotlin.fir.diagnostics.ConeStubDiagnostic -import org.jetbrains.kotlin.fir.diagnostics.ConeUnexpectedTypeArgumentsError +import org.jetbrains.kotlin.fir.diagnostics.* import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.builder.FirResolvedReifiedParameterReferenceBuilder import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionWithSmartcast @@ -207,7 +204,12 @@ fun FirFunction<*>.constructFunctionalTypeRef(isSuspend: Boolean = false): FirRe else -> null } val parameters = valueParameters.map { - it.returnTypeRef.coneTypeSafe() ?: ConeKotlinErrorType(ConeSimpleDiagnostic("No type for parameter")) + it.returnTypeRef.coneTypeSafe() ?: ConeKotlinErrorType( + ConeSimpleDiagnostic( + "No type for parameter", + DiagnosticKind.NoTypeForTypeParameter + ) + ) } val rawReturnType = (this as FirTypedDeclaration).returnTypeRef.coneType @@ -331,7 +333,12 @@ fun BodyResolveComponents.typeFromCallee(access: T): FirReso val implicitReceiver = implicitReceiverStack[labelName] buildResolvedTypeRef { source = null - type = implicitReceiver?.type ?: ConeKotlinErrorType(ConeSimpleDiagnostic("Unresolved this@$labelName")) + type = implicitReceiver?.type ?: ConeKotlinErrorType( + ConeSimpleDiagnostic( + "Unresolved this@$labelName", + DiagnosticKind.UnresolvedLabel + ) + ) } } is FirSuperReference -> { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt index ebba441d570..d38c7e1fa8d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic +import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier @@ -236,7 +237,7 @@ internal object CheckCallableReferenceExpectedType : CheckerStage() { expectedReturnType = extractInputOutputTypesFromCallableReferenceExpectedType(expectedType, callInfo.session)?.outputType ) is FirVariable<*> -> createKPropertyType(fir, resultingReceiverType, returnTypeRef) - else -> ConeKotlinErrorType(ConeSimpleDiagnostic("Unknown callable kind: ${fir::class}")) + else -> ConeKotlinErrorType(ConeSimpleDiagnostic("Unknown callable kind: ${fir::class}", DiagnosticKind.UnknownCallableKind)) }.let(candidate.substitutor::substituteOrSelf) candidate.resultingTypeForCallableReference = resultingType diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirTypeResolverImpl.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirTypeResolverImpl.kt index 49bdfac0f9a..4ebae6b324d 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirTypeResolverImpl.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirTypeResolverImpl.kt @@ -95,7 +95,7 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver { areBareTypesAllowed: Boolean ): ConeKotlinType { if (symbol == null) { - return ConeKotlinErrorType(ConeSimpleDiagnostic("Symbol not found, for `${typeRef.render()}`")) + return ConeKotlinErrorType(ConeSimpleDiagnostic("Symbol not found, for `${typeRef.render()}`", DiagnosticKind.SymbolNotFound)) } if (symbol is FirTypeParameterSymbol) { for (part in typeRef.qualifier) { @@ -122,8 +122,12 @@ class FirTypeResolverImpl(private val session: FirSession) : FirTypeResolver { } else { val argumentsFromOuterClassesAndParents = symbol.fir.typeParameters.takeLast(n).map { val type = ConeTypeParameterTypeImpl(ConeTypeParameterLookupTag(it.symbol), isNullable = false) + // we should report ConeSimpleDiagnostic(..., WrongNumberOfTypeArguments) + // but genericArgumentNumberMismatch.kt test fails with + // index out of bounds exception for start offset of + // the source substitutor.substituteOrNull(type) - ?: ConeClassErrorType(ConeSimpleDiagnostic("Type argument not defined")) + ?: ConeClassErrorType(ConeIntermediateDiagnostic("Type argument not defined")) }.toTypedArray() typeArguments += argumentsFromOuterClassesAndParents } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirAbstractTreeTransformerWithSuperTypes.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirAbstractTreeTransformerWithSuperTypes.kt index c4f0505cef7..a49f60911c7 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirAbstractTreeTransformerWithSuperTypes.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirAbstractTreeTransformerWithSuperTypes.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.declarations.FirResolvePhase import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic +import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind import org.jetbrains.kotlin.fir.expressions.FirStatement import org.jetbrains.kotlin.fir.resolve.lookupSuperTypes import org.jetbrains.kotlin.fir.resolve.providers.getNestedClassifierScope @@ -85,7 +86,7 @@ abstract class FirAbstractTreeTransformerWithSuperTypes( fun createSubstitutionForSupertype(superType: ConeLookupTagBasedType, session: FirSession): ConeSubstitutor { val klass = superType.lookupTag.toSymbol(session)?.fir as? FirRegularClass ?: return ConeSubstitutor.Empty val arguments = superType.typeArguments.map { - it as? ConeKotlinType ?: ConeClassErrorType(ConeSimpleDiagnostic("illegal projection usage")) + it as? ConeKotlinType ?: ConeClassErrorType(ConeSimpleDiagnostic("illegal projection usage", DiagnosticKind.IllegalProjectionUsage)) } val mapping = klass.typeParameters.map { it.symbol }.zip(arguments).toMap() return ConeSubstitutorByMap(mapping) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index 69ab2a1c350..a58506f083e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -916,7 +916,7 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor valueParameter.transformReturnTypeRef( StoreType, valueParameter.returnTypeRef.resolvedTypeFromPrototype( - ConeKotlinErrorType(ConeSimpleDiagnostic("No type for parameter")) + ConeKotlinErrorType(ConeSimpleDiagnostic("No type for parameter", DiagnosticKind.NoTypeForTypeParameter)) ) ) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt index f1aee465f37..37499cc4cbf 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt @@ -78,7 +78,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform callee.replaceBoundSymbol(it) } qualifiedAccessExpression.resultType = buildResolvedTypeRef { - type = implicitReceiver?.type ?: ConeKotlinErrorType(ConeSimpleDiagnostic("Unresolved this@$labelName")) + type = implicitReceiver?.type ?: ConeKotlinErrorType(ConeSimpleDiagnostic("Unresolved this@$labelName", DiagnosticKind.UnresolvedLabel)) } qualifiedAccessExpression } @@ -660,7 +660,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform private fun FirConstKind<*>.expectedConeType(): ConeKotlinType { fun constructLiteralType(classId: ClassId, isNullable: Boolean = false): ConeKotlinType { val symbol = symbolProvider.getClassLikeSymbolByFqName(classId) - ?: return ConeClassErrorType(ConeSimpleDiagnostic("Missing stdlib class: $classId")) + ?: return ConeClassErrorType(ConeSimpleDiagnostic("Missing stdlib class: $classId", DiagnosticKind.MissingStdlibClass)) return symbol.toLookupTag().constructClassType(emptyArray(), isNullable) } return when (this) { diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/diagnostics/ConeSimpleDiagnostic.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/diagnostics/ConeSimpleDiagnostic.kt index f039adff873..c5c7172bf94 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/diagnostics/ConeSimpleDiagnostic.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/diagnostics/ConeSimpleDiagnostic.kt @@ -27,5 +27,10 @@ enum class DiagnosticKind { Java, SuperNotAllowed, WrongNumberOfTypeArguments, + NoTypeForTypeParameter, + UnknownCallableKind, + SymbolNotFound, + IllegalProjectionUsage, + MissingStdlibClass, Other } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/EnumEntryAsType.fir.kt b/compiler/testData/diagnostics/tests/EnumEntryAsType.fir.kt index af1ba53d489..16a6cf63c35 100644 --- a/compiler/testData/diagnostics/tests/EnumEntryAsType.fir.kt +++ b/compiler/testData/diagnostics/tests/EnumEntryAsType.fir.kt @@ -3,53 +3,53 @@ enum class Color { RED { - fun RED> simpleName(): RED = null!! + fun RED> simpleName(): RED = null!! } } -class MyColor(val x: Color.RED, y: Color.RED) : Color.RED { +class MyColor(val x: Color.RED, y: Color.RED) : Color.RED { - var z: Color.RED = Color.RED + var z: Color.RED = Color.RED set(arg: Color.RED) { z = arg } - fun foo(arg: Color.RED): Color.RED = arg + fun foo(arg: Color.RED): Color.RED = arg - fun bar(): Color.RED { - class Local : Color.RED - fun local(arg: Color.RED): Color.RED = arg - val temp: Color.RED = Color.RED - temp as? Color.RED - if (temp is Color.RED) { - return temp as Color.RED + fun bar(): Color.RED { + class Local : Color.RED + fun local(arg: Color.RED): Color.RED = arg + val temp: Color.RED = Color.RED + temp as? Color.RED + if (temp is Color.RED) { + return temp as Color.RED } - val obj = object : Color.RED {} - if (obj is Color.RED) { + val obj = object : Color.RED {} + if (obj is Color.RED) { return obj } return Color.RED } } -fun create(): Array? = null +fun create(): Array? = null -interface YourColor.RED> +interface YourColor.RED> -class His : Your +class His : Your -fun Color.RED> otherCreate(): Array? = null +fun Color.RED> otherCreate(): Array? = null -typealias RedAlias = Color.RED +typealias RedAlias = Color.RED -typealias ArrayOfEnumEntry = Array +typealias ArrayOfEnumEntry = Array typealias ArrayOfEnumEntryAlias = Array fun bar(a: Any): T = a as T fun foo() { - foo<Color.RED>() + foo<Color.RED>() foo() bar(Color.RED) } -fun Array.foo(entries: Array): Array = null!! \ No newline at end of file +fun Array.foo(entries: Array): Array = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/LocalClassAndShortSubpackageNames.fir.kt b/compiler/testData/diagnostics/tests/LocalClassAndShortSubpackageNames.fir.kt index d0782f54f32..7496ee5ad0a 100644 --- a/compiler/testData/diagnostics/tests/LocalClassAndShortSubpackageNames.fir.kt +++ b/compiler/testData/diagnostics/tests/LocalClassAndShortSubpackageNames.fir.kt @@ -9,7 +9,7 @@ package foo fun f() { class Local1 { - fun g() : bar.X? = null + fun g() : bar.X? = null } class Local2 { fun g() : foo.bar.X? = null diff --git a/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt b/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt index 4611bc8e25a..6ca630b3548 100644 --- a/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt +++ b/compiler/testData/diagnostics/tests/MultipleBounds.fir.kt @@ -45,7 +45,7 @@ class Foo() {} class Bar -class Buzz where T : Bar, T : nioho +class Buzz where T : Bar, T : nioho class X class Y where T : Foo, T : Bar diff --git a/compiler/testData/diagnostics/tests/PackageInTypePosition.fir.kt b/compiler/testData/diagnostics/tests/PackageInTypePosition.fir.kt deleted file mode 100644 index 2233cadbdee..00000000000 --- a/compiler/testData/diagnostics/tests/PackageInTypePosition.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: a.kt - -package foo - -// FILE: b.kt - -@foo fun bar(p: foo): foo = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/PackageInTypePosition.kt b/compiler/testData/diagnostics/tests/PackageInTypePosition.kt index 8a6e37b341e..7e89f6d3507 100644 --- a/compiler/testData/diagnostics/tests/PackageInTypePosition.kt +++ b/compiler/testData/diagnostics/tests/PackageInTypePosition.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/PackageQualified.fir.kt b/compiler/testData/diagnostics/tests/PackageQualified.fir.kt index 25eceb9424f..77688d0231e 100644 --- a/compiler/testData/diagnostics/tests/PackageQualified.fir.kt +++ b/compiler/testData/diagnostics/tests/PackageQualified.fir.kt @@ -6,8 +6,8 @@ package foobar.a import java.* val a : java.util.List? = null - val a2 : util.List? = null - val a3 : LinkedList? = null + val a2 : util.List? = null + val a3 : LinkedList? = null // FILE: b.kt package foobar @@ -21,7 +21,7 @@ package foobar.a import java.util.* val b : List? = a - val b1 : util.List? = a + val b1 : util.List? = a // FILE: b.kt package foobar diff --git a/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt b/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt index d8af20c4f8b..c7a51271bb7 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt +++ b/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt @@ -15,10 +15,10 @@ import java.lang.Comparable as Com val l : MutableList = ArrayList() fun test(l : java.util.List) { - val x : java.List + val x : java.List val y : java.util.List val b : java.lang.Object - val z : java.utils.List + val z : java.utils.List val f : java.io.File? = null diff --git a/compiler/testData/diagnostics/tests/Unresolved.fir.kt b/compiler/testData/diagnostics/tests/Unresolved.fir.kt index c35692ac67c..d4133613353 100644 --- a/compiler/testData/diagnostics/tests/Unresolved.fir.kt +++ b/compiler/testData/diagnostics/tests/Unresolved.fir.kt @@ -3,8 +3,8 @@ package unresolved class Pair(val a: A, val b: B) fun testGenericArgumentsCount() { - val p1: Pair = Pair(2, 2) - val p2: Pair = Pair(2, 2) + val p1: Pair = Pair(2, 2) + val p2: Pair = Pair(2, 2) } fun testUnresolved() { diff --git a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.fir.kt b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.fir.kt index 10cf14219e2..3877160fc10 100644 --- a/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/AmbigiousAnnotationConstructor.fir.kt @@ -2,5 +2,5 @@ import java.util.ArrayList @ArrayList(1, 1) fun b() {} -@Xoo(x) fun c() {} +@Xoo(x) fun c() {} @java.lang.Deprecated(x) fun a() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.fir.kt deleted file mode 100644 index f3ac5821eb6..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// Check that there won't be "Rewrite at slice ANNOTATION key" exception - EA-36935 -@someErrorAnnotation object Test { -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt index 890cd6b12c0..03e71ec82ef 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationForObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Check that there won't be "Rewrite at slice ANNOTATION key" exception - EA-36935 @someErrorAnnotation object Test { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.fir.kt b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.fir.kt deleted file mode 100644 index c960d92fb4c..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -package test - -// Checks that there is no rewrite error at ANNOTATION slice because of resolving annotations for object in lazy resolve and resolving -// object as property (method tries to resolve annotations too). - -@BadAnnotation -object SomeObject - -val some = SomeObject \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt index 57fdbcf9af6..30e177f3330 100644 --- a/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/UnresolvedAnnotationOnObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test // Checks that there is no rewrite error at ANNOTATION slice because of resolving annotations for object in lazy resolve and resolving diff --git a/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt b/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt index 33ffb91a542..e0daadfb8b8 100644 --- a/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/invalidTypesInAnnotationConstructor.fir.kt @@ -34,7 +34,7 @@ annotation class Ann8(val p1: Array, val p4: Array) annotation class Ann9( - val error: Unresolved = Unresolved.VALUE + val error: Unresolved = Unresolved.VALUE ) diff --git a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt index 5384dd184df..5d5314779f0 100644 --- a/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/kt1860-negative.fir.kt @@ -1,10 +1,10 @@ // !WITH_NEW_INFERENCE -fun foo(@varargs f : Int) {} +fun foo(@varargs f : Int) {} var bar : Int = 1 - set(@varargs v) {} + set(@varargs v) {} -val x : (Int) -> Int = {@varargs x : Int -> x} +val x : (Int) -> Int = {@varargs x : Int -> x} -class Hello(@varargs args: Any) { +class Hello(@varargs args: Any) { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.fir.kt b/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.fir.kt index ea387f03efe..060d89e47f1 100644 --- a/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/unresolvedReferenceRange.fir.kt @@ -1,5 +1,5 @@ -@Ann class A -@Ann class B -@Ann(1) class C -@kotlin.Ann(1) class D -@kotlin.annotation.Ann(1) class E \ No newline at end of file +@Ann class A +@Ann class B +@Ann(1) class C +@kotlin.Ann(1) class D +@kotlin.annotation.Ann(1) class E \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt index 56ed249b618..e12b96fe1fc 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt @@ -27,7 +27,7 @@ class Test { fun List.testClassLiteral3() = b::class fun List.testUnresolved1() = unresolved::foo - fun List.testUnresolved2() = a<unresolved>::foo + fun List.testUnresolved2() = a<unresolved>::foo fun List.testUnresolved3() = a<>::foo fun List.testUnresolved4() = unresolved?::foo } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.fir.kt b/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.fir.kt index a949a0b92f1..83bc5593295 100644 --- a/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/ea81649_errorPropertyLHS.fir.kt @@ -5,7 +5,7 @@ // MODULE: m1 // FILE: bar.kt -fun bar(ff: Err.() -> Unit) { +fun bar(ff: Err.() -> Unit) { } // MODULE: m2(m1) diff --git a/compiler/testData/diagnostics/tests/callableReference/noExceptionOnRedCodeWithArrayLikeCall.fir.kt b/compiler/testData/diagnostics/tests/callableReference/noExceptionOnRedCodeWithArrayLikeCall.fir.kt index d159fc7bea3..5ca4378d724 100644 --- a/compiler/testData/diagnostics/tests/callableReference/noExceptionOnRedCodeWithArrayLikeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/noExceptionOnRedCodeWithArrayLikeCall.fir.kt @@ -2,10 +2,10 @@ class DTO { val q: Int = 0 - operator fun get(prop: KProperty1<*, Int>): Int = 0 + operator fun get(prop: KProperty1<*, Int>): Int = 0 } -fun foo(intDTO: DTO?, p: KProperty1<*, Int>) { +fun foo(intDTO: DTO?, p: KProperty1<*, Int>) { if (intDTO != null) { intDTO[DTO::q] intDTO.q diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedToErrorType.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedToErrorType.fir.kt index 3521a70e015..ed78494d92b 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedToErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedToErrorType.fir.kt @@ -1 +1 @@ -fun testing(a: Any) = a is UnresolvedType +fun testing(a: Any) = a is UnresolvedType diff --git a/compiler/testData/diagnostics/tests/cast/bare/ErrorsInSubstitution.fir.kt b/compiler/testData/diagnostics/tests/cast/bare/ErrorsInSubstitution.fir.kt index ba73bd8bf95..3b06d4edfe3 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/ErrorsInSubstitution.fir.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/ErrorsInSubstitution.fir.kt @@ -3,7 +3,7 @@ interface B interface G: B -fun f(p: B): Any { +fun f(p: B): Any { val v = p as G return checkSubtype>(v) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/bare/FromErrorType.fir.kt b/compiler/testData/diagnostics/tests/cast/bare/FromErrorType.fir.kt index 0beebab158e..8c0af1c54aa 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/FromErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/FromErrorType.fir.kt @@ -2,7 +2,7 @@ class G -fun foo(p: P) { +fun foo(p: P) { val v = p as G? checkSubtype>(v!!) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/bare/ToErrorType.fir.kt b/compiler/testData/diagnostics/tests/cast/bare/ToErrorType.fir.kt index fa1241fd4d2..712d6c3091a 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/ToErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/ToErrorType.fir.kt @@ -1,6 +1,6 @@ class P fun foo(p: P): Any { - val v = p as G + val v = p as G return v } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classLiteral/arrays.fir.kt b/compiler/testData/diagnostics/tests/classLiteral/arrays.fir.kt index 411b895c84c..8b87530bb2a 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/arrays.fir.kt +++ b/compiler/testData/diagnostics/tests/classLiteral/arrays.fir.kt @@ -1,7 +1,7 @@ // !LANGUAGE: +BareArrayClassLiteral val a01 = Array::class -val a02 = Array<Array>::class +val a02 = Array::class val a03 = Array::class val a04 = Array?>::class val a05 = Array::class diff --git a/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject.fir.kt b/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject.fir.kt index 500b19bc6fc..c58aeec33cd 100644 --- a/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject.fir.kt @@ -15,12 +15,12 @@ fun case_3() { } val x = object> { - fun test() = 10 as T // OK + fun test() = 10 as T // OK } fun case_4() { val x = object { - fun test() = 10 as T + fun test() = 10 as T } val y = x.test() // type y is T diff --git a/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject_after.fir.kt b/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject_after.fir.kt index 6dfb2d8eafe..18815708e9f 100644 --- a/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject_after.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/typeParametersInAnnonymousObject_after.fir.kt @@ -15,12 +15,12 @@ fun case_3() { } val x = object> { - fun test() = 10 as T // OK + fun test() = 10 as T // OK } fun case_4() { val x = object { - fun test() = 10 as T + fun test() = 10 as T } val y = x.test() // type y is T diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt index f1b42c6e79b..01e93109cf9 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.fir.kt @@ -23,7 +23,7 @@ object DefaultHttpClientWithFun : HttpClient by fClient() { private fun fClient() = HttpClientImpl() -private fun lazy(init: () -> T): kotlin.Lazy { +private fun lazy(init: () -> T): kotlin.Lazy { init() null!! } diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_after.fir.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_after.fir.kt index 03edfed7869..5cf15f3455d 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_after.fir.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_after.fir.kt @@ -9,7 +9,7 @@ public class C { open class Base () - class Foo : Data() + class Foo : Data() companion object : DerivedAbstract() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_before.fir.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_before.fir.kt index db2fa209e9b..312bfb39ead 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_before.fir.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/noMembers_before.fir.kt @@ -9,7 +9,7 @@ public class C { open class Base () - class Foo : Data() + class Foo : Data() companion object : DerivedAbstract() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dataClasses/errorTypesInDataClasses.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/errorTypesInDataClasses.fir.kt index a2bbfafd52e..8f64ee8bab3 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/errorTypesInDataClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/errorTypesInDataClasses.fir.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -data class A(val i: Int, val j: G) -data class B(val i: G, val j: G) +data class A(val i: Int, val j: G) +data class B(val i: G, val j: G) fun fa(a: A) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt index cdd2daa3385..cd653b8e32b 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_3.fir.kt @@ -11,7 +11,7 @@ fun test() { const val a3 = 0 lateinit val a4 = 0 val a5 by Delegate() - val a6 by Delegate<T>() + val a6 by Delegate<T>() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt index 5ac8f27a0d5..7d90342b090 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/localVariablesWithTypeParameters_1_4.fir.kt @@ -11,7 +11,7 @@ fun test() { const val a3 = 0 lateinit val a4 = 0 val a5 by Delegate() - val a6 by Delegate<T>() + val a6 by Delegate<T>() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/withErrorTypes.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/withErrorTypes.fir.kt index eeb6c493ae2..f0601703d23 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/withErrorTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/withErrorTypes.fir.kt @@ -1,4 +1,4 @@ interface T { - val x: ErrorType - fun getX(): ErrorType1 + val x: ErrorType + fun getX(): ErrorType1 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/ifEnumEntry.fir.kt b/compiler/testData/diagnostics/tests/enum/ifEnumEntry.fir.kt index 031b4d647df..9da746b15a6 100644 --- a/compiler/testData/diagnostics/tests/enum/ifEnumEntry.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/ifEnumEntry.fir.kt @@ -3,4 +3,4 @@ enum class MyEnum { SECOND } -fun foo(me: MyEnum): Boolean = if (me is MyEnum.FIRST) true else false \ No newline at end of file +fun foo(me: MyEnum): Boolean = if (me is MyEnum.FIRST) true else false \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/inheritFromEnumEntry.fir.kt b/compiler/testData/diagnostics/tests/enum/inheritFromEnumEntry.fir.kt index 28ca2a055d6..0e35087a78f 100644 --- a/compiler/testData/diagnostics/tests/enum/inheritFromEnumEntry.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/inheritFromEnumEntry.fir.kt @@ -2,4 +2,4 @@ enum class E { ENTRY } -class A : E.ENTRY +class A : E.ENTRY diff --git a/compiler/testData/diagnostics/tests/enum/isEnumEntry.fir.kt b/compiler/testData/diagnostics/tests/enum/isEnumEntry.fir.kt index 5a42423771b..c7c7fc3e4cc 100644 --- a/compiler/testData/diagnostics/tests/enum/isEnumEntry.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/isEnumEntry.fir.kt @@ -3,4 +3,4 @@ enum class MyEnum { SECOND } -fun foo(me: MyEnum): Boolean = me is MyEnum.FIRST \ No newline at end of file +fun foo(me: MyEnum): Boolean = me is MyEnum.FIRST \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/evaluate/inlineClasses/constructorOfUnsignedType.fir.kt b/compiler/testData/diagnostics/tests/evaluate/inlineClasses/constructorOfUnsignedType.fir.kt index 3c899cd6749..e01ed0a6cd6 100644 --- a/compiler/testData/diagnostics/tests/evaluate/inlineClasses/constructorOfUnsignedType.fir.kt +++ b/compiler/testData/diagnostics/tests/evaluate/inlineClasses/constructorOfUnsignedType.fir.kt @@ -12,10 +12,10 @@ inline class ULong(private val l: Long) // FILE: test.kt -annotation class AnnoUB(val ub0: UByte, val ub1: UByte) -annotation class AnnoUS(val us0: UShort, val us1: UShort) -annotation class AnnoUI(val ui0: UInt, val ui1: UInt, val ui2: UInt, val ui3: UInt) -annotation class AnnoUL(val ul0: ULong, val ul1: ULong) +annotation class AnnoUB(val ub0: UByte, val ub1: UByte) +annotation class AnnoUS(val us0: UShort, val us1: UShort) +annotation class AnnoUI(val ui0: UInt, val ui1: UInt, val ui2: UInt, val ui3: UInt) +annotation class AnnoUL(val ul0: ULong, val ul1: ULong) const val ub0 = UByte(1) const val us0 = UShort(2) @@ -37,8 +37,8 @@ fun f2() {} @AnnoUL(ul0, ULong(5)) fun f3() {} -const val explicit: UInt = UInt(2) +const val explicit: UInt = UInt(2) -const val nullable: UInt? = UInt(3) +const val nullable: UInt? = UInt(3) -annotation class NullableAnno(val u: UInt?) \ No newline at end of file +annotation class NullableAnno(val u: UInt?) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.fir.kt index a99fcbd3c0f..78ce746b50e 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/WithGenericParameters.fir.kt @@ -4,10 +4,10 @@ interface A fun devNull(a: Any?){} -val generic_fun = fun(t: T): T = null!! -val extension_generic_fun = funT.(t: T): T = null!! +val generic_fun = fun(t: T): T = null!! +val extension_generic_fun = funT.(t: T): T = null!! -fun fun_with_where() = fun T.(t: T): T where T: A = null!! +fun fun_with_where() = fun T.(t: T): T where T: A = null!! fun outer() { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt index 4aa592018aa..97f237d0ca1 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambdaWithExpectedType.fir.kt @@ -6,7 +6,7 @@ fun test(bal: Array) { val b: () -> Int = { bar = 4 } - val c: () -> UNRESOLVED = { bal[2] = 3 } + val c: () -> UNRESOLVED = { bal[2] = 3 } val d: () -> Int = { bar += 4 } diff --git a/compiler/testData/diagnostics/tests/generics/RawTypeInIsExpression.fir.kt b/compiler/testData/diagnostics/tests/generics/RawTypeInIsExpression.fir.kt index 84b651c6558..e106601f1e6 100644 --- a/compiler/testData/diagnostics/tests/generics/RawTypeInIsExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/RawTypeInIsExpression.fir.kt @@ -1,7 +1,7 @@ package p public fun foo(a: Any) { - a is Map + a is Map a is Map a is Map a is Map<*, *> diff --git a/compiler/testData/diagnostics/tests/generics/RawTypeInIsPattern.fir.kt b/compiler/testData/diagnostics/tests/generics/RawTypeInIsPattern.fir.kt index d32724f21a9..f76110a228e 100644 --- a/compiler/testData/diagnostics/tests/generics/RawTypeInIsPattern.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/RawTypeInIsPattern.fir.kt @@ -1,6 +1,6 @@ -public fun foo(a: Any, b: Map) { +public fun foo(a: Any, b: Map) { when (a) { - is Map -> {} + is Map -> {} is Map -> {} is Map -> {} is Map<*, *> -> {} diff --git a/compiler/testData/diagnostics/tests/generics/capturedParameters/uncheckedCast.fir.kt b/compiler/testData/diagnostics/tests/generics/capturedParameters/uncheckedCast.fir.kt index d924703b4ef..28b3eda8b61 100644 --- a/compiler/testData/diagnostics/tests/generics/capturedParameters/uncheckedCast.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/capturedParameters/uncheckedCast.fir.kt @@ -18,11 +18,11 @@ fun foo(x: Any, y: Any) : Any { } // bare type - if (y is Outer.Inner) { + if (y is Outer.Inner) { return y } - y as Outer<*>.Inner + y as Outer<*>.Inner return C() } diff --git a/compiler/testData/diagnostics/tests/generics/finalUpperBoundWithoutOverride.fir.kt b/compiler/testData/diagnostics/tests/generics/finalUpperBoundWithoutOverride.fir.kt index 46fcf0deda7..f5f9d868b31 100644 --- a/compiler/testData/diagnostics/tests/generics/finalUpperBoundWithoutOverride.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/finalUpperBoundWithoutOverride.fir.kt @@ -51,19 +51,19 @@ interface MessageManager9 : Manager { fun execute4() {} } -object MessageManager10 : Message5() { +object MessageManager10 : Message5() { fun execute() {} } -class MessageManager11 : Message5>() { - fun Message5> execute() {} +class MessageManager11 : Message5>() { + fun Message5> execute() {} } -data class MessageManager12(val x: Int) : Message5() { +data class MessageManager12(val x: Int) : Message5() { fun execute() {} } -sealed class MessageManager13 : Message5() { +sealed class MessageManager13 : Message5() { fun execute() {} } diff --git a/compiler/testData/diagnostics/tests/generics/genericsInType.fir.kt b/compiler/testData/diagnostics/tests/generics/genericsInType.fir.kt index 3c1d913cfa8..c7e6f18acd4 100644 --- a/compiler/testData/diagnostics/tests/generics/genericsInType.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/genericsInType.fir.kt @@ -29,7 +29,7 @@ fun test() { a.Baz>() } -fun Foo> x() {} +fun Foo> x() {} fun Foo.Bar.ext() {} fun ex1(a: Foo.Bar): Foo.Bar { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_after.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_after.fir.kt index 04b6b1a6d9a..90bd9a47b54 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_after.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_after.fir.kt @@ -15,7 +15,7 @@ class A { // Does not work, could be Outer.Inner // TODO: Should work? - fun foo(x: Inner) { + fun foo(x: Inner) { // Inner() call use companion as implicit receiver val y: Outer.Inner = Inner() } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_before.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_before.fir.kt index ac09e49cde3..baa47a6d32c 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_before.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromCompanionObject_before.fir.kt @@ -15,7 +15,7 @@ class A { // Does not work, could be Outer.Inner // TODO: Should work? - fun foo(x: Inner) { + fun foo(x: Inner) { // Inner() call use companion as implicit receiver val y: Outer.Inner = Inner() } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt index 403fff39cdb..f0bc990e2d0 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt @@ -7,14 +7,14 @@ open class Outer { class Derived : Outer() { fun foo(): Inner = null!! - fun baz(): Alias = null!! + fun baz(): Alias = null!! } class A : Outer() { class B : Outer() { fun bar(): Inner = null!! - fun x(): Alias = null!! + fun x(): Alias = null!! } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt index 24288b90fe2..91b3301689c 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt @@ -10,12 +10,12 @@ private fun foobar() = { fun a() = A() } - typealias LocalAlias = A + typealias LocalAlias = A } class Derived : LocalOuter() { fun foo(): LocalInner = null!! - fun bar(): LocalAlias = null!! + fun bar(): LocalAlias = null!! } Derived() @@ -27,12 +27,12 @@ private fun noParameters() = { fun a() = A() } - typealias LocalAlias2 = A + typealias LocalAlias2 = A } class Derived2 : LocalOuter2() { fun foo(): LocalInner2 = null!! - fun bar(): LocalAlias2 = null!! + fun bar(): LocalAlias2 = null!! } Derived2() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt index 2c9678e9b4d..1c3eef0747c 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt @@ -12,12 +12,12 @@ class Outer { fun a() = A() } - typealias LocalAlias = A + typealias LocalAlias = A } class Derived : LocalOuter() { fun foo(): LocalInner = null!! - fun bar(): LocalAlias = null!! + fun bar(): LocalAlias = null!! } Derived() @@ -29,12 +29,12 @@ class Outer { fun a() = A() } - typealias LocalAlias2 = A + typealias LocalAlias2 = A } class Derived2 : LocalOuter2() { fun foo(): LocalInner2 = null!! - fun bar(): LocalAlias2 = null!! + fun bar(): LocalAlias2 = null!! } Derived2() } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt index cd1d366be6a..619348762a3 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt @@ -10,7 +10,7 @@ open class BaseDerived2 : BaseDerived1() class Derived : BaseDerived2() { fun foo(): Inner = null!! - fun baz(): Alias = null!! + fun baz(): Alias = null!! } fun foo() { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.fir.kt index 277b1590282..5246f574368 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/importedInner.fir.kt @@ -17,4 +17,4 @@ class Outer { class E -fun bar(x: Inner) {} +fun bar(x: Inner) {} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.fir.kt index 42bb8ff7e83..a26cddf1a78 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/outerArgumentsRequired.fir.kt @@ -15,9 +15,9 @@ class A { val y: B.C? = null val z: B.D? = null - val c: C? = null - val d: D? = null + val c: C? = null + val d: D? = null - val innerMost: Innermost? = null + val innerMost: Innermost? = null } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.fir.kt index d9151f7d797..e365762a123 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedOuter.fir.kt @@ -4,7 +4,7 @@ class Outer { inner class Inner - fun foo(x: Outer.Inner, y: Outer.Inner, z: Inner) { + fun foo(x: Outer.Inner, y: Outer.Inner, z: Inner) { var inner = Inner() x.checkType { _() } x.checkType { _.Inner>() } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.fir.kt index 2e670e369a4..6e0cefa3c49 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/qualifiedTypesResolution.fir.kt @@ -38,11 +38,11 @@ fun ok4(): Outer.Obj.Nested2.Inner5 = null!! fun ok5(): test.Outer.Obj.Nested2.Inner5 = null!! // All arguments are resolved -fun errorTypeWithArguments(): Q.W.R.M = null!! +fun errorTypeWithArguments(): Q.W.R.M = null!! fun error1(): Outer.Inner.Inner3 = null!! fun error2(): Outer.Inner.Inner2 = null!! -fun error3(): Outer.Inner.Inner3 = null!! +fun error3(): Outer.Inner.Inner3 = null!! fun error4(): Outer.Nested.Inner4 = null!! fun error5(): Outer.Obj.Nested2.Inner5 = null!! diff --git a/compiler/testData/diagnostics/tests/generics/unresolvedClassifierInWhere.fir.kt b/compiler/testData/diagnostics/tests/generics/unresolvedClassifierInWhere.fir.kt index dff5d7e5efa..4a3180105e2 100644 --- a/compiler/testData/diagnostics/tests/generics/unresolvedClassifierInWhere.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/unresolvedClassifierInWhere.fir.kt @@ -1,14 +1,14 @@ -interface I0Unresolved0> -interface I1 where T : Unresolved1 -interface I2Unresolved2> where T : Unresolved3 +interface I0Unresolved0> +interface I1 where T : Unresolved1 +interface I2Unresolved2> where T : Unresolved3 -fun Unresolved4> foo0() {} -fun foo1() where E : Unresolved5 {} -fun Unresolved6> foo2() where E : Unresolved7 {} +fun Unresolved4> foo0() {} +fun foo1() where E : Unresolved5 {} +fun Unresolved6> foo2() where E : Unresolved7 {} -val Unresolved7> E.p1: Int +val Unresolved7> E.p1: Int get() = 1 -val E.p2: Int where E : Unresolved8 +val E.p2: Int where E : Unresolved8 get() = 1 -val Unresolved9> E.p3: Int where E : Unresolved10 +val Unresolved9> E.p3: Int where E : Unresolved10 get() = 1 diff --git a/compiler/testData/diagnostics/tests/imports/ExplicitPackageImportsAmbiguity.fir.kt b/compiler/testData/diagnostics/tests/imports/ExplicitPackageImportsAmbiguity.fir.kt index 3681822157e..2507357e92f 100644 --- a/compiler/testData/diagnostics/tests/imports/ExplicitPackageImportsAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/ExplicitPackageImportsAmbiguity.fir.kt @@ -14,4 +14,4 @@ package c import a.x import b.x -class Y : x.X \ No newline at end of file +class Y : x.X \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.fir.kt b/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.fir.kt deleted file mode 100644 index 4567a1b7efe..00000000000 --- a/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: propertyClassFileDependencyRecursion.kt -package test - -import other.prop - -// Note: "prop" is expected to be unresolved and replaced to Any -class PropType: prop - -// Note: this time "prop" should be resolved and type should be inferred for "checkTypeProp" -val checkTypeProp = prop - -// FILE: propertyClassFileDependencyRecursionOther.kt -package other - -import test.PropType - -val prop: PropType? = null diff --git a/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.kt b/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.kt index c997c1be1cb..9b55095bfbb 100644 --- a/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.kt +++ b/compiler/testData/diagnostics/tests/imports/propertyClassFileDependencyRecursion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: propertyClassFileDependencyRecursion.kt package test diff --git a/compiler/testData/diagnostics/tests/incompleteCode/SupertypeOfErrorType.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/SupertypeOfErrorType.fir.kt index 7a65c973dea..e97bd30e331 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/SupertypeOfErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/SupertypeOfErrorType.fir.kt @@ -15,7 +15,7 @@ fun foo() { } } -fun bar(i: Int, a: U) { +fun bar(i: Int, a: U) { val r = if (true) i else a val b: Any = r } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt index f39e79c2d34..9abe07a6095 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/controlStructuresErrors.fir.kt @@ -19,7 +19,7 @@ fun test1() { } } -fun test2(l: List) { +fun test2(l: List) { l.map { it!! } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/typeReferenceError.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/typeReferenceError.fir.kt index 23e0aa59a77..2005bb1c589 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/typeReferenceError.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/typeReferenceError.fir.kt @@ -1,3 +1,3 @@ package typeReferenceError -class Pair<:(val c: fun main() \ No newline at end of file +class Pair<:(val c: fun main() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfErrorTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfErrorTypes.fir.kt index 6c0f29c534a..38f020fede2 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfErrorTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSuperTypeOfErrorTypes.fir.kt @@ -9,13 +9,13 @@ fun materialize() = null as T fun test() { consume( - materialize<Foo>>(), - materialize<Foo>>() + materialize<Foo>>(), + materialize<Foo>>() ) consume( - materialize<Foo>>(), - materialize<Foo>() + materialize<Foo>>(), + materialize<Foo>() ) } diff --git a/compiler/testData/diagnostics/tests/inference/constraints/errorUpperBoundConstraint.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/errorUpperBoundConstraint.fir.kt index 06dfe08ed67..108efe36889 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/errorUpperBoundConstraint.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/errorUpperBoundConstraint.fir.kt @@ -19,7 +19,7 @@ public class Foo { // FILE: test.kt -fun test(e: ErrorType) { +fun test(e: ErrorType) { Foo.foo { Sam.Result.create(e) } diff --git a/compiler/testData/diagnostics/tests/inference/kt11963.fir.kt b/compiler/testData/diagnostics/tests/inference/kt11963.fir.kt index fa555dbf04d..5bdf68a84a7 100644 --- a/compiler/testData/diagnostics/tests/inference/kt11963.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/kt11963.fir.kt @@ -1 +1 @@ -val KClass.something> abc \ No newline at end of file +val KClass.something> abc \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.fir.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.fir.kt index ce72acfd102..e70cdb0a116 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/cannotInferParameterTypeWithInference.fir.kt @@ -10,7 +10,7 @@ fun test1() { } } -fun bar(f: (A)->Unit) {} +fun bar(f: (A)->Unit) {} fun test2() { bar { a -> } // here we don't have 'cannot infer parameter type' error diff --git a/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.fir.kt b/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.fir.kt index cb24e778266..b55972205cc 100644 --- a/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/accessingToJavaNestedClass.fir.kt @@ -47,18 +47,18 @@ fun test() { val ic: I.NC = I.NC() val ii: I.NI? = null - val bc: B.NC = B.NC() - val bic: B.IC = B().IC() - val bi: B.NI? = null + val bc: B.NC = B.NC() + val bic: B.IC = B().IC() + val bi: B.NI? = null - val cc: C.NC = C.NC() - val ci: C.NI? = null + val cc: C.NC = C.NC() + val ci: C.NI? = null - val dc: D.NC = D.NC() - val dic: D.IC = D().IC() - val di: D.NI? = null + val dc: D.NC = D.NC() + val dic: D.IC = D().IC() + val di: D.NI? = null - val kc: K.NC = K.NC() - val kic: K.IC = K().IC() - val ki: K.NI? = null + val kc: K.NC = K.NC() + val kic: K.IC = K().IC() + val ki: K.NI? = null } diff --git a/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.fir.kt b/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.fir.kt index a1fdb2b5baf..36724bd6e63 100644 --- a/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/accessingToKotlinNestedClass.fir.kt @@ -31,14 +31,14 @@ fun test() { val ic: I.NC = I.NC() val ii: I.NI? = null - val bc: B.NC = B.NC() - val bic: B.IC = B().IC() - val bi: B.NI? = null + val bc: B.NC = B.NC() + val bic: B.IC = B().IC() + val bi: B.NI? = null - val cc: C.NC = C.NC() - val ci: C.NI? = null + val cc: C.NC = C.NC() + val ci: C.NI? = null - val dc: D.NC = D.NC() - val dic: D.IC = D().IC() - val di: D.NI? = null + val dc: D.NC = D.NC() + val dic: D.IC = D().IC() + val di: D.NI? = null } diff --git a/compiler/testData/diagnostics/tests/inner/deepInnerClass.fir.kt b/compiler/testData/diagnostics/tests/inner/deepInnerClass.fir.kt index f53f5e9484c..35335a385c6 100644 --- a/compiler/testData/diagnostics/tests/inner/deepInnerClass.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/deepInnerClass.fir.kt @@ -3,11 +3,11 @@ interface P class A { class B { fun test() { - class C() : P { - companion object : P { + class C() : P { + companion object : P { } - inner class D : P + inner class D : P } } } diff --git a/compiler/testData/diagnostics/tests/j+k/accessClassObjectFromJava.fir.kt b/compiler/testData/diagnostics/tests/j+k/accessClassObjectFromJava.fir.kt index 345b1dfa9a1..bfc55e0e171 100644 --- a/compiler/testData/diagnostics/tests/j+k/accessClassObjectFromJava.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/accessClassObjectFromJava.fir.kt @@ -2,7 +2,7 @@ class Foo { companion object { val bar = 1 - fun test(a: Foo.`object`) { + fun test(a: Foo.`object`) { } diff --git a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.fir.kt b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.fir.kt index c8617fa7164..32ff714f8dd 100644 --- a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.fir.kt +++ b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.fir.kt @@ -1,4 +1,4 @@ -@myAnnotation public +@myAnnotation public package illegal_modifiers abstract class A() { diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.fir.kt index 31e558b93c2..830ca995ebf 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/genericArgumentNumberMismatch.fir.kt @@ -26,5 +26,5 @@ import p.* fun test() { foo(M1().a) - foo(1) // error type on the declaration site + foo(1) // error type on the declaration site } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/annotationConstructor.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/annotationConstructor.fir.kt index 8b877fd0ba9..f4f4711dc09 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/annotationConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/annotationConstructor.fir.kt @@ -8,6 +8,6 @@ open class Base { class Derived : Base() { - @Foo + @Foo fun foo() = 42 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectNew.fir.kt index 5aecac4f342..d3a8efbae94 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectNew.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectNew.fir.kt @@ -72,28 +72,28 @@ class C : O.B() { val n: FromCompanionC? = null // INVISIBLE: direct superclasses themselves. - val a: A? = null - val b: B? = null + val a: A? = null + val b: B? = null // DEPRECATED: Classifiers from companions of direct superclasses - val e: FromCompanionA? = null - val f: FromCompanionB? = null + val e: FromCompanionA? = null + val f: FromCompanionB? = null // INVISIBLE: "cousin" supertypes themselves - val g: Alpha? = null - val h: Beta? = null - val i: Gamma? = null + val g: Alpha? = null + val h: Beta? = null + val i: Gamma? = null // DEPRECATED: classifiers from "cousin" superclasses - val k: FromAlpha? = null - val l: FromBeta? = null - val m: FromGamma? = null + val k: FromAlpha? = null + val l: FromBeta? = null + val m: FromGamma? = null // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o: FromCompanionAlpha? = null - val p: FromCompanionBeta? = null - val q: FromCompanionGamma? = null + val o: FromCompanionAlpha? = null + val p: FromCompanionBeta? = null + val q: FromCompanionGamma? = null // DEPRECATED: Classifiers from supertypes of our own companion - val r: FromDelta? = null + val r: FromDelta? = null } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectOld.fir.kt index f69f0f0d677..945d7aaaf0c 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectOld.fir.kt @@ -71,28 +71,28 @@ class C : O.B() { val n: FromCompanionC? = null // INVISIBLE: direct superclasses themselves. - val a: A? = null - val b: B? = null + val a: A? = null + val b: B? = null // DEPRECATED: Classifiers from companions of direct superclasses - val e: FromCompanionA? = null - val f: FromCompanionB? = null + val e: FromCompanionA? = null + val f: FromCompanionB? = null // INVISIBLE: "cousin" supertypes themselves - val g: Alpha? = null - val h: Beta? = null - val i: Gamma? = null + val g: Alpha? = null + val h: Beta? = null + val i: Gamma? = null // DEPRECATED: classifiers from "cousin" superclasses - val k: FromAlpha? = null - val l: FromBeta? = null - val m: FromGamma? = null + val k: FromAlpha? = null + val l: FromBeta? = null + val m: FromGamma? = null // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o: FromCompanionAlpha? = null - val p: FromCompanionBeta? = null - val q: FromCompanionGamma? = null + val o: FromCompanionAlpha? = null + val p: FromCompanionBeta? = null + val q: FromCompanionGamma? = null // DEPRECATED: Classifiers from supertypes of our own companion - val r: FromDelta? = null + val r: FromDelta? = null } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.fir.kt deleted file mode 100644 index dec2e99258d..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.fir.kt +++ /dev/null @@ -1,100 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// !DIAGNOSTICS: -UNUSED_VARIABLE - -// See KT-21515 for a open class diagram and details - -// Object is to prevent accidental short-name import -object O { - open class Alpha { - open class FromAlpha - - companion object { - open class FromCompanionAlpha - } - } - - open class Beta : Alpha() { - open class FromBeta - - companion object { - open class FromCompanionBeta - } - } - - - open class A { - open class FromA - - companion object : Beta() { - open class FromCompanionA - } - } - -////////////////////////// - - open class FarAway { - open class FromFarAway - - } - - open class Gamma { - open class FromGamma - companion object : FarAway() { - open class FromCompanionGamma - } - } - - open class B : A() { - open class FromB - - companion object : Gamma() { - open class FromCompanionB - } - } -} - -/////////////////////////////// - - -open class Delta { - open class FromDelta -} - -open class C : O.B() { - companion object : Delta() { - open class FromCompanionC - } - - // VISIBLE: Classifiers from direct superclasses - open class c : FromA() - open class d : FromB() - - // VISIBLE: Classifiers from our own companion - open class n : FromCompanionC() - - // INVISIBLE: direct superclasses themselves. - open class a : A() - open class b : B() - - // DEPRECATED: Classifiers from companions of direct superclasses - open class e : FromCompanionA() - open class f : FromCompanionB() - - // INVISIBLE: "cousin" supertypes themselves - open class g : Alpha() - open class h : Beta() - open class i : Gamma() - - // DEPRECATED: classifiers from "cousin" superclasses - open class k : FromAlpha() - open class l : FromBeta() - open class m : FromGamma() - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - open class o : FromCompanionAlpha() - open class p : FromCompanionBeta() - open class q : FromCompanionGamma() - - // DEPRECATED: Classifiers from supertypes of our own companion - open class r : FromDelta() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.kt index 273f7d2faf4..6c8f9457096 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedOld.fir.kt index 8a697de1e51..51bd88108d3 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedOld.fir.kt @@ -73,28 +73,28 @@ open class C : O.B() { open class n : FromCompanionC() // INVISIBLE: direct superclasses themselves. - open class a : A() - open class b : B() + open class a : A() + open class b : B() // DEPRECATED: Classifiers from companions of direct superclasses - open class e : FromCompanionA() - open class f : FromCompanionB() + open class e : FromCompanionA() + open class f : FromCompanionB() // INVISIBLE: "cousin" supertypes themselves - open class g : Alpha() - open class h : Beta() - open class i : Gamma() + open class g : Alpha() + open class h : Beta() + open class i : Gamma() // DEPRECATED: classifiers from "cousin" superclasses - open class k : FromAlpha() - open class l : FromBeta() - open class m : FromGamma() + open class k : FromAlpha() + open class l : FromBeta() + open class m : FromGamma() // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - open class o : FromCompanionAlpha() - open class p : FromCompanionBeta() - open class q : FromCompanionGamma() + open class o : FromCompanionAlpha() + open class p : FromCompanionBeta() + open class q : FromCompanionGamma() // DEPRECATED: Classifiers from supertypes of our own companion - open class r : FromDelta() + open class r : FromDelta() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt deleted file mode 100644 index 9429c8ec7eb..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.fir.kt +++ /dev/null @@ -1,48 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -// FILE: test/Java.java -package test; - -public class Java { - public static void method() { } - public static int property = 42; - public static class Classifier { } - public static void syntheticSam(Runnable r) { } - - public static int getStaticSyntheticProperty() { return 42; } - public static int setStaticSyntheticProperty(int x) { return 42; } - - public int getInstanceSyntheticProperty() { return 42; } - public int setInstanceSyntheticProperty(int x) { return 42; } -} - -// FILE: Kotlin.kt -package test - -open class Base { - companion object : Java() { - - } -} - -class Derived : Base() { - fun test(javaStaticInTypePosition: Classifier) { - method() - property - Classifier() - syntheticSam { } - - // Instance members shouldn't be affected, but we check them, just in case - val y = instanceSyntheticProperty - instanceSyntheticProperty = 43 - - // Note that statics actually aren't converted into synthetic property in Kotlin - val x = syntheticProperty - syntheticProperty = 42 - } - - class JavaStaticInSupertypeList : Classifier() { - - } -} diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.kt index d1602310a97..e42508dcb39 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt index e1473cc0578..972326d10ee 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaOld.fir.kt @@ -27,7 +27,7 @@ open class Base { } class Derived : Base() { - fun test(javaStaticInTypePosition: Classifier) { + fun test(javaStaticInTypePosition: Classifier) { method() property Classifier() @@ -42,7 +42,7 @@ class Derived : Base() { syntheticProperty = 42 } - class JavaStaticInSupertypeList : Classifier() { + class JavaStaticInSupertypeList : Classifier() { } } diff --git a/compiler/testData/diagnostics/tests/override/MissingDelegate.fir.kt b/compiler/testData/diagnostics/tests/override/MissingDelegate.fir.kt index 291c6dfff84..54a5e46ca93 100644 --- a/compiler/testData/diagnostics/tests/override/MissingDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/override/MissingDelegate.fir.kt @@ -1,3 +1,3 @@ -class C : Base1 by Base2(1) { +class C : Base1 by Base2(1) { fun test() { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/OverrideWithErrors.fir.kt b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.fir.kt deleted file mode 100644 index e7f361f10c8..00000000000 --- a/compiler/testData/diagnostics/tests/override/OverrideWithErrors.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -package test - -open class A { - open fun foo(a: E) {} -} - -class B : A() { - override fun foo(a: E) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt index 10da9b959bf..f2a9256ac45 100644 --- a/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt +++ b/compiler/testData/diagnostics/tests/override/OverrideWithErrors.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test open class A { diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.fir.kt index 76fa1a05831..2d0f2a637ed 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.fir.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/TypeWithError.fir.kt @@ -15,18 +15,18 @@ fun test1(a: A.B.): A.B. { val aa: A.B. = null!! } -fun test2(a: A.e.C): A.e.C { - val aa: A.e.C = null!! +fun test2(a: A.e.C): A.e.C { + val aa: A.e.C = null!! } -fun test3(a: a.A.C): a.A.C { - val aa: a.A.C = null!! +fun test3(a: a.A.C): a.A.C { + val aa: a.A.C = null!! } -fun test4(a: A.B.ee): A.B.ee { - val aa: A.B.ee = null!! +fun test4(a: A.B.ee): A.B.ee { + val aa: A.B.ee = null!! } -fun test5(a: A.ee): A.ee { - val aa: A.ee = null!! +fun test5(a: A.ee): A.ee { + val aa: A.ee = null!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt index 5824c1a9911..10292f79764 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt @@ -3,5 +3,5 @@ interface G { val bar: Int } -fun G.foo() {} -val G.bar: Int get() = 42 \ No newline at end of file +fun G.foo() {} +val G.bar: Int get() = 42 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/ea65509.fir.kt b/compiler/testData/diagnostics/tests/regressions/ea65509.fir.kt deleted file mode 100644 index fe1ec979569..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/ea65509.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !DIAGNOSTICS: -FUNCTION_DECLARATION_WITH_NO_NAME -class ClassB() { - private inner class ClassC: super.@ClassA() { - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/ea65509.kt b/compiler/testData/diagnostics/tests/regressions/ea65509.kt index 8cc546cc126..88f279d3cc9 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea65509.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea65509.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -FUNCTION_DECLARATION_WITH_NO_NAME class ClassB() { private inner class ClassC: super.@ClassA() { diff --git a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.fir.kt b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.fir.kt index bc6664a8ec9..83a5dfd4d0b 100644 --- a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundLocal.fir.kt @@ -1,5 +1,5 @@ // !WITH_NEW_INFERENCE fun bar() { - fun T?> foo() {} + fun T?> foo() {} foo() } diff --git a/compiler/testData/diagnostics/tests/regressions/kt402.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt402.fir.kt index 8c4f0e9fe3d..85d7041cad0 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt402.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt402.fir.kt @@ -1,7 +1,7 @@ package kt402 fun getTypeChecker() : (Any)->Boolean { - { a : Any -> a is T } // reports unsupported + { a : Any -> a is T } // reports unsupported } fun f() : (Any) -> Boolean { return { a : Any -> a is String } diff --git a/compiler/testData/diagnostics/tests/regressions/kt6508.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt6508.fir.kt deleted file mode 100644 index f04e1d3dab8..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt6508.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION - -// FILE: foo/View.java - -package foo; - -public class View {} - -// FILE: foo/TextView.java - -package foo; - -public class TextView extends View {} - -// FILE: k.kt - -import foo.View -//import foo.TextView - -fun String.gah(view:View ?) { - if (view is TextView) - view - else TextView() as foo.TextView -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt6508.kt b/compiler/testData/diagnostics/tests/regressions/kt6508.kt index c01396408be..8ac37083d04 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt6508.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt6508.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION // FILE: foo/View.java diff --git a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt index 4010ec60f97..b6f853123b3 100644 --- a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt @@ -1,3 +1,3 @@ -class Class1Class2>> +class Class1Class2>> -class Class2Class1>> \ No newline at end of file +class Class2Class1>> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.fir.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.fir.kt deleted file mode 100644 index ea6f18ea862..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class ANested, F: Inner, G: Interface> { - - class Nested - - inner class Inner - - interface Interface -} - -class B where T : Nested, F: Inner, G: Interface { - - class Nested - - inner class Inner - - interface Interface -} - diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.kt index cc49f8328c2..879134d8e94 100644 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.kt +++ b/compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class ANested, F: Inner, G: Interface> { diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/classParents.fir.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/classParents.fir.kt index 62efb4e9665..e7d485328fc 100644 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/classParents.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/classHeader/classParents.fir.kt @@ -2,7 +2,7 @@ interface I -class A(impl: Interface) : Nested(), Interface by impl, Inner, I { +class A(impl: Interface) : Nested(), Interface by impl, Inner, I { class Nested diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/objectParents.fir.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/objectParents.fir.kt index 5542db1e57c..c86b87fca24 100644 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/objectParents.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/classHeader/objectParents.fir.kt @@ -3,7 +3,7 @@ interface I val aImpl: A.Interface get() = null!! -object A : Nested(), Interface by aImpl, I { +object A : Nested(), Interface by aImpl, I { class Nested diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt deleted file mode 100644 index ff7ad53b3a3..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// FILE: A.java -public interface A { - public class A_ {} -} - -// FILE: 1.kt -interface B { - class B_ -} - -class X: A { - val a: A_ = A_() - val b: A.A_ = A.A_() - - companion object { - val a: A_ = A_() - } -} - -class Y: B { - val a: B_ = B_() - val b: B.B_ = B.B_() - - companion object { - val b: B_ = B_() - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.kt index 8ceb7fe130c..d90cfcbc516 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedClassesFromInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A { public class A_ {} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt index 470190514c4..751f357054c 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedCompanionClass.fir.kt @@ -7,14 +7,14 @@ open class A { } class C: A() { - val b: B = null!! + val b: B = null!! init { B() } object O { - val b: B = null!! + val b: B = null!! init { B() @@ -22,7 +22,7 @@ class C: A() { } class K { - val b: B = null!! + val b: B = null!! init { B() @@ -30,7 +30,7 @@ class C: A() { } inner class I { - val b: B = null!! + val b: B = null!! init { B() diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt index 82214b4ced2..9902bf9b2ca 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/nestedFromJava.fir.kt @@ -23,7 +23,7 @@ public class C extends B implements A { // FILE: 1.kt class X: A { - val a_s: A_S = null!! + val a_s: A_S = null!! init { A_S() @@ -32,7 +32,7 @@ class X: A { } object xD { - val a_: A_S = null!! + val a_: A_S = null!! init { A_S() @@ -66,7 +66,7 @@ class Y: B() { } class Z: C() { - val a_s: A_S = null!! + val a_s: A_S = null!! val b_: B_ = null!! val b_s: B_S = null!! @@ -77,7 +77,7 @@ class Z: C() { } object X { - val a_s: A_S = null!! + val a_s: A_S = null!! val b_: B_ = null!! val b_s: B_S = null!! diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt index cec28c570e2..125b8a7661f 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_after.fir.kt @@ -30,7 +30,7 @@ open class A : J() { foo() bar() val a: Int = baz() - val b: T = baz() + val b: T = baz() } } @@ -39,14 +39,14 @@ open class A : J() { foo() bar() val a: Int = baz() - val b: T = baz() + val b: T = baz() } fun test() { foo() bar() val a: Int = baz() - val b: T = baz() + val b: T = baz() } fun bar() {} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt index 5d06c7093b8..89226a4a963 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/companionObject/inheritFromContainingClass_before.fir.kt @@ -30,7 +30,7 @@ open class A : J() { foo() bar() val a: Int = baz() - val b: T = baz() + val b: T = baz() } } @@ -39,14 +39,14 @@ open class A : J() { foo() bar() val a: Int = baz() - val b: T = baz() + val b: T = baz() } fun test() { foo() bar() val a: Int = baz() - val b: T = baz() + val b: T = baz() } fun bar() {} diff --git a/compiler/testData/diagnostics/tests/scopes/kt1080.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1080.fir.kt index 9f25324d8df..cb7b10f1d26 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1080.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1080.fir.kt @@ -10,7 +10,7 @@ import d import d.Test import b.d -class Some: Test() +class Some: Test() //FILE:b.kt diff --git a/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt index a4895cf04bf..9e78b68bbf3 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt900.fir.kt @@ -4,7 +4,7 @@ package a fun foo() { - val b : B = B() //only B() is unresolved, but in ": B" and "B.foo()" B should also be unresolved + val b : B = B() //only B() is unresolved, but in ": B" and "B.foo()" B should also be unresolved B.foo() P.foo() diff --git a/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyAfter.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyAfter.fir.kt index 1cb3d4a5a2a..13f0a640d8d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyAfter.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyAfter.fir.kt @@ -2,7 +2,7 @@ class AlternatingDelegate { var counter: Int = 0 - operator fun getValue(thisRef: Any?, property: KProperty<*>): Any? = + operator fun getValue(thisRef: Any?, property: KProperty<*>): Any? = if (counter++ % 2 == 0) 42 else "" } diff --git a/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyBefore.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyBefore.fir.kt index 30b73bd37e7..8777e5aea0a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyBefore.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/localDelegatedPropertyBefore.fir.kt @@ -2,7 +2,7 @@ class AlternatingDelegate { var counter: Int = 0 - operator fun getValue(thisRef: Any?, property: KProperty<*>): Any? = + operator fun getValue(thisRef: Any?, property: KProperty<*>): Any? = if (counter++ % 2 == 0) 42 else "" } diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.fir.kt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.fir.kt index 0093cea4f43..6516feb3311 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithErrorTypes.fir.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS -UNUSED_PARAMETER -fun f1(l: List1): T {throw Exception()} // ERROR type here -fun f1(l: List2): T {throw Exception()} // ERROR type here +fun f1(l: List1): T {throw Exception()} // ERROR type here +fun f1(l: List2): T {throw Exception()} // ERROR type here fun f1(c: Collection): T{throw Exception()} fun test(l: List) { diff --git a/compiler/testData/diagnostics/tests/subtyping/kt2744.fir.kt b/compiler/testData/diagnostics/tests/subtyping/kt2744.fir.kt index 931df767968..034d6a928af 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt2744.fir.kt +++ b/compiler/testData/diagnostics/tests/subtyping/kt2744.fir.kt @@ -1,3 +1,3 @@ -class X : S +class X : S fun f(l: List) {} diff --git a/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt b/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt index 23e3d4ddc84..aab7fe69d26 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt +++ b/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt @@ -1,6 +1,6 @@ //KT-304: Resolve supertype reference to class anyway -open class Foo() : Bar() { +open class Foo() : Bar() { } open class Bar() { diff --git a/compiler/testData/diagnostics/tests/subtyping/unresolvedSupertype.fir.kt b/compiler/testData/diagnostics/tests/subtyping/unresolvedSupertype.fir.kt index 747200b11b1..5a0df7b6bd0 100644 --- a/compiler/testData/diagnostics/tests/subtyping/unresolvedSupertype.fir.kt +++ b/compiler/testData/diagnostics/tests/subtyping/unresolvedSupertype.fir.kt @@ -1,7 +1,7 @@ -interface A1 : B +interface A1 : B -interface A2 : B() +interface A2 : B() -class A3 : B, B +class A3 : B, B -enum class A4 : B +enum class A4 : B diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/Super.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/Super.fir.kt index 3c2c730f68a..a391a2d06ac 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/Super.fir.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/Super.fir.kt @@ -56,7 +56,7 @@ class CG : G { } // The case when no supertype is resolved -class ERROR() : UR { +class ERROR() : UR { fun test() { super.foo() diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithUnresolvedBase.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithUnresolvedBase.fir.kt index a14f01a25bd..616f92cc092 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithUnresolvedBase.fir.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithUnresolvedBase.fir.kt @@ -21,7 +21,7 @@ interface Interface { get() = 222 } -class ClassDerivedFromUnresolved : Base(), Interface, Unresolved { +class ClassDerivedFromUnresolved : Base(), Interface, Unresolved { override fun foo() {} override fun bar() {} diff --git a/compiler/testData/diagnostics/tests/typealias/capturingTypeParametersFromOuterClass.fir.kt b/compiler/testData/diagnostics/tests/typealias/capturingTypeParametersFromOuterClass.fir.kt index 5063beb7941..7f0daa5bcc7 100644 --- a/compiler/testData/diagnostics/tests/typealias/capturingTypeParametersFromOuterClass.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/capturingTypeParametersFromOuterClass.fir.kt @@ -17,13 +17,13 @@ class Outer { fun foo() { class Local { - typealias LTF = List - typealias LTL = List + typealias LTF = List + typealias LTL = List } fun localfun() = object { - typealias LTF = List - typealias LTLF = List + typealias LTF = List + typealias LTLF = List } } diff --git a/compiler/testData/diagnostics/tests/typealias/exposedExpandedType.fir.kt b/compiler/testData/diagnostics/tests/typealias/exposedExpandedType.fir.kt index 752c8da45eb..ce21d1ece59 100644 --- a/compiler/testData/diagnostics/tests/typealias/exposedExpandedType.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/exposedExpandedType.fir.kt @@ -19,7 +19,7 @@ class Outer { internal typealias TestProtected3 = Protected private typealias TestProtected4 = Protected typealias TestProtected5 = L - typealias TestProtected6 = L<TestProtected1> + typealias TestProtected6 = L<TestProtected1> typealias TestInternal1 = Internal protected typealias TestInternal2 = Internal diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt index 9264d084b56..7469809ca78 100644 --- a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt @@ -16,6 +16,6 @@ class Derived : Base() { val x1: InnerCell = InnerCell(42) val x2: Base.InnerCell = InnerCell(42) - val test1: CT = Cell(42) + val test1: CT = Cell(42) val test2: Base.CT = Cell(42) } diff --git a/compiler/testData/diagnostics/tests/typealias/inhreritedTypeAliasQualifiedByDerivedClass.fir.kt b/compiler/testData/diagnostics/tests/typealias/inhreritedTypeAliasQualifiedByDerivedClass.fir.kt index 467aa8ce24f..e5189925823 100644 --- a/compiler/testData/diagnostics/tests/typealias/inhreritedTypeAliasQualifiedByDerivedClass.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/inhreritedTypeAliasQualifiedByDerivedClass.fir.kt @@ -6,8 +6,8 @@ open class Base { class Derived : Base() -fun test(x: Derived.Nested) = x +fun test(x: Derived.Nested) = x -fun Base.testWithImplicitReceiver(x: Nested) { - val y: Nested = x +fun Base.testWithImplicitReceiver(x: Nested) { + val y: Nested = x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType.fir.kt b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType.fir.kt index 7e36f3a46b5..04837f435e2 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType.fir.kt @@ -11,12 +11,12 @@ class Outer { typealias InnerAlias = Inner typealias GenericInnerAlias = GenericInner - fun test1(x: NestedAlias) = x - fun test2(x: GenericNestedAlias) = x - fun test3(x: GenericNestedAlias) = x - fun test4(x: InnerAlias) = x - fun test5(x: GenericInnerAlias) = x - fun test6(x: GenericInnerAlias) = x + fun test1(x: NestedAlias) = x + fun test2(x: GenericNestedAlias) = x + fun test3(x: GenericNestedAlias) = x + fun test4(x: InnerAlias) = x + fun test5(x: GenericInnerAlias) = x + fun test6(x: GenericInnerAlias) = x } fun test1(x: Outer.NestedAlias) = x fun test2(x: Outer.NestedAlias) = x diff --git a/compiler/testData/diagnostics/tests/typealias/javaStaticMembersViaTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/javaStaticMembersViaTypeAlias.fir.kt index 764b7764724..06f1590bb1a 100644 --- a/compiler/testData/diagnostics/tests/typealias/javaStaticMembersViaTypeAlias.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/javaStaticMembersViaTypeAlias.fir.kt @@ -33,14 +33,14 @@ val seeAlsoDerivedFoo: String = JDerived.foo() // Referencing nested classes via type alias should be prohibited // (in type position and in expression position) -val testNested1: JT.Nested = JT.Nested() -val testNested2: KT.Nested = KT.Nested() -val testNested3: IT.Nested = IT.Nested() -val testInner1: JT.Inner = JT.Inner() -val testInner2: KT.Inner = KT.Inner() -fun testNestedAsTypeArgument1(x: List) {} -fun testNestedAsTypeArgument2(x: List) {} -fun testNestedAsTypeArgument3(x: List) {} -fun testInnerAsTypeArgument1(x: List) {} -fun testInnerAsTypeArgument2(x: List) {} +val testNested1: JT.Nested = JT.Nested() +val testNested2: KT.Nested = KT.Nested() +val testNested3: IT.Nested = IT.Nested() +val testInner1: JT.Inner = JT.Inner() +val testInner2: KT.Inner = KT.Inner() +fun testNestedAsTypeArgument1(x: List) {} +fun testNestedAsTypeArgument2(x: List) {} +fun testNestedAsTypeArgument3(x: List) {} +fun testInnerAsTypeArgument1(x: List) {} +fun testInnerAsTypeArgument2(x: List) {} diff --git a/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt index 639017392be..31df5e25d34 100644 --- a/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt @@ -6,12 +6,12 @@ fun emptyList(): List = null!! fun foo() { typealias LT = List - val a: LT = emptyList() + val a: LT = emptyList() - fun localFun(): LT { + fun localFun(): LT { typealias LLT = List - val b: LLT = a + val b: LLT = a return b } diff --git a/compiler/testData/diagnostics/tests/typealias/localTypeAliasConstructor.fir.kt b/compiler/testData/diagnostics/tests/typealias/localTypeAliasConstructor.fir.kt index 95975dfd7ae..38f13e74a8c 100644 --- a/compiler/testData/diagnostics/tests/typealias/localTypeAliasConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/localTypeAliasConstructor.fir.kt @@ -4,8 +4,8 @@ class Cell(val x: TC) fun id(x: T): T { typealias C = Cell - class Local(val cell: C) + class Local(val cell: C) val cx = C(x) - val c: C = Local(cx).cell + val c: C = Local(cx).cell return c.x } diff --git a/compiler/testData/diagnostics/tests/typealias/localTypeAliasRecursive.fir.kt b/compiler/testData/diagnostics/tests/typealias/localTypeAliasRecursive.fir.kt index c7425ad95aa..52a4006e8cf 100644 --- a/compiler/testData/diagnostics/tests/typealias/localTypeAliasRecursive.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/localTypeAliasRecursive.fir.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY fun outer() { - typealias Test1 = Test1 - typealias Test2 = List - typealias Test3 = List> + typealias Test1 = Test1 + typealias Test2 = List + typealias Test3 = List> } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/nested.fir.kt b/compiler/testData/diagnostics/tests/typealias/nested.fir.kt index e4fbb6a3a32..41afad62d21 100644 --- a/compiler/testData/diagnostics/tests/typealias/nested.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/nested.fir.kt @@ -6,8 +6,8 @@ class C { typealias P2 = Pair fun p() = P2(1, 1) - fun first(p: P2) = p.x1 - fun second(p: P2) = p.x2 + fun first(p: P2) = p.x1 + fun second(p: P2) = p.x2 } val p1 = Pair(1, 1) diff --git a/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.fir.kt b/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.fir.kt index 70fcde4afc2..24b31359ab4 100644 --- a/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.fir.kt @@ -6,11 +6,11 @@ class C { typealias P2 = Pair typealias PT2 = Pair - fun first(p: P2) = p.x1 - fun second(p: P2) = p.x2 + fun first(p: P2) = p.x1 + fun second(p: P2) = p.x2 - fun first2(p: PT2) = p.x1 - fun second2(p: PT2) = p.x2 + fun first2(p: PT2) = p.x1 + fun second2(p: PT2) = p.x2 } val p1 = Pair(1, 1) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasAsBareType.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasAsBareType.fir.kt index 086b5bc7967..5c58097d79b 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasAsBareType.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasAsBareType.fir.kt @@ -31,5 +31,5 @@ fun testLocal(x: Any) { class C typealias CA = C if (x is C) {} - if (x is CA) {} + if (x is CA) {} } diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt index 685dfd227f7..bff59ebac46 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt @@ -38,13 +38,13 @@ enum class EnumSample { fun foo( a0: test.ClassSample.Nested, - a1: test.ClassAlias.Nested, + a1: test.ClassAlias.Nested, b0: test.ObjectSample.Nested, - b1: test.ObjectAlias.Nested, + b1: test.ObjectAlias.Nested, c0: test.EnumSample.Nested, - c1: test.EnumAlias.Nested + c1: test.EnumAlias.Nested ) { test.ClassSample::Nested test.ClassAlias::Nested diff --git a/compiler/testData/diagnostics/tests/variance/InPosition.fir.kt b/compiler/testData/diagnostics/tests/variance/InPosition.fir.kt index 7ac2afd0c3b..9e3122e26e6 100644 --- a/compiler/testData/diagnostics/tests/variance/InPosition.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/InPosition.fir.kt @@ -41,10 +41,10 @@ interface Test { fun neOk11(i: Inv) fun neOk12(i: Inv) - fun neOk30(i: Pair) - fun neOk31(i: Pair) - fun neOk32(i: Inv) + fun neOk30(i: Pair) + fun neOk31(i: Pair) + fun neOk32(i: Inv) fun neOk33(i: Inv<>) - fun neOk34(i: Inv) + fun neOk34(i: Inv) fun neOk35(i: Inv) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/InvariantPosition.fir.kt b/compiler/testData/diagnostics/tests/variance/InvariantPosition.fir.kt index b6542b54378..6d68d795ae3 100644 --- a/compiler/testData/diagnostics/tests/variance/InvariantPosition.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/InvariantPosition.fir.kt @@ -38,10 +38,10 @@ interface Test { var neOk22: Inv var neOk23: Inv - var neOk30: Pair - var neOk31: Pair - var neOk32: Inv + var neOk30: Pair + var neOk31: Pair + var neOk32: Inv var neOk33: Inv<> - var neOk34: Inv + var neOk34: Inv var neOk35: Inv } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/OutPosition.fir.kt b/compiler/testData/diagnostics/tests/variance/OutPosition.fir.kt index 6748b83cb8e..f2cf351d677 100644 --- a/compiler/testData/diagnostics/tests/variance/OutPosition.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/OutPosition.fir.kt @@ -33,10 +33,10 @@ interface Test { fun neOk10(): Inv fun neOk11(): Inv - fun neOk30(): Pair - fun neOk31(): Pair - fun neOk32(): Inv + fun neOk30(): Pair + fun neOk31(): Pair + fun neOk32(): Inv fun neOk33(): Inv<> - fun neOk34(): Inv + fun neOk34(): Inv fun neOk35(): Inv } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/ea1337846.fir.kt b/compiler/testData/diagnostics/tests/variance/ea1337846.fir.kt index be951bd9da2..7885d1cce3b 100644 --- a/compiler/testData/diagnostics/tests/variance/ea1337846.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/ea1337846.fir.kt @@ -11,11 +11,11 @@ typealias EachSegmentComparator = (currentSegment: SegmentType, otherSegment: SegmentType, relationship: Int) -> Boolean interface ComputablePath - : Path + : Path where NumberType: Number, - PointType: ComputablePoint, - SegmentType: ComputableLineSegment + PointType: ComputablePoint, + SegmentType: ComputableLineSegment { - fun anyTwoSegments(comparator: EachSegmentComparator<ComputableSegment>): Boolean + fun anyTwoSegments(comparator: EachSegmentComparator<ComputableSegment>): Boolean } diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.fir.kt index 36e5d1dc4b1..fe9a153a267 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.fir.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumIs.fir.kt @@ -4,8 +4,8 @@ enum class MyEnum { fun foo(x: MyEnum): Int { return when (x) { - is MyEnum.A -> 1 - is MyEnum.B -> 2 - is MyEnum.C -> 3 + is MyEnum.A -> 1 + is MyEnum.B -> 2 + is MyEnum.C -> 3 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.fir.kt index e230cc17a05..cceb426abbf 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.fir.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveEnumMixed.fir.kt @@ -5,7 +5,7 @@ enum class MyEnum { fun foo(x: MyEnum): Int { return when (x) { MyEnum.A -> 1 - is MyEnum.B -> 2 - is MyEnum.C -> 3 + is MyEnum.B -> 2 + is MyEnum.C -> 3 } } \ No newline at end of file