From 8884cbe415431e38190b0dcdceee3aa967420166 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 4 Mar 2020 17:54:33 +0300 Subject: [PATCH] Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed --- .../kotlin/fir/AbstractFir2IrTextTest.kt | 22 +-- ...onymousInitializerVarAndConstructor.fir.kt | 10 - .../AnonymousInitializerVarAndConstructor.kt | 1 + .../tests/AssignToArrayElement.fir.kt | 10 - .../diagnostics/tests/AssignToArrayElement.kt | 1 + .../diagnostics/tests/DiamondFunction.fir.kt | 9 - .../diagnostics/tests/DiamondFunction.kt | 1 + .../tests/DiamondFunctionGeneric.fir.kt | 9 - .../tests/DiamondFunctionGeneric.kt | 1 + .../testData/diagnostics/tests/Dollar.fir.kt | 12 -- compiler/testData/diagnostics/tests/Dollar.kt | 1 + .../diagnostics/tests/LiteralAsResult.fir.kt | 3 - .../diagnostics/tests/LiteralAsResult.kt | 1 + .../tests/MultilineStringTemplates.fir.kt | 43 ----- .../tests/MultilineStringTemplates.kt | 1 + ...errideFunctionWithParamDefaultValue.fir.kt | 11 -- .../OverrideFunctionWithParamDefaultValue.kt | 1 + ...enFunctionAndSpecifiedTypeParameter.fir.kt | 13 -- ...rridenFunctionAndSpecifiedTypeParameter.kt | 1 + .../tests/ProcessingEmptyImport.fir.kt | 3 - .../tests/ProcessingEmptyImport.kt | 1 + .../tests/PropertyInitializers.fir.kt | 9 - .../diagnostics/tests/PropertyInitializers.kt | 1 + .../tests/ShiftFunctionTypes.fir.kt | 52 ----- .../diagnostics/tests/ShiftFunctionTypes.kt | 1 + .../SyntaxErrorInTestHighlighting.fir.kt | 5 - .../tests/SyntaxErrorInTestHighlighting.kt | 1 + .../SyntaxErrorInTestHighlightingEof.fir.kt | 1 - .../tests/SyntaxErrorInTestHighlightingEof.kt | 1 + .../diagnostics/tests/UnitValue.fir.kt | 5 - .../testData/diagnostics/tests/UnitValue.kt | 1 + .../tests/UnusedParametersVersion10.fir.kt | 3 - .../tests/UnusedParametersVersion10.kt | 1 + ...ValAndFunOverrideCompatibilityClash.fir.kt | 9 - .../ValAndFunOverrideCompatibilityClash.kt | 1 + .../diagnostics/tests/VarargTypes.fir.kt | 26 --- .../testData/diagnostics/tests/VarargTypes.kt | 1 + .../annotations/AnnotatedConstructor.fir.kt | 2 - .../tests/annotations/AnnotatedConstructor.kt | 1 + .../AnnotatedLocalObjectFun.fir.kt | 8 - .../annotations/AnnotatedLocalObjectFun.kt | 1 + .../AnnotatedLocalObjectProperty.fir.kt | 8 - .../AnnotatedLocalObjectProperty.kt | 1 + .../tests/annotations/AnnotatedLoop.fir.kt | 8 - .../tests/annotations/AnnotatedLoop.kt | 1 + .../annotations/AnnotatedResultType.fir.kt | 5 - .../tests/annotations/AnnotatedResultType.kt | 1 + .../annotations/AnnotatedTryCatch.fir.kt | 9 - .../tests/annotations/AnnotatedTryCatch.kt | 1 + .../AnnotationAsDefaultParameter.fir.kt | 5 - .../AnnotationAsDefaultParameter.kt | 1 + .../annotations/AnnotationOnObject.fir.kt | 6 - .../tests/annotations/AnnotationOnObject.kt | 1 + .../annotations/DanglingNoBrackets.fir.kt | 13 -- .../tests/annotations/DanglingNoBrackets.kt | 1 + .../annotations/DanglingWithBrackets.fir.kt | 16 -- .../tests/annotations/DanglingWithBrackets.kt | 1 + .../annotations/RecursivelyAnnotated.fir.kt | 3 - .../tests/annotations/RecursivelyAnnotated.kt | 1 + .../RecursivelyAnnotatedGlobalProperty.fir.kt | 3 - .../RecursivelyAnnotatedGlobalProperty.kt | 1 + .../RecursivelyAnnotatedParameter.fir.kt | 2 - .../RecursivelyAnnotatedParameter.kt | 1 + .../RecursivelyAnnotatedParameterType.fir.kt | 3 - .../RecursivelyAnnotatedParameterType.kt | 1 + ...RecursivelyAnnotatedParameterWithAt.fir.kt | 2 - .../RecursivelyAnnotatedParameterWithAt.kt | 1 + .../annotations/extensionFunctionType.fir.kt | 11 -- .../annotations/extensionFunctionType.kt | 1 + .../inheritFromAnnotationClass.fir.kt | 4 - .../annotations/inheritFromAnnotationClass.kt | 1 + .../inheritFromAnnotationClass2.fir.kt | 25 --- .../inheritFromAnnotationClass2.kt | 1 + .../tests/annotations/noNameProperty.fir.kt | 1 - .../tests/annotations/noNameProperty.kt | 1 + .../tests/annotations/onExpression.fir.kt | 5 - .../tests/annotations/onExpression.kt | 1 + .../tests/annotations/onLoops.fir.kt | 12 -- .../diagnostics/tests/annotations/onLoops.kt | 1 + .../annotations/options/annotationAsArg.kt | 1 + .../options/annotationAsArgComplex.fir.kt | 10 - .../options/annotationAsArgComplex.kt | 1 + .../annotations/options/documented.fir.kt | 8 - .../tests/annotations/options/documented.kt | 1 + .../options/functionExpression.fir.kt | 12 -- .../annotations/options/functionExpression.kt | 1 + .../annotations/options/javaDocumented.fir.kt | 20 -- .../annotations/options/javaDocumented.kt | 1 + .../annotations/options/javaretention.fir.kt | 35 ---- .../annotations/options/javaretention.kt | 1 + .../annotations/options/objectLiteral.fir.kt | 8 - .../annotations/options/objectLiteral.kt | 1 + .../annotations/options/retention.fir.kt | 4 - .../tests/annotations/options/retention.kt | 1 + .../tests/annotations/options/target.fir.kt | 4 - .../tests/annotations/options/target.kt | 1 + .../options/targets/suppress.fir.kt | 5 - .../annotations/options/targets/suppress.kt | 1 + .../tests/annotations/typeAnnotations.fir.kt | 15 -- .../tests/annotations/typeAnnotations.kt | 1 + .../tests/backingField/CustomGetSet.fir.kt | 6 - .../tests/backingField/CustomGetSet.kt | 1 + .../tests/backingField/CustomGetVal.fir.kt | 4 - .../tests/backingField/CustomGetVal.kt | 1 + .../backingField/CustomGetValGlobal.fir.kt | 3 - .../tests/backingField/CustomGetValGlobal.kt | 1 + .../tests/backingField/CustomGetVar.fir.kt | 4 - .../tests/backingField/CustomGetVar.kt | 1 + .../tests/backingField/CustomSet.fir.kt | 4 - .../tests/backingField/CustomSet.kt | 1 + .../tests/backingField/FieldAsProperty.fir.kt | 9 - .../tests/backingField/FieldAsProperty.kt | 1 + .../tests/backingField/FieldDerived.fir.kt | 18 -- .../tests/backingField/FieldDerived.kt | 1 + .../tests/backingField/FieldInLocal.fir.kt | 11 -- .../tests/backingField/FieldInLocal.kt | 1 + .../tests/backingField/FieldOnVal.fir.kt | 2 - .../tests/backingField/FieldOnVal.kt | 1 + .../tests/backingField/FieldOnVar.fir.kt | 5 - .../tests/backingField/FieldOnVar.kt | 1 + .../backingField/kt782packageLevel.fir.kt | 16 -- .../tests/backingField/kt782packageLevel.kt | 1 + .../bound/classVsStarImportedCompanion.fir.kt | 18 -- .../bound/classVsStarImportedCompanion.kt | 1 + .../bound/classVsStarImportedObject.fir.kt | 19 -- .../bound/classVsStarImportedObject.kt | 1 + .../bound/expectedType.fir.kt | 14 -- .../callableReference/bound/expectedType.kt | 1 + .../callableReference/bound/object.fir.kt | 11 -- .../tests/callableReference/bound/object.kt | 1 + .../bound/syntheticExtensionOnLHS.fir.kt | 13 -- .../bound/syntheticExtensionOnLHS.kt | 1 + .../bound/valueOfTypeParameterType.fir.kt | 3 - .../bound/valueOfTypeParameterType.kt | 1 + .../callableReference/classVsPackage.fir.kt | 24 --- .../tests/callableReference/classVsPackage.kt | 1 + .../tests/callableReference/emptyLhs.fir.kt | 41 ---- .../tests/callableReference/emptyLhs.kt | 1 + .../callableRefrenceOnNestedObject.fir.kt | 9 - .../callableRefrenceOnNestedObject.kt | 1 + .../function/constructorFromClass.fir.kt | 19 -- .../function/constructorFromClass.kt | 1 + .../function/constructorFromCompanion.fir.kt | 22 --- .../function/constructorFromCompanion.kt | 1 + .../function/constructorFromExtension.fir.kt | 14 -- .../function/constructorFromExtension.kt | 1 + .../constructorFromExtensionInClass.fir.kt | 23 --- .../constructorFromExtensionInClass.kt | 1 + .../function/constructorFromTopLevel.fir.kt | 11 -- .../function/constructorFromTopLevel.kt | 1 + .../callableReference/function/empty.fir.kt | 6 - .../tests/callableReference/function/empty.kt | 1 + .../function/extensionOnNullable.fir.kt | 12 -- .../function/extensionOnNullable.kt | 1 + .../function/genericClassFromTopLevel.fir.kt | 13 -- .../function/genericClassFromTopLevel.kt | 1 + .../function/javaStaticMethod.fir.kt | 24 --- .../function/javaStaticMethod.kt | 1 + .../function/localConstructor.fir.kt | 10 - .../function/localConstructor.kt | 1 + ...onstructorFromExtensionInLocalClass.fir.kt | 18 -- ...calConstructorFromExtensionInLocalClass.kt | 1 + .../localConstructorFromLocalClass.fir.kt | 10 - .../localConstructorFromLocalClass.kt | 1 + .../localConstructorFromLocalExtension.fir.kt | 17 -- .../localConstructorFromLocalExtension.kt | 1 + .../function/longQualifiedName.fir.kt | 18 -- .../function/longQualifiedName.kt | 1 + .../nestedConstructorFromTopLevel.fir.kt | 13 -- .../function/nestedConstructorFromTopLevel.kt | 1 + .../noAmbiguityLocalVsTopLevel.fir.kt | 8 - .../function/noAmbiguityLocalVsTopLevel.kt | 1 + .../privateStaticAndPublicMember.fir.kt | 10 - .../function/privateStaticAndPublicMember.kt | 1 + ...ultValueAsOtherFunctionType_enabled.fir.kt | 18 -- ...DefaultValueAsOtherFunctionType_enabled.kt | 1 + .../generic/argumentExpectedType.fir.kt | 12 -- .../generic/argumentExpectedType.kt | 1 + .../callableReference/generic/kt10968.fir.kt | 11 -- .../callableReference/generic/kt10968.kt | 1 + .../callableReference/generic/kt12286.fir.kt | 8 - .../callableReference/generic/kt12286.kt | 1 + .../callableReference/generic/kt35896.fir.kt | 15 -- .../callableReference/generic/kt35896.kt | 1 + .../callableReference/generic/kt7470.fir.kt | 8 - .../tests/callableReference/generic/kt7470.kt | 1 + ...hReferenceAgainstVarargAndKFunction.fir.kt | 12 -- ...lWithReferenceAgainstVarargAndKFunction.kt | 1 + .../kt15439_completeCall.fir.kt | 11 -- .../callableReference/kt15439_completeCall.kt | 1 + .../tests/callableReference/kt25433.fir.kt | 17 -- .../tests/callableReference/kt25433.kt | 1 + .../tests/callableReference/kt32256.fir.kt | 26 --- .../tests/callableReference/kt32256.kt | 1 + .../tests/callableReference/kt35959.fir.kt | 12 -- .../tests/callableReference/kt35959.kt | 1 + ...ityWhenAllReferencesAreInapplicable.fir.kt | 20 -- ...biguityWhenAllReferencesAreInapplicable.kt | 1 + .../property/accessViaSubclass.fir.kt | 15 -- .../property/accessViaSubclass.kt | 1 + .../property/classFromClass.fir.kt | 12 -- .../property/classFromClass.kt | 1 + .../extensionPropertyOnNullable.fir.kt | 10 - .../property/extensionPropertyOnNullable.kt | 1 + .../property/extensionsSameName.fir.kt | 14 -- .../property/extensionsSameName.kt | 1 + .../property/genericClass.fir.kt | 16 -- .../property/genericClass.kt | 1 + .../callableReference/property/kt7564.fir.kt | 12 -- .../callableReference/property/kt7564.kt | 1 + .../property/protectedVarFromClass.fir.kt | 22 --- .../property/protectedVarFromClass.kt | 1 + ...eturnTypeDependentOnGenericProperty.fir.kt | 8 - .../returnTypeDependentOnGenericProperty.kt | 1 + ...leCallableReferenceFromDistantScope.fir.kt | 15 -- ...icableCallableReferenceFromDistantScope.kt | 1 + .../resolve/byArgType.fir.kt | 10 - .../callableReference/resolve/byArgType.kt | 1 + ...llableReferenceToVarargWithOverload.fir.kt | 16 -- .../callableReferenceToVarargWithOverload.kt | 1 + ...andidateDescriptorNotReflectionType.fir.kt | 14 -- ...ingCandidateDescriptorNotReflectionType.kt | 1 + ...eOuterCallBySingleCallableReference.fir.kt | 18 -- ...hooseOuterCallBySingleCallableReference.kt | 1 + .../resolve/constructor.fir.kt | 12 -- .../callableReference/resolve/constructor.kt | 1 + ...lassConstructorOnOuterClassInstance.fir.kt | 13 -- ...nerClassConstructorOnOuterClassInstance.kt | 1 + .../resolve/kt10036_bound.fir.kt | 11 -- .../resolve/kt10036_bound.kt | 1 + .../callableReference/resolve/kt12751.fir.kt | 15 -- .../callableReference/resolve/kt12751.kt | 1 + .../callableReference/resolve/kt35887.fir.kt | 13 -- .../callableReference/resolve/kt35887.kt | 1 + .../callableReference/resolve/kt8596.fir.kt | 25 --- .../tests/callableReference/resolve/kt8596.kt | 1 + ...OutersAndMultipleCallableReferences.fir.kt | 16 -- ...ipleOutersAndMultipleCallableReferences.kt | 1 + ...ityBetweenTopLevelAndMemberProperty.fir.kt | 16 -- ...biguityBetweenTopLevelAndMemberProperty.kt | 1 + .../resolve/noFakeDescriptorForObject.fir.kt | 11 -- .../resolve/noFakeDescriptorForObject.kt | 1 + .../resolve/overloadsBound.fir.kt | 13 -- .../resolve/overloadsBound.kt | 1 + .../resolve/overloadsMember.fir.kt | 16 -- .../resolve/overloadsMember.kt | 1 + ...ponedResolveOfManyCallableReference.fir.kt | 19 -- ...postponedResolveOfManyCallableReference.kt | 1 + ...veEqualsOperatorWithAnyExpectedType.fir.kt | 11 -- ...esolveEqualsOperatorWithAnyExpectedType.kt | 1 + .../callableReference/resolve/valVsFun.fir.kt | 11 -- .../callableReference/resolve/valVsFun.kt | 1 + .../rewriteAtSliceOnGetOperator.fir.kt | 18 -- .../rewriteAtSliceOnGetOperator.kt | 1 + .../tests/callableReference/sam.fir.kt | 31 --- .../tests/callableReference/sam.kt | 1 + .../subtypeArgumentFromRHSForReference.fir.kt | 27 --- .../subtypeArgumentFromRHSForReference.kt | 1 + .../suspendCallableReference.fir.kt | 17 -- .../suspendCallableReference.kt | 1 + .../callableReference/typealiases.fir.kt | 15 -- .../tests/callableReference/typealiases.kt | 1 + .../whitespacesInExpression.fir.kt | 16 -- .../whitespacesInExpression.kt | 1 + .../tests/cast/AsErasedFine.fir.kt | 2 - .../diagnostics/tests/cast/AsErasedFine.kt | 1 + .../tests/cast/AsErasedStar.fir.kt | 3 - .../diagnostics/tests/cast/AsErasedStar.kt | 1 + .../tests/cast/ExtensionAsNonExtension.fir.kt | 10 - .../tests/cast/ExtensionAsNonExtension.kt | 1 + ...WithOneSubstitutedAndOneSameGeneric.fir.kt | 5 - ...ivedWithOneSubstitutedAndOneSameGeneric.kt | 1 + ...wForOverridenVarianceWithProjection.fir.kt | 8 - ...AllowForOverridenVarianceWithProjection.kt | 1 + ...ForTypeWithTwoSameTypeSubstitutions.fir.kt | 6 - ...llowForTypeWithTwoSameTypeSubstitutions.kt | 1 + ...sedAllowForTypeWithoutTypeArguments.fir.kt | 5 - ...sErasedAllowForTypeWithoutTypeArguments.kt | 1 + .../cast/IsErasedAllowParameterSubtype.fir.kt | 7 - .../cast/IsErasedAllowParameterSubtype.kt | 1 + .../IsErasedAllowSameClassParameter.fir.kt | 3 - .../cast/IsErasedAllowSameClassParameter.kt | 1 + ...IsErasedAllowSameParameterParameter.fir.kt | 3 - .../IsErasedAllowSameParameterParameter.kt | 1 + .../tests/cast/IsErasedNonGeneric.fir.kt | 3 - .../tests/cast/IsErasedNonGeneric.kt | 1 + .../tests/cast/IsErasedNullableTasT.fir.kt | 1 - .../tests/cast/IsErasedNullableTasT.kt | 1 + .../tests/cast/IsErasedStar.fir.kt | 2 - .../diagnostics/tests/cast/IsErasedStar.kt | 1 + .../diagnostics/tests/cast/IsTraits.fir.kt | 4 - .../diagnostics/tests/cast/IsTraits.kt | 1 + .../tests/cast/IsWithCycleUpperBounds.fir.kt | 14 -- .../tests/cast/IsWithCycleUpperBounds.kt | 1 + .../tests/cast/NullableToNullable.fir.kt | 7 - .../tests/cast/NullableToNullable.kt | 1 + .../cast/StableTypeForUselessCast.fir.kt | 14 -- .../tests/cast/StableTypeForUselessCast.kt | 1 + .../tests/cast/WhenWithExpression.fir.kt | 11 -- .../tests/cast/WhenWithExpression.kt | 1 + .../tests/cast/bare/AsNullable.fir.kt | 10 - .../diagnostics/tests/cast/bare/AsNullable.kt | 1 + .../tests/cast/bare/NullableAs.fir.kt | 9 - .../diagnostics/tests/cast/bare/NullableAs.kt | 1 + .../tests/cast/bare/NullableAsNullable.fir.kt | 10 - .../tests/cast/bare/NullableAsNullable.kt | 1 + .../tests/cast/isErasedAnyAndStarred.fir.kt | 3 - .../tests/cast/isErasedAnyAndStarred.kt | 1 + .../tests/cast/isErasedTAndStarred.fir.kt | 3 - .../tests/cast/isErasedTAndStarred.kt | 1 + .../cast/isErasedUnrelatedAndStarred.fir.kt | 4 - .../tests/cast/isErasedUnrelatedAndStarred.kt | 1 + .../neverSucceeds/CastToNotNullSuper.fir.kt | 8 - .../cast/neverSucceeds/CastToNotNullSuper.kt | 1 + .../classAndObjectLiteralType.fir.kt | 16 -- .../classLiteral/classAndObjectLiteralType.kt | 1 + .../classLiteral/qualifiedClassLiteral.fir.kt | 7 - .../classLiteral/qualifiedClassLiteral.kt | 1 + .../classLiteral/simpleClassLiteral.fir.kt | 3 - .../tests/classLiteral/simpleClassLiteral.kt | 1 + .../ClassObjectCannotAccessClassFields.fir.kt | 9 - .../ClassObjectCannotAccessClassFields.kt | 1 + .../classObjects/builtInClassObjects.fir.kt | 43 ----- .../tests/classObjects/builtInClassObjects.kt | 1 + .../importClassInClassObject.fir.kt | 11 -- .../classObjects/importClassInClassObject.kt | 1 + .../resolveFunctionInsideClassObject.fir.kt | 9 - .../resolveFunctionInsideClassObject.kt | 1 + .../resolveToFunctionFromBuiltIns.fir.kt | 18 -- .../resolveToFunctionFromBuiltIns.kt | 1 + .../afterInitialization.fir.kt | 6 - .../afterInitialization.kt | 1 + .../constructorConsistency/delegate.fir.kt | 13 -- .../tests/constructorConsistency/delegate.kt | 1 + ...initializerWithSecondaryConstructor.fir.kt | 20 -- .../initializerWithSecondaryConstructor.kt | 1 + .../lambdaInObject.fir.kt | 18 -- .../constructorConsistency/lambdaInObject.kt | 1 + .../constructorConsistency/lateInit.fir.kt | 15 -- .../tests/constructorConsistency/lateInit.kt | 1 + .../constructorConsistency/localObject.fir.kt | 19 -- .../constructorConsistency/localObject.kt | 1 + .../constructorConsistency/nobacking.fir.kt | 12 -- .../tests/constructorConsistency/nobacking.kt | 1 + .../tests/constructorConsistency/outer.fir.kt | 11 -- .../tests/constructorConsistency/outer.kt | 1 + .../propertyAccess.fir.kt | 7 - .../constructorConsistency/propertyAccess.kt | 1 + .../definiteReturn/kt4034.fir.kt | 11 -- .../definiteReturn/kt4034.kt | 1 + .../tests/controlFlowAnalysis/kt1066.fir.kt | 34 ---- .../tests/controlFlowAnalysis/kt1066.kt | 1 + .../tests/controlFlowAnalysis/kt1156.fir.kt | 7 - .../tests/controlFlowAnalysis/kt1156.kt | 1 + .../tests/controlFlowAnalysis/kt1189.fir.kt | 38 ---- .../tests/controlFlowAnalysis/kt1189.kt | 1 + .../tests/controlFlowAnalysis/kt1191.fir.kt | 21 --- .../tests/controlFlowAnalysis/kt1191.kt | 1 + .../controlFlowAnalysis/kt1219.1301.fir.kt | 25 --- .../tests/controlFlowAnalysis/kt1219.1301.kt | 1 + .../controlFlowAnalysis/kt2166_kt2103.fir.kt | 17 -- .../controlFlowAnalysis/kt2166_kt2103.kt | 1 + .../tests/controlFlowAnalysis/kt2226.fir.kt | 15 -- .../tests/controlFlowAnalysis/kt2226.kt | 1 + .../tests/controlFlowAnalysis/kt2972.fir.kt | 28 --- .../tests/controlFlowAnalysis/kt2972.kt | 1 + .../tests/controlFlowAnalysis/kt510.fir.kt | 18 -- .../tests/controlFlowAnalysis/kt510.kt | 1 + .../tests/controlFlowAnalysis/kt776.fir.kt | 38 ---- .../tests/controlFlowAnalysis/kt776.kt | 1 + .../tests/controlFlowAnalysis/kt843.fir.kt | 8 - .../tests/controlFlowAnalysis/kt843.kt | 1 + .../localObjectInConstructor.fir.kt | 87 --------- .../localObjectInConstructor.kt | 1 + .../mainWithoutWarningOnUnusedParam.fir.kt | 5 - .../mainWithoutWarningOnUnusedParam.kt | 1 + .../nestedTryFinally.fir.kt | 24 --- .../controlFlowAnalysis/nestedTryFinally.kt | 1 + .../nonLocalReturnUnreachable.fir.kt | 26 --- .../nonLocalReturnUnreachable.kt | 1 + .../nonLocalReturnWithFinally.fir.kt | 10 - .../nonLocalReturnWithFinally.kt | 1 + .../scopeOfAnonymousInitializer.fir.kt | 5 - .../scopeOfAnonymousInitializer.kt | 1 + .../tryWithAssignmentUsedInCatch.fir.kt | 36 ---- .../tryWithAssignmentUsedInCatch.kt | 1 + .../lateinitRecursiveInLambda.fir.kt | 6 - .../lateinitRecursiveInLambda.kt | 1 + .../lateinitWithPlusAssign.fir.kt | 8 - .../lateinitWithPlusAssign.kt | 1 + ...ithPrimaryConstructorAndConstructor.fir.kt | 9 - ...nitWithPrimaryConstructorAndConstructor.kt | 1 + .../unnecessaryLateinit/normalLateinit.fir.kt | 7 - .../unnecessaryLateinit/normalLateinit.kt | 1 + .../normalLateinitWithTwoConstructors.fir.kt | 9 - .../normalLateinitWithTwoConstructors.kt | 1 + .../unusedInAnonymous.fir.kt | 9 - .../controlFlowAnalysis/unusedInAnonymous.kt | 1 + .../varInitializationInIfInCycle.fir.kt | 15 -- .../varInitializationInIfInCycle.kt | 1 + .../controlStructures/ForWithoutBraces.fir.kt | 8 - .../controlStructures/ForWithoutBraces.kt | 1 + .../commonSupertypeOfT.fir.kt | 30 --- .../controlStructures/commonSupertypeOfT.kt | 1 + ...lConstructsWithNullableExpectedType.fir.kt | 20 -- ...ecialConstructsWithNullableExpectedType.kt | 1 + .../cyclicHierarchy/javaJavaCycle.fir.kt | 28 --- .../tests/cyclicHierarchy/javaJavaCycle.kt | 1 + .../cyclicHierarchy/javaJavaNested.fir.kt | 24 --- .../tests/cyclicHierarchy/javaJavaNested.kt | 1 + .../nestedClassInSuperClassParameter.fir.kt | 5 - .../nestedClassInSuperClassParameter.kt | 1 + .../componentNamedComponent1.fir.kt | 6 - .../dataClasses/componentNamedComponent1.kt | 1 + .../dataClasses/copyOfPrivateClass.fir.kt | 3 - .../tests/dataClasses/copyOfPrivateClass.kt | 1 + .../dataClassNotOverridingCopy.fir.kt | 9 - .../dataClasses/dataClassNotOverridingCopy.kt | 1 + .../finalMembersInBaseClass.fir.kt | 16 -- .../dataClasses/finalMembersInBaseClass.kt | 1 + .../implementTraitWhichHasComponent1.fir.kt | 5 - .../implementTraitWhichHasComponent1.kt | 1 + .../tests/dataClasses/multiDeclaration.fir.kt | 9 - .../tests/dataClasses/multiDeclaration.kt | 1 + .../dataClasses/multiDeclarationFor.fir.kt | 10 - .../tests/dataClasses/multiDeclarationFor.kt | 1 + .../tests/dataClasses/notADataClass.fir.kt | 6 - .../tests/dataClasses/notADataClass.kt | 1 + .../tests/dataClasses/oneValParam.fir.kt | 8 - .../tests/dataClasses/oneValParam.kt | 1 + .../tests/dataClasses/twoValParams.fir.kt | 8 - .../tests/dataClasses/twoValParams.kt | 1 + .../tests/dataClasses/twoVarParams.fir.kt | 8 - .../tests/dataClasses/twoVarParams.kt | 1 + .../destructuringDeclarations/kt2829.fir.kt | 16 -- .../destructuringDeclarations/kt2829.kt | 1 + ...lastDestructuringDeclarationInBlock.fir.kt | 30 --- .../lastDestructuringDeclarationInBlock.kt | 1 + .../tests/declarationChecks/kt2142.fir.kt | 8 - .../tests/declarationChecks/kt2142.kt | 1 + .../absentErrorAboutInitializer.fir.kt | 11 -- .../absentErrorAboutInitializer.kt | 1 + .../absentErrorAboutType.fir.kt | 11 -- .../delegatedProperty/absentErrorAboutType.kt | 1 + .../delegatedProperty/backingField.fir.kt | 15 -- .../tests/delegatedProperty/backingField.kt | 1 + .../delegatedProperty/defaultGetter.fir.kt | 12 -- .../tests/delegatedProperty/defaultGetter.kt | 1 + .../delegatedProperty/defaultSetter.fir.kt | 14 -- .../tests/delegatedProperty/defaultSetter.kt | 1 + .../delegatedPropertyOverridedInTrait.fir.kt | 21 --- .../delegatedPropertyOverridedInTrait.kt | 1 + .../delegatedProperty/genericGetter.fir.kt | 11 -- .../tests/delegatedProperty/genericGetter.kt | 1 + .../getterWithSubtype.fir.kt | 15 -- .../delegatedProperty/getterWithSubtype.kt | 1 + ...erenceArgumentInDelegatedExpression.fir.kt | 17 -- ...eReferenceArgumentInDelegatedExpression.kt | 1 + .../delegateExpressionAsLambda.fir.kt | 22 --- .../inference/delegateExpressionAsLambda.kt | 1 + ...essionWithLabeledReturnInsideLambda.fir.kt | 14 -- ...ExpressionWithLabeledReturnInsideLambda.kt | 1 + .../inference/extensionGet.fir.kt | 35 ---- .../inference/extensionGet.kt | 1 + ...ultTypeOfLambdaForConventionMethods.fir.kt | 17 -- .../resultTypeOfLambdaForConventionMethods.kt | 1 + ...peOfLazyDelegatedPropertyWithObject.fir.kt | 29 --- .../typeOfLazyDelegatedPropertyWithObject.kt | 1 + .../useCompleterWithoutExpectedType.fir.kt | 15 -- .../useCompleterWithoutExpectedType.kt | 1 + .../inference/useExpectedType.fir.kt | 76 -------- .../inference/useExpectedType.kt | 1 + .../inference/useExpectedTypeForVal.fir.kt | 64 ------- .../inference/useExpectedTypeForVal.kt | 1 + .../delegatedProperty/localVariable.fir.kt | 15 -- .../tests/delegatedProperty/localVariable.kt | 1 + .../genericProvideDelegate.fir.kt | 13 -- .../provideDelegate/genericProvideDelegate.kt | 1 + .../provideDelegate/hostAndReceiver3.fir.kt | 12 -- .../provideDelegate/hostAndReceiver3.kt | 1 + .../localDelegatedProperty.fir.kt | 11 -- .../provideDelegate/localDelegatedProperty.kt | 1 + ...esolutionForSeveralProvideDelegates.fir.kt | 19 -- ...oadResolutionForSeveralProvideDelegates.kt | 1 + .../simpleProvideDelegate.fir.kt | 10 - .../provideDelegate/simpleProvideDelegate.kt | 1 + .../setterWithSupertype.fir.kt | 16 -- .../delegatedProperty/setterWithSupertype.kt | 1 + .../delegatedProperty/severalReceivers.fir.kt | 13 -- .../delegatedProperty/severalReceivers.kt | 1 + .../delegatedProperty/thisOfAnyType.fir.kt | 16 -- .../tests/delegatedProperty/thisOfAnyType.kt | 1 + .../wrongSetterReturnType.fir.kt | 15 -- .../wrongSetterReturnType.kt | 1 + .../delegation/Delegation_Hierarchy.fir.kt | 12 -- .../tests/delegation/Delegation_Hierarchy.kt | 1 + ...Delegation_ScopeInitializationOrder.fir.kt | 10 - .../Delegation_ScopeInitializationOrder.kt | 1 + .../tests/delegation/kt8154.fir.kt | 11 -- .../diagnostics/tests/delegation/kt8154.kt | 1 + .../abstractOverride.fir.kt | 18 -- .../abstractOverride.kt | 1 + .../delegationToSubType.fir.kt | 19 -- .../delegationToSubType.kt | 1 + .../delegationToSubTypeProperty.fir.kt | 20 -- .../delegationToSubTypeProperty.kt | 1 + .../explicitOverride.fir.kt | 18 -- .../explicitOverride.kt | 1 + .../generic.fir.kt | 14 -- .../memberHidesSupertypeOverride/generic.kt | 1 + .../simpleNoOverride.fir.kt | 15 -- .../simpleNoOverride.kt | 1 + .../deparenthesize/annotatedSafeCall.fir.kt | 7 - .../tests/deparenthesize/annotatedSafeCall.kt | 1 + .../multiParenthesizedSafeCall.fir.kt | 3 - .../multiParenthesizedSafeCall.kt | 1 + .../parenthesizedSafeCall.fir.kt | 3 - .../deparenthesize/parenthesizedSafeCall.kt | 1 + .../classWithCompanionObject.fir.kt | 8 - .../deprecated/classWithCompanionObject.kt | 1 + .../tests/deprecated/thisUsage.fir.kt | 7 - .../diagnostics/tests/deprecated/thisUsage.kt | 1 + ...teClassFunctionOverriddenByProperty.fir.kt | 8 - ...rivateClassFunctionOverriddenByProperty.kt | 1 + .../privateClassPropertyNoClash.fir.kt | 13 -- .../privateClassPropertyNoClash.kt | 1 + .../topLevelDifferentFiles.fir.kt | 5 - .../topLevelDifferentFiles.kt | 1 + .../kotlinClassImplementsJavaInterface.fir.kt | 22 --- .../kotlinClassImplementsJavaInterface.kt | 1 + ...ntsJavaInterfaceExtendsJavaInteface.fir.kt | 29 --- ...lementsJavaInterfaceExtendsJavaInteface.kt | 1 + ...otlinMembersVsJavaNonVisibleStatics.fir.kt | 24 --- .../kotlinMembersVsJavaNonVisibleStatics.kt | 1 + .../tests/enum/AbstractOverrideInEnum.fir.kt | 12 -- .../tests/enum/AbstractOverrideInEnum.kt | 1 + .../enum/SecondaryConstructorCall.fir.kt | 9 - .../tests/enum/SecondaryConstructorCall.kt | 1 + .../tests/enum/classObjectInEnum.fir.kt | 9 - .../tests/enum/classObjectInEnum.kt | 1 + .../tests/enum/commonSupertype.fir.kt | 7 - .../diagnostics/tests/enum/commonSupertype.kt | 1 + .../tests/enum/emptyConstructor.fir.kt | 4 - .../tests/enum/emptyConstructor.kt | 1 + .../enum/enumIsAssignableToBuiltInEnum.fir.kt | 14 -- .../enum/enumIsAssignableToBuiltInEnum.kt | 1 + .../tests/enum/enumMissingName.fir.kt | 6 - .../diagnostics/tests/enum/enumMissingName.kt | 1 + .../tests/enum/enumWithEmptyName.fir.kt | 2 - .../tests/enum/enumWithEmptyName.kt | 1 + .../enum/extensionNamedAsEnumEntry.fir.kt | 8 - .../tests/enum/extensionNamedAsEnumEntry.kt | 1 + .../tests/enum/importEnumFromJava.fir.kt | 7 - .../tests/enum/importEnumFromJava.kt | 1 + .../diagnostics/tests/enum/inline.fir.kt | 3 - .../testData/diagnostics/tests/enum/inline.kt | 1 + .../enum/inner/existingClassObject.fir.kt | 19 -- .../tests/enum/inner/existingClassObject.kt | 1 + .../tests/enum/inner/insideClass.fir.kt | 5 - .../tests/enum/inner/insideClass.kt | 1 + .../tests/enum/inner/insideClassObject.fir.kt | 7 - .../tests/enum/inner/insideClassObject.kt | 1 + .../tests/enum/inner/insideEnum.fir.kt | 7 - .../tests/enum/inner/insideEnum.kt | 1 + .../tests/enum/inner/insideObject.fir.kt | 5 - .../tests/enum/inner/insideObject.kt | 1 + .../tests/enum/inner/insideTrait.fir.kt | 5 - .../tests/enum/inner/insideTrait.kt | 1 + .../inner/redeclarationInClassObject.fir.kt | 11 -- .../enum/inner/redeclarationInClassObject.kt | 1 + .../tests/enum/inner/twoEnums.fir.kt | 4 - .../diagnostics/tests/enum/inner/twoEnums.kt | 1 + .../tests/enum/javaEnumValueOfMethod.fir.kt | 10 - .../tests/enum/javaEnumValueOfMethod.kt | 1 + .../tests/enum/javaEnumValuesMethod.fir.kt | 11 -- .../tests/enum/javaEnumValuesMethod.kt | 1 + .../tests/enum/javaEnumWithAbstractFun.fir.kt | 16 -- .../tests/enum/javaEnumWithAbstractFun.kt | 1 + .../tests/enum/javaEnumWithFuns.fir.kt | 16 -- .../tests/enum/javaEnumWithFuns.kt | 1 + .../tests/enum/javaEnumWithProperty.fir.kt | 19 -- .../tests/enum/javaEnumWithProperty.kt | 1 + .../diagnostics/tests/enum/kt2834.fir.kt | 6 - .../testData/diagnostics/tests/enum/kt2834.kt | 1 + .../tests/enum/multipleConstructors.fir.kt | 8 - .../tests/enum/multipleConstructors.kt | 1 + .../starImportNestedClassAndEntries.fir.kt | 24 --- .../enum/starImportNestedClassAndEntries.kt | 1 + ...aluesValueOfAndEntriesAccessibility.fir.kt | 18 -- .../valuesValueOfAndEntriesAccessibility.kt | 1 + .../diagnostics/tests/evaluate/float.fir.kt | 10 - .../diagnostics/tests/evaluate/float.kt | 1 + .../tests/evaluate/noOverflowWithZero.fir.kt | 11 -- .../tests/evaluate/noOverflowWithZero.kt | 1 + .../evaluate/numberBinaryOperations.fir.kt | 26 --- .../tests/evaluate/numberBinaryOperations.kt | 1 + .../numberBinaryOperationsCall.fir.kt | 26 --- .../evaluate/numberBinaryOperationsCall.kt | 1 + .../diagnostics/tests/exposed/delegate.fir.kt | 6 - .../diagnostics/tests/exposed/delegate.kt | 1 + .../tests/exposed/implements.fir.kt | 4 - .../diagnostics/tests/exposed/implements.kt | 1 + .../tests/exposed/internalAndProtected.fir.kt | 10 - .../tests/exposed/internalAndProtected.kt | 1 + .../tests/exposed/localFromInternal.fir.kt | 7 - .../tests/exposed/localFromInternal.kt | 1 + .../tests/exposed/localFromPrivate.fir.kt | 15 -- .../tests/exposed/localFromPrivate.kt | 1 + .../diagnostics/tests/exposed/nested.fir.kt | 6 - .../diagnostics/tests/exposed/nested.kt | 1 + .../tests/exposed/privateFromLocal.fir.kt | 12 -- .../tests/exposed/privateFromLocal.kt | 1 + ...privatePropertyInPrivateConstructor.fir.kt | 3 - .../privatePropertyInPrivateConstructor.kt | 1 + ...propertyInConstructorOfPrivateClass.fir.kt | 3 - .../propertyInConstructorOfPrivateClass.kt | 1 + .../tests/exposed/protectedJava.fir.kt | 16 -- .../tests/exposed/protectedJava.kt | 1 + .../tests/exposed/protectedSameWay.fir.kt | 13 -- .../tests/exposed/protectedSameWay.kt | 1 + .../tests/extensions/GenericIterator.fir.kt | 36 ---- .../tests/extensions/GenericIterator.kt | 1 + .../extensionMemberInClassObject.fir.kt | 19 -- .../extensionMemberInClassObject.kt | 1 + .../extensionPropertyVsParameter.fir.kt | 8 - .../extensionPropertyVsParameter.kt | 1 + .../tests/extensions/kt2317.fir.kt | 15 -- .../diagnostics/tests/extensions/kt2317.kt | 1 + .../tests/extensions/kt3470.fir.kt | 7 - .../diagnostics/tests/extensions/kt3470.kt | 1 + .../extensions/noClassObjectsInJava.fir.kt | 11 -- .../tests/extensions/noClassObjectsInJava.kt | 1 + .../tests/extensions/object.fir.kt | 6 - .../diagnostics/tests/extensions/object.kt | 1 + .../tests/fileDependencyRecursion.fir.kt | 15 -- .../tests/fileDependencyRecursion.kt | 1 + .../funInterface/basicFunInterface.fir.kt | 5 - .../tests/funInterface/basicFunInterface.kt | 1 + .../basicFunInterfaceConversion.fir.kt | 12 -- .../basicFunInterfaceConversion.kt | 1 + .../funInterfaceSyntheticConstructors.fir.kt | 15 -- .../funInterfaceSyntheticConstructors.kt | 1 + .../genericSubstitutionForFunInterface.fir.kt | 25 --- .../genericSubstitutionForFunInterface.kt | 1 + .../severalConversionsForFunInterface.fir.kt | 33 ---- .../severalConversionsForFunInterface.kt | 1 + .../suspendFunInterfaceConversion.fir.kt | 14 -- .../suspendFunInterfaceConversion.kt | 1 + .../tests/functionAsExpression/Common.fir.kt | 19 -- .../tests/functionAsExpression/Common.kt | 1 + .../DifficultInferenceForParameter.fir.kt | 7 - .../DifficultInferenceForParameter.kt | 1 + .../NoOverloadError.fir.kt | 18 -- .../functionAsExpression/NoOverloadError.kt | 1 + .../ReturnAndLabels.fir.kt | 9 - .../functionAsExpression/ReturnAndLabels.kt | 1 + .../functionAsExpression/ScopeCheck.fir.kt | 20 -- .../tests/functionAsExpression/ScopeCheck.kt | 1 + .../WithOuterGeneric.fir.kt | 31 --- .../functionAsExpression/WithOuterGeneric.kt | 1 + .../assignmentOperationInLambda.fir.kt | 17 -- .../assignmentOperationInLambda.kt | 1 + .../extensionComponents.fir.kt | 53 ------ .../extensionComponents.kt | 1 + .../destructuringInLambdas/shadowing.fir.kt | 25 --- .../destructuringInLambdas/shadowing.kt | 1 + ...onExpressionAsLastExpressionInBlock.fir.kt | 15 -- ...nctionExpressionAsLastExpressionInBlock.kt | 1 + .../functionLiteralInIf.fir.kt | 15 -- .../functionLiterals/functionLiteralInIf.kt | 1 + ...ericFunctionalTypeOnRHSOfPlusAssign.fir.kt | 11 -- .../genericFunctionalTypeOnRHSOfPlusAssign.kt | 1 + .../tests/functionLiterals/kt2906.fir.kt | 22 --- .../tests/functionLiterals/kt2906.kt | 1 + ...ixingTypeVariableForAnotherArgument.fir.kt | 14 -- ...ileFixingTypeVariableForAnotherArgument.kt | 1 + .../return/IfInReturnedExpression.fir.kt | 9 - .../return/IfInReturnedExpression.kt | 1 + .../return/LambdaWithParameter.fir.kt | 17 -- .../return/LambdaWithParameter.kt | 1 + .../LocalReturnExplicitLabelNoParens.fir.kt | 6 - .../LocalReturnExplicitLabelNoParens.kt | 1 + .../LocalReturnExplicitLabelParens.fir.kt | 12 -- .../return/LocalReturnExplicitLabelParens.kt | 1 + .../return/LocalReturnInNestedFunction.fir.kt | 12 -- .../return/LocalReturnInNestedFunction.kt | 1 + .../return/LocalReturnInNestedLambda.fir.kt | 11 -- .../return/LocalReturnInNestedLambda.kt | 1 + .../return/LocalReturnNull.fir.kt | 14 -- .../return/LocalReturnNull.kt | 1 + .../return/LocalReturnUnit.fir.kt | 9 - .../return/LocalReturnUnit.kt | 1 + .../return/LocalReturnWithExplicitUnit.fir.kt | 16 -- .../return/LocalReturnWithExplicitUnit.kt | 1 + .../return/MixedReturnsFromLambda.fir.kt | 14 -- .../return/MixedReturnsFromLambda.kt | 1 + .../tests/functionLiterals/returnNull.fir.kt | 10 - .../tests/functionLiterals/returnNull.kt | 1 + .../tests/generics/PseudoRawTypes.fir.kt | 25 --- .../tests/generics/PseudoRawTypes.kt | 1 + .../commonSupertypeContravariant.fir.kt | 10 - .../generics/commonSupertypeContravariant.kt | 1 + .../commonSupertypeContravariant2.fir.kt | 9 - .../generics/commonSupertypeContravariant2.kt | 1 + .../fromOuterClassInObjectLiteral.fir.kt | 15 -- .../fromOuterClassInObjectLiteral.kt | 1 + .../innerClasses/innerSuperCall.fir.kt | 9 - .../generics/innerClasses/innerSuperCall.kt | 1 + .../innerSuperCallSecondary.fir.kt | 12 -- .../innerClasses/innerSuperCallSecondary.kt | 1 + .../tests/generics/innerClasses/kt3357.fir.kt | 18 -- .../tests/generics/innerClasses/kt3357.kt | 1 + .../tests/generics/innerClasses/kt408.fir.kt | 12 -- .../tests/generics/innerClasses/kt408.kt | 1 + .../generics/innerClasses/simpleOut.fir.kt | 37 ---- .../tests/generics/innerClasses/simpleOut.kt | 1 + .../tests/generics/kt1575-Class.fir.kt | 1 - .../tests/generics/kt1575-Class.kt | 1 + .../tests/generics/kt1575-Function.fir.kt | 2 - .../tests/generics/kt1575-Function.kt | 1 + .../tests/generics/kt9203_1.fir.kt | 18 -- .../diagnostics/tests/generics/kt9203_1.kt | 1 + .../capturedTypeWithPlatformSupertype.fir.kt | 17 -- .../capturedTypeWithPlatformSupertype.kt | 1 + ...stitutionForIncorporationConstraint.fir.kt | 17 -- ...tSubstitutionForIncorporationConstraint.kt | 1 + .../tests/generics/nullability/kt25182.fir.kt | 14 -- .../tests/generics/nullability/kt25182.kt | 1 + .../extensionResultSubstitution.fir.kt | 13 -- .../extensionResultSubstitution.kt | 1 + .../flexibleProjectedScope.fir.kt | 16 -- .../flexibleProjectedScope.kt | 1 + .../iterateOnExtension.fir.kt | 11 -- .../projectionsScope/iterateOnExtension.kt | 1 + .../generics/projectionsScope/kt8647.fir.kt | 8 - .../tests/generics/projectionsScope/kt8647.kt | 1 + .../recursiveUpperBoundStarOut.fir.kt | 12 -- .../recursiveUpperBoundStarOut.kt | 1 + .../tests/generics/recursive.fir.kt | 11 -- .../diagnostics/tests/generics/recursive.kt | 1 + ...esolveGenericBoundsBeforeSupertypes.fir.kt | 7 - .../resolveGenericBoundsBeforeSupertypes.kt | 1 + .../generics/sameTypeParameterUse.fir.kt | 15 -- .../tests/generics/sameTypeParameterUse.kt | 1 + .../starProjections/checkBounds.fir.kt | 3 - .../generics/starProjections/checkBounds.kt | 1 + .../collectionInheritedFromJava.fir.kt | 14 -- .../collectionInheritedFromJava.kt | 1 + .../starProjections/inheritedFromJava.fir.kt | 14 -- .../starProjections/inheritedFromJava.kt | 1 + .../inheritedFromKotlin.fir.kt | 9 - .../starProjections/inheritedFromKotlin.kt | 1 + .../GenericAsReifiedArgument.fir.kt | 24 --- .../tpAsReified/GenericAsReifiedArgument.kt | 1 + .../tpAsReified/InlineableReified.fir.kt | 8 - .../generics/tpAsReified/InlineableReified.kt | 1 + .../AllUnderImportsLessPriority.fir.kt | 17 -- .../imports/AllUnderImportsLessPriority.kt | 1 + ...UnderImportsSamePriorityForProperty.fir.kt | 19 -- .../AllUnderImportsSamePriorityForProperty.kt | 1 + .../tests/imports/ClassClash.fir.kt | 81 -------- .../diagnostics/tests/imports/ClassClash.kt | 1 + .../CurrentPackageAndAllUnderImport.fir.kt | 16 -- .../CurrentPackageAndAllUnderImport.kt | 1 + .../CurrentPackageAndExplicitImport.fir.kt | 16 -- .../CurrentPackageAndExplicitImport.kt | 1 + ...ImportHidingDefinitionInTheSameFile.fir.kt | 9 - .../ImportHidingDefinitionInTheSameFile.kt | 1 + .../ImportNestedWithDifferentName.fir.kt | 10 - .../imports/ImportNestedWithDifferentName.kt | 1 + .../ImportObjectHidesCurrentPackage.fir.kt | 12 -- .../ImportObjectHidesCurrentPackage.kt | 1 + .../imports/ImportResolutionOrder.fir.kt | 23 --- .../tests/imports/ImportResolutionOrder.kt | 1 + .../tests/imports/ImportTwoTimes.fir.kt | 14 -- .../tests/imports/ImportTwoTimes.kt | 1 + .../tests/imports/ImportTwoTimesStar.fir.kt | 14 -- .../tests/imports/ImportTwoTimesStar.kt | 1 + .../tests/imports/ImportsConflicting.fir.kt | 15 -- .../tests/imports/ImportsConflicting.kt | 1 + .../tests/imports/PackageVsClass.fir.kt | 152 --------------- .../tests/imports/PackageVsClass.kt | 1 + .../imports/TopLevelClassVsPackage.fir.kt | 68 ------- .../tests/imports/TopLevelClassVsPackage.kt | 1 + .../importFunctionWithAllUnderImport.fir.kt | 13 -- .../importFunctionWithAllUnderImport.kt | 1 + ...nWithAllUnderImportAfterNamedImport.fir.kt | 22 --- ...ctionWithAllUnderImportAfterNamedImport.kt | 1 + .../incompleteCode/arrayBracketsRange.fir.kt | 9 - .../incompleteCode/arrayBracketsRange.kt | 1 + .../declarationAfterIncompleteElvis.fir.kt | 22 --- .../declarationAfterIncompleteElvis.kt | 1 + .../funEquals.fir.kt | 1 - .../diagnosticWithSyntaxError/funEquals.kt | 1 + .../funKeyword.fir.kt | 1 - .../diagnosticWithSyntaxError/funKeyword.kt | 1 + .../incompleteEnumReference.fir.kt | 11 -- .../incompleteEnumReference.kt | 1 + .../incompleteVal.fir.kt | 3 - .../incompleteVal.kt | 1 + .../incompleteValWithAccessor.fir.kt | 3 - .../incompleteValWithAccessor.kt | 1 + .../valNoName.fir.kt | 43 ----- .../diagnosticWithSyntaxError/valNoName.kt | 1 + ...eBeforeNextDeclarationWithModifiers.fir.kt | 15 -- ...oNameBeforeNextDeclarationWithModifiers.kt | 1 + .../capturedInProjectedFlexibleType.fir.kt | 16 -- .../capturedInProjectedFlexibleType.kt | 1 + .../capturedTypeWithInnerTypealias.fir.kt | 12 -- .../capturedTypeWithInnerTypealias.kt | 1 + ...pturedTypeWithTypeVariableSubtyping.fir.kt | 22 --- .../capturedTypeWithTypeVariableSubtyping.kt | 1 + .../invokeCallWithCapturedReceiver.fir.kt | 10 - .../invokeCallWithCapturedReceiver.kt | 1 + .../inference/capturedTypes/kt25302.fir.kt | 18 -- .../tests/inference/capturedTypes/kt25302.kt | 1 + .../notApproximateWhenCopyDescriptors.fir.kt | 7 - .../notApproximateWhenCopyDescriptors.kt | 1 + .../starProjectionRegression.fir.kt | 17 -- .../capturedTypes/starProjectionRegression.kt | 1 + .../topLevelCapturingInsideReturnType.fir.kt | 11 -- .../topLevelCapturingInsideReturnType.kt | 1 + ...coercionToUnitForLastLambdaInLambda.fir.kt | 13 -- .../coercionToUnitForLastLambdaInLambda.kt | 1 + .../coercionWithExplicitTypeArgument.fir.kt | 10 - .../coercionWithExplicitTypeArgument.kt | 1 + .../boundOnNullableVariable.fir.kt | 6 - .../commonSystem/boundOnNullableVariable.kt | 1 + .../dontCaptureTypeVariable.fir.kt | 11 -- .../commonSystem/dontCaptureTypeVariable.kt | 1 + .../fixVariablesInRightOrder.fir.kt | 17 -- .../commonSystem/fixVariablesInRightOrder.kt | 1 + .../genericCandidateInGenericClass.fir.kt | 9 - .../genericCandidateInGenericClass.kt | 1 + .../inferenceWithUpperBoundsInLambda.fir.kt | 13 -- .../inferenceWithUpperBoundsInLambda.kt | 1 + .../inference/commonSystem/kt31969.fir.kt | 12 -- .../tests/inference/commonSystem/kt31969.kt | 1 + .../manyArgumentsForVararg.fir.kt | 178 ------------------ .../commonSystem/manyArgumentsForVararg.kt | 1 + .../outProjectedTypeToOutProjected.fir.kt | 12 -- .../outProjectedTypeToOutProjected.kt | 1 + ...tFromCovariantAndContravariantTypes.fir.kt | 20 -- ...electFromCovariantAndContravariantTypes.kt | 1 + .../selectIntegerValueTypeFromIf.fir.kt | 8 - .../selectIntegerValueTypeFromIf.kt | 1 + .../completion/anonymousFunction.fir.kt | 22 --- .../inference/completion/anonymousFunction.kt | 1 + .../equalityConstraintUpstairs.fir.kt | 17 -- .../completion/equalityConstraintUpstairs.kt | 1 + .../tests/inference/completion/kt36233.fir.kt | 13 -- .../tests/inference/completion/kt36233.kt | 1 + .../completion/transitiveConstraint.fir.kt | 15 -- .../completion/transitiveConstraint.kt | 1 + .../earlyCompletionForCalls.fir.kt | 15 -- .../constraints/earlyCompletionForCalls.kt | 1 + ...inferTypeFromCapturedStarProjection.fir.kt | 5 - .../inferTypeFromCapturedStarProjection.kt | 1 + ...t7351ConstraintFromUnitExpectedType.fir.kt | 19 -- .../kt7351ConstraintFromUnitExpectedType.kt | 1 + .../tests/inference/constraints/kt7433.fir.kt | 9 - .../tests/inference/constraints/kt7433.kt | 1 + .../operationsOnIntegerValueTypes.fir.kt | 9 - .../operationsOnIntegerValueTypes.kt | 1 + ...recursiveJavaTypeWithStarProjection.fir.kt | 22 --- .../recursiveJavaTypeWithStarProjection.kt | 1 + ...aintContainingTypeWithoutProjection.fir.kt | 30 --- ...nstraintContainingTypeWithoutProjection.kt | 1 + ...tionWithDefNotNullTypesAndDelegates.fir.kt | 15 -- ...ximationWithDefNotNullTypesAndDelegates.kt | 1 + ...pectedTypeFromCastComplexExpression.fir.kt | 16 -- .../expectedTypeFromCastComplexExpression.kt | 1 + .../flexibleTypesAsUpperBound.fir.kt | 13 -- .../inference/flexibleTypesAsUpperBound.kt | 1 + .../tests/inference/immutableArrayList.fir.kt | 17 -- .../tests/inference/immutableArrayList.kt | 1 + ...sectionTypeMultipleBoundsAsReceiver.fir.kt | 13 -- ...ntersectionTypeMultipleBoundsAsReceiver.kt | 1 + .../inference/intersectionWithEnum.fir.kt | 26 --- .../tests/inference/intersectionWithEnum.kt | 1 + .../tests/inference/kt32434.fir.kt | 32 ---- .../diagnostics/tests/inference/kt32434.kt | 1 + .../tests/inference/kt35702.fir.kt | 41 ---- .../diagnostics/tests/inference/kt35702.kt | 1 + .../diagnostics/tests/inference/kt619.fir.kt | 4 - .../diagnostics/tests/inference/kt619.kt | 1 + .../inference/lambdaArgumentWithLabel.fir.kt | 29 --- .../inference/lambdaArgumentWithLabel.kt | 1 + .../localFunctionInsideIfBlock.fir.kt | 10 - .../inference/localFunctionInsideIfBlock.kt | 1 + .../inference/nestedCalls/arrayAccess.fir.kt | 11 -- .../inference/nestedCalls/arrayAccess.kt | 1 + ...eteNestedCallsForArraySetExpression.fir.kt | 8 - ...ompleteNestedCallsForArraySetExpression.kt | 1 + .../completeNestedCallsInference.fir.kt | 19 -- .../completeNestedCallsInference.kt | 1 + .../inferenceForNestedBinaryCall.fir.kt | 12 -- .../inferenceForNestedBinaryCall.kt | 1 + .../preferArgumentToNullability.fir.kt | 15 -- .../preferArgumentToNullability.kt | 1 + ...ancyOnVariableWithTrivialConstraint.fir.kt | 15 -- ...pendancyOnVariableWithTrivialConstraint.kt | 1 + ...natedNothingInsideComplexNestedCall.fir.kt | 12 -- ...riminatedNothingInsideComplexNestedCall.kt | 1 + ...erateConstraintWithInnerNothingType.fir.kt | 13 -- .../generateConstraintWithInnerNothingType.kt | 1 + ...implicitNothingConstraintFromReturn.fir.kt | 15 -- .../implicitNothingConstraintFromReturn.kt | 1 + .../inference/nothingType/kt24490.fir.kt | 13 -- .../tests/inference/nothingType/kt24490.kt | 1 + .../inference/nothingType/kt32081.fir.kt | 10 - .../tests/inference/nothingType/kt32081.kt | 1 + .../inference/nothingType/kt32207.fir.kt | 15 -- .../tests/inference/nothingType/kt32207.kt | 1 + ...ferenceWithIncorporationOfVariables.fir.kt | 12 -- ...daInferenceWithIncorporationOfVariables.kt | 1 + .../nothingWithCallableReference.fir.kt | 31 --- .../nothingWithCallableReference.kt | 1 + .../tests/inference/opposite.fir.kt | 11 -- .../diagnostics/tests/inference/opposite.kt | 1 + .../tests/inference/regressions/kt1358.fir.kt | 12 -- .../tests/inference/regressions/kt1358.kt | 1 + .../tests/inference/regressions/kt1944.fir.kt | 14 -- .../tests/inference/regressions/kt1944.kt | 1 + .../tests/inference/regressions/kt2294.fir.kt | 18 -- .../tests/inference/regressions/kt2294.kt | 1 + .../tests/inference/regressions/kt2484.fir.kt | 18 -- .../tests/inference/regressions/kt2484.kt | 1 + .../tests/inference/regressions/kt2505.fir.kt | 22 --- .../tests/inference/regressions/kt2505.kt | 1 + .../tests/inference/regressions/kt2514.fir.kt | 16 -- .../tests/inference/regressions/kt2514.kt | 1 + .../tests/inference/regressions/kt2588.fir.kt | 18 -- .../tests/inference/regressions/kt2588.kt | 1 + .../inference/regressions/kt2841_it.fir.kt | 20 -- .../tests/inference/regressions/kt2841_it.kt | 1 + .../regressions/kt2841_it_this.fir.kt | 21 --- .../inference/regressions/kt2841_it_this.kt | 1 + .../inference/regressions/kt2841_this.fir.kt | 20 -- .../inference/regressions/kt2841_this.kt | 1 + .../tests/inference/regressions/kt3174.fir.kt | 12 -- .../tests/inference/regressions/kt3174.kt | 1 + .../inference/regressions/kt32106.fir.kt | 20 -- .../tests/inference/regressions/kt32106.kt | 1 + .../tests/inference/regressions/kt3344.fir.kt | 16 -- .../tests/inference/regressions/kt3344.kt | 1 + .../inference/regressions/kt37043.fir.kt | 19 -- .../tests/inference/regressions/kt37043.kt | 1 + .../tests/inference/regressions/kt8132.fir.kt | 11 -- .../tests/inference/regressions/kt8132.kt | 1 + .../tests/inference/starApproximation.fir.kt | 22 --- .../tests/inference/starApproximation.kt | 1 + .../starApproximationBangBang.fir.kt | 24 --- .../inference/starApproximationBangBang.kt | 1 + .../starApproximationFlexible.fir.kt | 29 --- .../inference/starApproximationFlexible.kt | 1 + ...oximationFromDifferentTypeParameter.fir.kt | 20 -- ...ApproximationFromDifferentTypeParameter.kt | 1 + .../delegationAndInference.fir.kt | 14 -- .../substitutions/delegationAndInference.kt | 1 + .../kt6081SubstituteIntoClassCorrectly.fir.kt | 14 -- .../kt6081SubstituteIntoClassCorrectly.kt | 1 + ...yNumberLowerBoundsBeforeUpperBounds.fir.kt | 6 - .../tryNumberLowerBoundsBeforeUpperBounds.kt | 1 + .../typeParameterInConstructor.fir.kt | 5 - .../inference/typeParameterInConstructor.kt | 1 + .../upperBounds/nonNullUpperBound.fir.kt | 13 -- .../upperBounds/nonNullUpperBound.kt | 1 + .../useFunctionLiteralsToInferType.fir.kt | 16 -- .../useFunctionLiteralsToInferType.kt | 1 + .../tests/inline/anonymousObjects.fir.kt | 12 -- .../tests/inline/anonymousObjects.kt | 1 + .../diagnostics/tests/inline/default.fir.kt | 15 -- .../diagnostics/tests/inline/default.kt | 1 + .../tests/inline/inlineReified.fir.kt | 2 - .../diagnostics/tests/inline/inlineReified.kt | 1 + .../nonLocalReturns/explicitReturnType.fir.kt | 41 ---- .../nonLocalReturns/explicitReturnType.kt | 1 + .../nonLocalReturns/fromOnlyLocal.fir.kt | 8 - .../inline/nonLocalReturns/fromOnlyLocal.kt | 1 + .../nonLocalReturns/inlineLambda.fir.kt | 16 -- .../inline/nonLocalReturns/inlineLambda.kt | 1 + .../nonLocalReturns/nestedNonLocals.fir.kt | 41 ---- .../inline/nonLocalReturns/nestedNonLocals.kt | 1 + .../inNonPublicInnerClass.fir.kt | 36 ---- .../nonPublicMember/inNonPublicInnerClass.kt | 1 + .../inline/nonPublicMember/localClass.fir.kt | 15 -- .../inline/nonPublicMember/localClass.kt | 1 + .../inline/unaryExpressions/notOnCall.fir.kt | 3 - .../inline/unaryExpressions/notOnCall.kt | 1 + ...sJvmSignaturesConflictOnInheritance.fir.kt | 14 -- ...tionsJvmSignaturesConflictOnInheritance.kt | 1 + ...onstructorParameterWithDefaultValue.fir.kt | 3 - ...assConstructorParameterWithDefaultValue.kt | 1 + .../inlineClassImplementsCollection.fir.kt | 12 -- .../inlineClassImplementsCollection.kt | 1 + .../tests/inner/enumEntries.fir.kt | 12 -- .../diagnostics/tests/inner/enumEntries.kt | 1 + .../tests/inner/extensionFun.fir.kt | 28 --- .../diagnostics/tests/inner/extensionFun.kt | 1 + ...rClassInEnumEntryClassMemberResolve.fir.kt | 13 -- ...innerClassInEnumEntryClassMemberResolve.kt | 1 + .../diagnostics/tests/inner/localClass.fir.kt | 18 -- .../diagnostics/tests/inner/localClass.kt | 1 + .../tests/inner/localClassInsideNested.fir.kt | 11 -- .../tests/inner/localClassInsideNested.kt | 1 + .../inner/nestedClassExtendsOuter.fir.kt | 8 - .../tests/inner/nestedClassExtendsOuter.kt | 1 + .../nestedClassExtendsOuterGeneric.fir.kt | 12 -- .../inner/nestedClassExtendsOuterGeneric.kt | 1 + .../tests/inner/nestedClassInObject.fir.kt | 16 -- .../tests/inner/nestedClassInObject.kt | 1 + .../tests/inner/outerProtectedMember.fir.kt | 13 -- .../tests/inner/outerProtectedMember.kt | 1 + .../tests/inner/outerSuperClassMember.fir.kt | 9 - .../tests/inner/outerSuperClassMember.kt | 1 + .../classObjectOfNestedClass.fir.kt | 14 -- .../classObjectOfNestedClass.kt | 1 + .../dataLocalVariable.fir.kt | 5 - .../qualifiedExpression/dataLocalVariable.kt | 1 + .../qualifiedExpression/enumConstant.fir.kt | 7 - .../inner/qualifiedExpression/enumConstant.kt | 1 + .../importNestedClass.fir.kt | 17 -- .../qualifiedExpression/importNestedClass.kt | 1 + .../nestedClassInPackage.fir.kt | 8 - .../nestedClassInPackage.kt | 1 + .../nestedEnumConstant.fir.kt | 9 - .../qualifiedExpression/nestedEnumConstant.kt | 1 + .../qualifiedExpression/nestedObjects.fir.kt | 7 - .../qualifiedExpression/nestedObjects.kt | 1 + .../qualifiedExpression/typePosition.fir.kt | 11 -- .../inner/qualifiedExpression/typePosition.kt | 1 + .../inner/resolvePackageClassInObjects.fir.kt | 9 - .../inner/resolvePackageClassInObjects.kt | 1 + .../diagnostics/tests/inner/traits.fir.kt | 11 -- .../diagnostics/tests/inner/traits.kt | 1 + .../tests/j+k/GenericsInSupertypes.fir.kt | 49 ----- .../tests/j+k/GenericsInSupertypes.kt | 1 + .../tests/j+k/InheritedGenericFunction.fir.kt | 30 --- .../tests/j+k/InheritedGenericFunction.kt | 1 + .../tests/j+k/InnerClassFromJava.fir.kt | 16 -- .../tests/j+k/InnerClassFromJava.kt | 1 + .../tests/j+k/KJKInheritance.fir.kt | 18 -- .../diagnostics/tests/j+k/KJKInheritance.kt | 1 + .../tests/j+k/KJKInheritanceGeneric.fir.kt | 17 -- .../tests/j+k/KJKInheritanceGeneric.kt | 1 + .../tests/j+k/OverrideVararg.fir.kt | 12 -- .../diagnostics/tests/j+k/OverrideVararg.kt | 1 + .../diagnostics/tests/j+k/Simple.fir.kt | 11 -- .../testData/diagnostics/tests/j+k/Simple.kt | 1 + .../j+k/StaticMembersFromSuperclasses.fir.kt | 16 -- .../j+k/StaticMembersFromSuperclasses.kt | 1 + ...peArgumentsNullability-SpecialTypes.fir.kt | 20 -- ...ertypeArgumentsNullability-SpecialTypes.kt | 1 + ...rtypeArgumentsNullability-UserTypes.fir.kt | 20 -- ...SupertypeArgumentsNullability-UserTypes.kt | 1 + .../tests/j+k/UnboxingNulls.fir.kt | 13 -- .../diagnostics/tests/j+k/UnboxingNulls.kt | 1 + ...ionWithArgumentsMissingDependencies.fir.kt | 12 -- ...otationWithArgumentsMissingDependencies.kt | 1 + .../tests/j+k/annotationsInheritance.fir.kt | 19 -- .../tests/j+k/annotationsInheritance.kt | 1 + .../j+k/brokenCode/classDuplicates.fir.kt | 13 -- .../tests/j+k/brokenCode/classDuplicates.kt | 1 + ...callableReferencesStaticMemberClash.fir.kt | 16 -- .../callableReferencesStaticMemberClash.kt | 1 + .../j+k/collectionOverrides/charBuffer.fir.kt | 22 --- .../j+k/collectionOverrides/charBuffer.kt | 1 + .../collectionStringImpl.fir.kt | 85 --------- .../collectionStringImpl.kt | 1 + .../getCharSequence.fir.kt | 30 --- .../collectionOverrides/getCharSequence.kt | 1 + .../irrelevantCharAtAbstract.fir.kt | 19 -- .../irrelevantCharAtAbstract.kt | 1 + .../irrelevantImplCharSequence.fir.kt | 25 --- .../irrelevantImplCharSequence.kt | 1 + .../irrelevantImplCharSequenceKotlin.fir.kt | 28 --- .../irrelevantImplCharSequenceKotlin.kt | 1 + .../irrelevantMapGetAbstract.fir.kt | 19 -- .../irrelevantMapGetAbstract.kt | 1 + .../collectionOverrides/mapGetOverride.fir.kt | 14 -- .../j+k/collectionOverrides/mapGetOverride.kt | 1 + .../j+k/collectionOverrides/removeAt.fir.kt | 23 --- .../tests/j+k/collectionOverrides/removeAt.kt | 1 + .../collectionOverrides/removeAtInt.fir.kt | 23 --- .../j+k/collectionOverrides/removeAtInt.kt | 1 + .../sizeFromKotlinOverriddenInJava.fir.kt | 13 -- .../sizeFromKotlinOverriddenInJava.kt | 1 + .../j+k/computeIfAbsentConcurrent.fir.kt | 22 --- .../tests/j+k/computeIfAbsentConcurrent.kt | 1 + .../tests/j+k/contravariantIterable.fir.kt | 20 -- .../tests/j+k/contravariantIterable.kt | 1 + .../tests/j+k/enumGetOrdinal.fir.kt | 12 -- .../diagnostics/tests/j+k/enumGetOrdinal.kt | 1 + .../tests/j+k/exceptionMessage.fir.kt | 20 -- .../diagnostics/tests/j+k/exceptionMessage.kt | 1 + .../tests/j+k/flexibleNothing.fir.kt | 19 -- .../diagnostics/tests/j+k/flexibleNothing.kt | 1 + .../j+k/genericConstructor/selfTypes.fir.kt | 19 -- .../tests/j+k/genericConstructor/selfTypes.kt | 1 + .../j+k/inheritAbstractSamAdapter.fir.kt | 18 -- .../tests/j+k/inheritAbstractSamAdapter.kt | 1 + .../tests/j+k/javaStaticImport.fir.kt | 37 ---- .../diagnostics/tests/j+k/javaStaticImport.kt | 1 + .../diagnostics/tests/j+k/kt1402.fir.kt | 26 --- .../testData/diagnostics/tests/j+k/kt1402.kt | 1 + .../diagnostics/tests/j+k/kt1431.fir.kt | 17 -- .../testData/diagnostics/tests/j+k/kt1431.kt | 1 + .../j+k/kt1730_implementCharSequence.fir.kt | 24 --- .../tests/j+k/kt1730_implementCharSequence.kt | 1 + .../diagnostics/tests/j+k/kt2152.fir.kt | 10 - .../testData/diagnostics/tests/j+k/kt2152.kt | 1 + .../diagnostics/tests/j+k/kt2394.fir.kt | 15 -- .../testData/diagnostics/tests/j+k/kt2394.kt | 1 + .../diagnostics/tests/j+k/kt3307.fir.kt | 21 --- .../testData/diagnostics/tests/j+k/kt3307.kt | 1 + .../diagnostics/tests/j+k/kt3311.fir.kt | 19 -- .../testData/diagnostics/tests/j+k/kt3311.kt | 1 + .../diagnostics/tests/j+k/kt7523.fir.kt | 14 -- .../testData/diagnostics/tests/j+k/kt7523.kt | 1 + .../diagnostics/tests/j+k/matchers.fir.kt | 18 -- .../diagnostics/tests/j+k/matchers.kt | 1 + .../tests/j+k/mutableIterator.fir.kt | 29 --- .../diagnostics/tests/j+k/mutableIterator.kt | 1 + .../tests/j+k/nullForOptionalOrElse.fir.kt | 9 - .../tests/j+k/nullForOptionalOrElse.kt | 1 + .../tests/j+k/overrideRawType.fir.kt | 15 -- .../diagnostics/tests/j+k/overrideRawType.kt | 1 + .../overrideWithSamAndTypeParameter.fir.kt | 22 --- .../j+k/overrideWithSamAndTypeParameter.kt | 1 + .../packagePrivateClassStaticMember.fir.kt | 17 -- .../j+k/packagePrivateClassStaticMember.kt | 1 + .../inlineClassErasedToPrimitiveInt.fir.kt | 29 --- .../inlineClassErasedToPrimitiveInt.kt | 1 + .../j+k/privateFieldOverridesNothing.fir.kt | 19 -- .../tests/j+k/privateFieldOverridesNothing.kt | 1 + .../tests/j+k/properties/interface.fir.kt | 32 ---- .../tests/j+k/properties/interface.kt | 1 + .../j+k/protectedStaticSamePackage.fir.kt | 20 -- .../tests/j+k/protectedStaticSamePackage.kt | 1 + .../tests/j+k/recursiveRawUpperBound.fir.kt | 13 -- .../tests/j+k/recursiveRawUpperBound.kt | 1 + .../tests/j+k/recursiveRawUpperBound2.fir.kt | 8 - .../tests/j+k/recursiveRawUpperBound2.kt | 1 + .../tests/j+k/recursiveRawUpperBound3.fir.kt | 8 - .../tests/j+k/recursiveRawUpperBound3.kt | 1 + .../fakeOverrideFunctionForStaticSam.fir.kt | 20 -- .../sam/fakeOverrideFunctionForStaticSam.kt | 1 + .../tests/j+k/sam/inheritedStaticSam.fir.kt | 13 -- .../tests/j+k/sam/inheritedStaticSam.kt | 1 + .../j+k/sam/recursiveSamsAndInvoke.fir.kt | 28 --- .../tests/j+k/sam/recursiveSamsAndInvoke.kt | 1 + .../tests/j+k/sam/samOnTypeParameter.fir.kt | 17 -- .../tests/j+k/sam/samOnTypeParameter.kt | 1 + .../sam/staticSamFromImportWithStar.fir.kt | 17 -- .../j+k/sam/staticSamFromImportWithStar.kt | 1 + .../sam/staticSamWithExplicitImport.fir.kt | 17 -- .../j+k/sam/staticSamWithExplicitImport.kt | 1 + .../j+k/sam/typeInferenceOnSamAdapters.fir.kt | 19 -- .../j+k/sam/typeInferenceOnSamAdapters.kt | 1 + .../tests/j+k/sam/withDefaultMethods.fir.kt | 22 --- .../tests/j+k/sam/withDefaultMethods.kt | 1 + .../genericInValueParameter.fir.kt | 32 ---- .../genericInValueParameter.kt | 1 + .../genericSuperWildcard.fir.kt | 25 --- .../genericSuperWildcard.kt | 1 + .../j+k/samInConstructorWithGenerics.fir.kt | 23 --- .../tests/j+k/samInConstructorWithGenerics.kt | 1 + .../tests/j+k/samWithConsumer.fir.kt | 23 --- .../diagnostics/tests/j+k/samWithConsumer.kt | 1 + .../j+k/shadowingPrimitiveStaticField.fir.kt | 24 --- .../j+k/shadowingPrimitiveStaticField.kt | 1 + .../notNullVarargOverride.fir.kt | 22 --- .../notNullVarargOverride.kt | 1 + .../nullableVarargOverride.fir.kt | 22 --- .../nullableVarargOverride.kt | 1 + .../reorderedParameterNames.fir.kt | 17 -- .../reorderedParameterNames.kt | 1 + .../stableParameterName.fir.kt | 20 -- .../stableParameterName.kt | 1 + .../staticMethodWithDefaultValue.fir.kt | 17 -- .../staticMethodWithDefaultValue.kt | 1 + .../tests/j+k/specialBridges.fir.kt | 7 - .../diagnostics/tests/j+k/specialBridges.kt | 1 + .../hashtableInheritance.fir.kt | 6 - .../specialBuiltIns/hashtableInheritance.kt | 1 + .../specialBuiltIns/securityProvider.fir.kt | 5 - .../j+k/specialBuiltIns/securityProvider.kt | 1 + .../tests/j+k/staticMethodInClass.fir.kt | 16 -- .../tests/j+k/staticMethodInClass.kt | 1 + .../j+k/typeAliasWithSamConstructor.fir.kt | 18 -- .../tests/j+k/typeAliasWithSamConstructor.kt | 1 + .../tests/j+k/types/arrayList.fir.kt | 15 -- .../diagnostics/tests/j+k/types/arrayList.kt | 1 + .../tests/j+k/types/returnCollection.fir.kt | 13 -- .../tests/j+k/types/returnCollection.kt | 1 + .../shapeMismatchInCovariantPosition.fir.kt | 19 -- .../types/shapeMismatchInCovariantPosition.kt | 1 + ...eMismatchInCovariantPositionGeneric.fir.kt | 19 -- ...shapeMismatchInCovariantPositionGeneric.kt | 1 + .../tests/j+k/types/typeParameter.fir.kt | 11 -- .../tests/j+k/types/typeParameter.kt | 1 + .../java8Overrides/notAMethodOfAny.fir.kt | 3 - .../tests/java8Overrides/notAMethodOfAny.kt | 1 + .../singleRelevantDefault.fir.kt | 9 - .../java8Overrides/singleRelevantDefault.kt | 1 + .../testData/diagnostics/tests/kt53.fir.kt | 6 - compiler/testData/diagnostics/tests/kt53.kt | 1 + .../diagnostics/tests/labels/kt3920.fir.kt | 9 - .../diagnostics/tests/labels/kt3920.kt | 1 + .../diagnostics/tests/labels/kt4586.fir.kt | 17 -- .../diagnostics/tests/labels/kt4586.kt | 1 + .../diagnostics/tests/labels/kt4603.fir.kt | 12 -- .../diagnostics/tests/labels/kt4603.kt | 1 + .../tests/lateinit/local/localLateinit.fir.kt | 7 - .../tests/lateinit/local/localLateinit.kt | 1 + .../tests/lateinit/local/uninitialized.fir.kt | 24 --- .../tests/lateinit/local/uninitialized.kt | 1 + .../modifiers/const/fromJavaSubclass.fir.kt | 15 -- .../tests/modifiers/const/fromJavaSubclass.kt | 1 + .../tests/modifiers/const/kt12248.fir.kt | 19 -- .../tests/modifiers/const/kt12248.kt | 1 + .../tests/modifiers/const/kt15913.fir.kt | 19 -- .../tests/modifiers/const/kt15913.kt | 1 + .../collectionMethodStub.fir.kt | 21 --- .../duplicateClass/collectionMethodStub.kt | 1 + .../duplicateClass/duplicateClass.fir.kt | 32 ---- .../duplicateClass/duplicateClass.kt | 1 + .../duplicateClass/duplicateSuperClass.fir.kt | 30 --- .../duplicateClass/duplicateSuperClass.kt | 1 + .../inTheSameModuleWithUsage.fir.kt | 23 --- .../inTheSameModuleWithUsage.kt | 1 + .../sameGenericArguments.fir.kt | 29 --- .../duplicateClass/sameGenericArguments.kt | 1 + .../classGenericsInParams.fir.kt | 36 ---- .../duplicateMethod/classGenericsInParams.kt | 1 + .../classGenericsInParamsBoundMismatch.fir.kt | 38 ---- .../classGenericsInParamsBoundMismatch.kt | 1 + .../classGenericsInParamsNameMismatch.fir.kt | 36 ---- .../classGenericsInParamsNameMismatch.kt | 1 + .../classGenericsInReturnType.fir.kt | 36 ---- .../classGenericsInReturnType.kt | 1 + .../differenceInParamNames.fir.kt | 36 ---- .../duplicateMethod/differenceInParamNames.kt | 1 + .../duplicateMethod/extensionMatch.fir.kt | 36 ---- .../duplicateMethod/extensionMatch.kt | 1 + .../functionGenericsInParams.fir.kt | 42 ----- .../functionGenericsInParams.kt | 1 + .../functionGenericsInParamsEqNull.fir.kt | 52 ----- .../functionGenericsInParamsEqNull.kt | 1 + .../functionGenericsInParamsNotIs.fir.kt | 40 ---- .../functionGenericsInParamsNotIs.kt | 1 + .../functionGenericsInParamsReturnFooT.fir.kt | 44 ----- .../functionGenericsInParamsReturnFooT.kt | 1 + .../functionGenericsInParamsReturnT.fir.kt | 40 ---- .../functionGenericsInParamsReturnT.kt | 1 + .../duplicateMethod/noGenericsInParams.fir.kt | 35 ---- .../duplicateMethod/noGenericsInParams.kt | 1 + .../duplicateMethod/noParams.fir.kt | 36 ---- .../multimodule/duplicateMethod/noParams.kt | 1 + .../sameGenericsInParams.fir.kt | 43 ----- .../duplicateMethod/sameGenericsInParams.kt | 1 + .../differentSuperTraits.fir.kt | 31 --- .../duplicateSuper/differentSuperTraits.kt | 1 + .../duplicateSuper/sameSuperTrait.fir.kt | 26 --- .../duplicateSuper/sameSuperTrait.kt | 1 + .../sameSuperTraitDifferentBounds.fir.kt | 29 --- .../sameSuperTraitDifferentBounds.kt | 1 + .../sameSuperTraitGenerics.fir.kt | 26 --- .../duplicateSuper/sameSuperTraitGenerics.kt | 1 + .../tests/multimodule/kt14249.fir.kt | 20 -- .../diagnostics/tests/multimodule/kt14249.kt | 1 + .../tests/multimodule/varargConflict.fir.kt | 26 --- .../tests/multimodule/varargConflict.kt | 1 + .../annotationArgumentEquality.fir.kt | 89 --------- .../annotationArgumentEquality.kt | 1 + .../annotationsViaActualTypeAlias2.fir.kt | 79 -------- .../annotationsViaActualTypeAlias2.kt | 1 + .../enum/additionalEntriesInImpl.fir.kt | 10 - .../enum/additionalEntriesInImpl.kt | 1 + .../enum/differentEntryOrder.fir.kt | 10 - .../multiplatform/enum/differentEntryOrder.kt | 1 + .../tests/multiplatform/enum/javaEnum.fir.kt | 32 ---- .../tests/multiplatform/enum/javaEnum.kt | 1 + .../multiplatform/enum/simpleEnum.fir.kt | 16 -- .../tests/multiplatform/enum/simpleEnum.kt | 1 + .../functionTypeParameterBounds.fir.kt | 12 -- .../generic/functionTypeParameterBounds.kt | 1 + .../generic/genericMemberBounds.fir.kt | 25 --- .../generic/genericMemberBounds.kt | 1 + .../generic/membersInGenericClass.fir.kt | 18 -- .../generic/membersInGenericClass.kt | 1 + .../headerClass/classKinds.fir.kt | 26 --- .../multiplatform/headerClass/classKinds.kt | 1 + .../headerClass/expectFinalActualOpen.fir.kt | 27 --- .../headerClass/expectFinalActualOpen.kt | 1 + .../functionAndPropertyWithSameName.fir.kt | 15 -- .../functionAndPropertyWithSameName.kt | 1 + .../headerClass/headerClassMember.fir.kt | 24 --- .../headerClass/headerClassMember.kt | 1 + .../headerClass/implDataClass.fir.kt | 32 ---- .../headerClass/implDataClass.kt | 1 + .../headerClass/implOpenClass.fir.kt | 18 -- .../headerClass/implOpenClass.kt | 1 + ...ssiveVisibilityOnActualViaTypeAlias.fir.kt | 22 --- ...ermissiveVisibilityOnActualViaTypeAlias.kt | 1 + .../headerClass/nestedClasses.fir.kt | 58 ------ .../headerClass/nestedClasses.kt | 1 + .../headerClass/simpleHeaderClass.fir.kt | 12 -- .../headerClass/simpleHeaderClass.kt | 1 + .../headerClass/smartCastOnExpectClass.fir.kt | 13 -- .../headerClass/smartCastOnExpectClass.kt | 1 + .../multiplatform/implDelegatedMember.fir.kt | 19 -- .../multiplatform/implDelegatedMember.kt | 1 + .../tests/multiplatform/implDynamic.fir.kt | 29 --- .../tests/multiplatform/implDynamic.kt | 1 + .../multiplatform/implFakeOverride.fir.kt | 16 -- .../tests/multiplatform/implFakeOverride.kt | 1 + .../multiplatform/java/flexibleTypes.fir.kt | 32 ---- .../tests/multiplatform/java/flexibleTypes.kt | 1 + .../multiplatform/java/parameterNames.fir.kt | 18 -- .../multiplatform/java/parameterNames.kt | 1 + .../multiplatform/sealedTypeAlias.fir.kt | 17 -- .../tests/multiplatform/sealedTypeAlias.kt | 1 + .../sealedTypeAliasTopLevel.fir.kt | 16 -- .../multiplatform/sealedTypeAliasTopLevel.kt | 1 + .../topLevelFun/callHeaderFun.fir.kt | 25 --- .../topLevelFun/callHeaderFun.kt | 1 + .../topLevelFun/functionModifiers.fir.kt | 19 -- .../topLevelFun/functionModifiers.kt | 1 + .../topLevelFun/headerWithoutImpl.fir.kt | 5 - .../topLevelFun/headerWithoutImpl.kt | 1 + .../topLevelFun/simpleHeaderFun.fir.kt | 12 -- .../topLevelFun/simpleHeaderFun.kt | 1 + .../topLevelProperty/simpleHeaderVar.fir.kt | 12 -- .../topLevelProperty/simpleHeaderVar.kt | 1 + .../allowForJavaAnnotation.fir.kt | 12 -- .../namedArguments/allowForJavaAnnotation.kt | 1 + .../namedArgumentsInOverloads.fir.kt | 14 -- .../namedArgumentsInOverloads.kt | 1 + .../PreferExtensionsOnNullableReceiver.fir.kt | 9 - .../PreferExtensionsOnNullableReceiver.kt | 1 + .../equalityUnderNotNullCheck.fir.kt | 5 - .../equalityUnderNotNullCheck.kt | 1 + .../noSenselessNullOnNullableType.fir.kt | 21 --- .../noSenselessNullOnNullableType.kt | 1 + ...ecessaryNotNullAssertionOnErrorType.fir.kt | 7 - ...oUnnecessaryNotNullAssertionOnErrorType.kt | 1 + .../tests/nullableTypes/elvisOnUnit.fir.kt | 11 -- .../tests/nullableTypes/elvisOnUnit.kt | 1 + .../nullableTypes/safeAccessOnUnit.fir.kt | 7 - .../tests/nullableTypes/safeAccessOnUnit.kt | 1 + .../numberAsUnionAndIntersection.fir.kt | 22 --- .../numbers/numberAsUnionAndIntersection.kt | 1 + ...lableReferencesWithQualificationNew.fir.kt | 142 -------------- .../callableReferencesWithQualificationNew.kt | 1 + ...lableReferencesWithQualificationOld.fir.kt | 142 -------------- .../callableReferencesWithQualificationOld.kt | 1 + ...CompanionObjectWithQualificationNew.fir.kt | 99 ---------- ...FromCompanionObjectWithQualificationNew.kt | 1 + ...CompanionObjectWithQualificationOld.fir.kt | 98 ---------- ...FromCompanionObjectWithQualificationOld.kt | 1 + .../classifierIsVisibleByTwoPaths.fir.kt | 17 -- .../kt21515/classifierIsVisibleByTwoPaths.kt | 1 + ...dFromDeprecatedWithQualificationNew.fir.kt | 100 ---------- ...ritedFromDeprecatedWithQualificationNew.kt | 1 + ...dFromDeprecatedWithQualificationOld.fir.kt | 100 ---------- ...ritedFromDeprecatedWithQualificationOld.kt | 1 + ...staticsFromJavaWithQualificationNew.fir.kt | 53 ------ .../staticsFromJavaWithQualificationNew.kt | 1 + ...staticsFromJavaWithQualificationOld.fir.kt | 53 ------ .../staticsFromJavaWithQualificationOld.kt | 1 + ...atedConstructorWithQualificationNew.fir.kt | 100 ---------- ...precatedConstructorWithQualificationNew.kt | 1 + ...atedConstructorWithQualificationOld.fir.kt | 100 ---------- ...precatedConstructorWithQualificationOld.kt | 1 + .../objects/localObjectInsideObject.fir.kt | 11 -- .../tests/objects/localObjectInsideObject.kt | 1 + .../tests/objects/objectInsideFun.fir.kt | 11 -- .../tests/objects/objectInsideFun.kt | 1 + .../tests/operatorRem/operatorRem.fir.kt | 15 -- .../tests/operatorRem/operatorRem.kt | 1 + .../tests/operatorsOverloading/kt13349.fir.kt | 7 - .../tests/operatorsOverloading/kt13349.kt | 1 + .../tests/operatorsOverloading/kt3450.fir.kt | 23 --- .../tests/operatorsOverloading/kt3450.kt | 1 + .../overload/ExtFunDifferentReceiver.fir.kt | 3 - .../tests/overload/ExtFunDifferentReceiver.kt | 1 + .../FunNoConflictInDifferentPackages.fir.kt | 13 -- .../FunNoConflictInDifferentPackages.kt | 1 + .../overload/OverloadFunRegularAndExt.fir.kt | 7 - .../overload/OverloadFunRegularAndExt.kt | 1 + .../overload/OverloadVarAndFunInClass.fir.kt | 4 - .../overload/OverloadVarAndFunInClass.kt | 1 + .../overload/SyntheticAndNotSynthetic.fir.kt | 7 - .../overload/SyntheticAndNotSynthetic.kt | 1 + .../overload/UnsubstitutedJavaGenetics.fir.kt | 17 -- .../overload/UnsubstitutedJavaGenetics.kt | 1 + .../diagnostics/tests/overload/kt10939.fir.kt | 28 --- .../diagnostics/tests/overload/kt10939.kt | 1 + .../diagnostics/tests/overload/kt1998.fir.kt | 14 -- .../diagnostics/tests/overload/kt1998.kt | 1 + .../diagnostics/tests/overload/kt7068.fir.kt | 17 -- .../diagnostics/tests/overload/kt7068.kt | 1 + .../tests/overload/kt7068_2.fir.kt | 17 -- .../diagnostics/tests/overload/kt7068_2.kt | 1 + .../diagnostics/tests/overload/kt7440.fir.kt | 17 -- .../diagnostics/tests/overload/kt7440.kt | 1 + .../override/AbstractFunImplemented.fir.kt | 7 - .../tests/override/AbstractFunImplemented.kt | 1 + .../override/AbstractValImplemented.fir.kt | 7 - .../tests/override/AbstractValImplemented.kt | 1 + .../override/AbstractVarImplemented.fir.kt | 7 - .../tests/override/AbstractVarImplemented.kt | 1 + ...rrorsWhenInheritingFromOneTypeTwice.fir.kt | 15 -- ...-NoErrorsWhenInheritingFromOneTypeTwice.kt | 1 + .../tests/override/DelegationFun.fir.kt | 7 - .../tests/override/DelegationFun.kt | 1 + .../tests/override/DelegationVal.fir.kt | 7 - .../tests/override/DelegationVal.kt | 1 + .../tests/override/DelegationVar.fir.kt | 7 - .../tests/override/DelegationVar.kt | 1 + .../EqualityOfIntersectionTypes.fir.kt | 15 -- .../override/EqualityOfIntersectionTypes.kt | 1 + ...keOverrideAbstractAndNonAbstractFun.fir.kt | 9 - .../FakeOverrideAbstractAndNonAbstractFun.kt | 1 + .../InvisiblePotentialOverride.fir.kt | 7 - .../override/InvisiblePotentialOverride.kt | 1 + ...es-DefaultValueFromOnlyOneSupertype.fir.kt | 11 -- ...Values-DefaultValueFromOnlyOneSupertype.kt | 1 + .../override/PropertyInConstructor.fir.kt | 11 -- .../tests/override/PropertyInConstructor.kt | 1 + .../tests/override/SuspiciousCase1.fir.kt | 12 -- .../tests/override/SuspiciousCase1.kt | 1 + .../flexibleReturnType.fir.kt | 27 --- .../flexibleReturnType.kt | 1 + .../flexibleReturnTypeIn.fir.kt | 61 ------ .../flexibleReturnTypeIn.kt | 1 + .../genericWithUpperBound.fir.kt | 56 ------ .../genericWithUpperBound.kt | 1 + .../tests/override/fakeEquals.fir.kt | 9 - .../diagnostics/tests/override/fakeEquals.kt | 1 + .../diagnostics/tests/override/kt6014.fir.kt | 17 -- .../diagnostics/tests/override/kt6014.kt | 1 + .../diagnostics/tests/override/kt8990.fir.kt | 11 -- .../diagnostics/tests/override/kt8990.kt | 1 + .../parameterNames/jjkHierarchy.fir.kt | 16 -- .../override/parameterNames/jjkHierarchy.kt | 1 + .../kjkWithSeveralSupers.fir.kt | 51 ----- .../parameterNames/kjkWithSeveralSupers.kt | 1 + .../parameterNames/kotlinInheritsJava.fir.kt | 18 -- .../parameterNames/kotlinInheritsJava.kt | 1 + .../classAndTwoInterfaceBounds.fir.kt | 31 --- .../classAndTwoInterfaceBounds.kt | 1 + .../override/typeParameters/kt9850.fir.kt | 8 - .../tests/override/typeParameters/kt9850.kt | 1 + .../simpleVisitorTwoAccepts.fir.kt | 10 - .../typeParameters/simpleVisitorTwoAccepts.kt | 1 + ...tationsOnNullableParenthesizedTypes.fir.kt | 29 --- ...annotationsOnNullableParenthesizedTypes.kt | 1 + .../annotationsOnParenthesizedTypes.fir.kt | 31 --- .../annotationsOnParenthesizedTypes.kt | 1 + .../commonSupertype/collectionOrNull.fir.kt | 19 -- .../commonSupertype/collectionOrNull.kt | 1 + .../commonSupertype/inferenceWithBound.fir.kt | 41 ---- .../commonSupertype/inferenceWithBound.kt | 1 + .../commonSupertype/mixedElvis.fir.kt | 13 -- .../commonSupertype/mixedElvis.kt | 1 + .../commonSupertype/mixedIf.fir.kt | 21 --- .../platformTypes/commonSupertype/mixedIf.kt | 1 + .../commonSupertype/recursiveGeneric.fir.kt | 35 ---- .../commonSupertype/recursiveGeneric.kt | 1 + .../commonSupertype/stringOrNull.fir.kt | 19 -- .../commonSupertype/stringOrNull.kt | 1 + .../commonSupertype/typeOfElvis.fir.kt | 20 -- .../commonSupertype/typeOfElvis.kt | 1 + .../delegateByComplexInheritance.fir.kt | 15 -- .../delegateByComplexInheritance.kt | 1 + .../tests/platformTypes/dereference.fir.kt | 30 --- .../tests/platformTypes/dereference.kt | 1 + .../tests/platformTypes/elvis.fir.kt | 16 -- .../diagnostics/tests/platformTypes/elvis.kt | 1 + .../genericVarianceViolation/rawTypes.fir.kt | 14 -- .../genericVarianceViolation/rawTypes.kt | 1 + .../userDefinedOut.fir.kt | 17 -- .../userDefinedOut.kt | 1 + .../genericVarianceViolation/wildcards.fir.kt | 49 ----- .../genericVarianceViolation/wildcards.kt | 1 + .../platformTypes/getParentOfType.fir.kt | 36 ---- .../tests/platformTypes/getParentOfType.kt | 1 + .../platformTypes/intersection/map.fir.kt | 12 -- .../tests/platformTypes/intersection/map.kt | 1 + .../tests/platformTypes/javaEmptyList.fir.kt | 25 --- .../tests/platformTypes/javaEmptyList.kt | 1 + .../platformTypes/methodCall/entrySet.fir.kt | 24 --- .../platformTypes/methodCall/entrySet.kt | 1 + .../flexibilityThroughTypeVariable.fir.kt | 18 -- .../flexibilityThroughTypeVariable.kt | 1 + .../flexibilityThroughTypeVariableOut.fir.kt | 20 -- .../flexibilityThroughTypeVariableOut.kt | 1 + .../methodCall/genericsAndArrays.fir.kt | 24 --- .../methodCall/genericsAndArrays.kt | 1 + .../platformTypes/methodCall/intArray.fir.kt | 16 -- .../platformTypes/methodCall/intArray.kt | 1 + .../methodCall/javaCollectionToKotlin.fir.kt | 9 - .../methodCall/javaCollectionToKotlin.kt | 1 + .../methodCall/javaToJava.fir.kt | 20 -- .../platformTypes/methodCall/javaToJava.kt | 1 + .../methodCall/javaToKotlin.fir.kt | 18 -- .../platformTypes/methodCall/javaToKotlin.kt | 1 + .../methodCall/kotlinCollectionToJava.fir.kt | 7 - .../methodCall/kotlinCollectionToJava.kt | 1 + .../platformTypes/methodCall/kt27565.fir.kt | 21 --- .../tests/platformTypes/methodCall/kt27565.kt | 1 + .../platformTypes/methodCall/list.fir.kt | 18 -- .../tests/platformTypes/methodCall/list.kt | 1 + .../methodCall/objectArray.fir.kt | 23 --- .../platformTypes/methodCall/objectArray.kt | 1 + .../methodCall/overloadingForSubclass.fir.kt | 30 --- .../methodCall/overloadingForSubclass.kt | 1 + .../tests/platformTypes/methodCall/sam.fir.kt | 26 --- .../tests/platformTypes/methodCall/sam.kt | 1 + .../platformTypes/methodCall/string.fir.kt | 16 -- .../tests/platformTypes/methodCall/string.kt | 1 + .../platformTypes/methodCall/visitor.fir.kt | 26 --- .../tests/platformTypes/methodCall/visitor.kt | 1 + .../methodTypeParameterDefaultBound.fir.kt | 25 --- .../methodTypeParameterDefaultBound.kt | 1 + .../enhancementFromKotlin.fir.kt | 28 --- .../enhancementFromKotlin.kt | 1 + .../inferenceInConditionals.fir.kt | 27 --- .../inferenceInConditionals.kt | 1 + .../noWarningOnDoubleElvis.fir.kt | 8 - .../noWarningOnDoubleElvis.kt | 1 + .../notNullAfterSafeCall.fir.kt | 16 -- .../notNullAfterSafeCall.kt | 1 + .../tests/platformTypes/override.fir.kt | 26 --- .../tests/platformTypes/override.kt | 1 + .../platformTypes/rawTypes/errorType.fir.kt | 12 -- .../tests/platformTypes/rawTypes/errorType.kt | 1 + .../rawTypes/interClassesRecursion.fir.kt | 4 - .../rawTypes/interClassesRecursion.kt | 1 + .../rawTypes/rawEnhancment.fir.kt | 17 -- .../platformTypes/rawTypes/rawEnhancment.kt | 1 + .../rawTypes/rawTypeInUpperBound.fir.kt | 38 ---- .../rawTypes/rawTypeInUpperBound.kt | 1 + .../rawTypes/rawWithInProjection.fir.kt | 11 -- .../rawTypes/rawWithInProjection.kt | 1 + .../rawTypes/recursiveBound.fir.kt | 15 -- .../platformTypes/rawTypes/recursiveBound.kt | 1 + ...saveRawCapabilitiesAfterSubtitution.fir.kt | 20 -- .../saveRawCapabilitiesAfterSubtitution.kt | 1 + .../rawTypes/starProjectionToRaw.fir.kt | 25 --- .../rawTypes/starProjectionToRaw.kt | 1 + .../tests/platformTypes/safeCall.fir.kt | 15 -- .../tests/platformTypes/safeCall.kt | 1 + .../samAdapterInConstructor.fir.kt | 14 -- .../platformTypes/samAdapterInConstructor.kt | 1 + .../tests/platformTypes/samConstructor.fir.kt | 17 -- .../tests/platformTypes/samConstructor.kt | 1 + .../supertypeTypeArguments.fir.kt | 3 - .../platformTypes/supertypeTypeArguments.kt | 1 + .../tests/privateInFile/kt12429.fir.kt | 4 - .../tests/privateInFile/kt12429.kt | 1 + ...roperDefaultInitializationInTailrec.fir.kt | 39 ---- .../properDefaultInitializationInTailrec.kt | 1 + .../GenericClassVsPackage.fir.kt | 76 -------- .../GenericClassVsPackage.kt | 1 + .../qualifiedExpression/JavaQualifier.fir.kt | 9 - .../qualifiedExpression/JavaQualifier.kt | 1 + .../qualifiedExpression/PackageVsClass.fir.kt | 88 --------- .../qualifiedExpression/PackageVsClass.kt | 1 + .../PackageVsClass2.fir.kt | 33 ---- .../qualifiedExpression/PackageVsClass2.kt | 1 + .../PackageVsRootClass.fir.kt | 44 ----- .../qualifiedExpression/PackageVsRootClass.kt | 1 + .../tests/reassignment/noifelse.fir.kt | 6 - .../tests/reassignment/noifelse.kt | 1 + .../tests/recovery/emptyTypeArgs.fir.kt | 3 - .../tests/recovery/emptyTypeArgs.kt | 1 + ...eclarationForClassesInDefaultObject.fir.kt | 12 -- ...oRedeclarationForClassesInDefaultObject.kt | 1 + .../PropertyAndFunInClass.fir.kt | 9 - .../redeclarations/PropertyAndFunInClass.kt | 1 + .../RedeclarationMainInMultiFile.fir.kt | 5 - .../RedeclarationMainInMultiFile.kt | 1 + .../RedeclarationParameterlessMain.fir.kt | 5 - .../RedeclarationParameterlessMain.kt | 1 + ...RedeclarationSuspendMainInMultiFile.fir.kt | 5 - .../RedeclarationSuspendMainInMultiFile.kt | 1 + .../extensionFunVsMemberExtensionFun.fir.kt | 5 - .../extensionFunVsMemberExtensionFun.kt | 1 + .../extensionOnNullableReceiver.fir.kt | 7 - .../extensionOnNullableReceiver.kt | 1 + .../tests/regressions/Jet121.fir.kt | 14 -- .../diagnostics/tests/regressions/Jet121.kt | 1 + .../tests/regressions/Jet17.fir.kt | 6 - .../diagnostics/tests/regressions/Jet17.kt | 1 + .../tests/regressions/Jet183-1.fir.kt | 21 --- .../diagnostics/tests/regressions/Jet183-1.kt | 1 + .../tests/regressions/Jet53.fir.kt | 5 - .../diagnostics/tests/regressions/Jet53.kt | 1 + .../tests/regressions/Jet67.fir.kt | 4 - .../diagnostics/tests/regressions/Jet67.kt | 1 + .../tests/regressions/Jet68.fir.kt | 11 -- .../diagnostics/tests/regressions/Jet68.kt | 1 + .../regressions/OverrideResolution.fir.kt | 16 -- .../tests/regressions/OverrideResolution.kt | 1 + .../regressions/delegationWithReceiver.fir.kt | 10 - .../regressions/delegationWithReceiver.kt | 1 + .../tests/regressions/ea40964.fir.kt | 8 - .../diagnostics/tests/regressions/ea40964.kt | 1 + .../tests/regressions/ea43298.fir.kt | 3 - .../diagnostics/tests/regressions/ea43298.kt | 1 + .../tests/regressions/ea53340.fir.kt | 7 - .../diagnostics/tests/regressions/ea53340.kt | 1 + .../tests/regressions/ea69735.fir.kt | 5 - .../diagnostics/tests/regressions/ea69735.kt | 1 + .../tests/regressions/intchar.fir.kt | 1 - .../diagnostics/tests/regressions/intchar.kt | 1 + .../tests/regressions/kt13954.fir.kt | 26 --- .../diagnostics/tests/regressions/kt13954.kt | 1 + .../tests/regressions/kt14740.fir.kt | 20 -- .../diagnostics/tests/regressions/kt14740.kt | 1 + .../tests/regressions/kt1550.fir.kt | 12 -- .../diagnostics/tests/regressions/kt1550.kt | 1 + .../tests/regressions/kt16086.fir.kt | 21 --- .../diagnostics/tests/regressions/kt16086.kt | 1 + .../tests/regressions/kt1647.fir.kt | 11 -- .../diagnostics/tests/regressions/kt1647.kt | 1 + .../tests/regressions/kt2376.fir.kt | 10 - .../diagnostics/tests/regressions/kt2376.kt | 1 + .../tests/regressions/kt26-1.fir.kt | 9 - .../diagnostics/tests/regressions/kt26-1.kt | 1 + .../diagnostics/tests/regressions/kt26.fir.kt | 12 -- .../diagnostics/tests/regressions/kt26.kt | 1 + .../tests/regressions/kt28001.fir.kt | 32 ---- .../diagnostics/tests/regressions/kt28001.kt | 1 + .../tests/regressions/kt316.fir.kt | 10 - .../diagnostics/tests/regressions/kt316.kt | 1 + .../tests/regressions/kt32836.fir.kt | 17 -- .../diagnostics/tests/regressions/kt32836.kt | 1 + .../tests/regressions/kt337.fir.kt | 14 -- .../diagnostics/tests/regressions/kt337.kt | 1 + .../tests/regressions/kt3535.fir.kt | 9 - .../diagnostics/tests/regressions/kt3535.kt | 1 + .../tests/regressions/kt3647.fir.kt | 9 - .../diagnostics/tests/regressions/kt3647.kt | 1 + .../tests/regressions/kt3731.fir.kt | 17 -- .../diagnostics/tests/regressions/kt3731.kt | 1 + .../tests/regressions/kt385.109.441.fir.kt | 33 ---- .../tests/regressions/kt385.109.441.kt | 1 + .../tests/regressions/kt394.fir.kt | 11 -- .../diagnostics/tests/regressions/kt394.kt | 1 + .../tests/regressions/kt469.fir.kt | 28 --- .../diagnostics/tests/regressions/kt469.kt | 1 + .../tests/regressions/kt4693.fir.kt | 8 - .../diagnostics/tests/regressions/kt4693.kt | 1 + .../tests/regressions/kt549.fir.kt | 17 -- .../diagnostics/tests/regressions/kt549.kt | 1 + .../tests/regressions/kt571.fir.kt | 3 - .../diagnostics/tests/regressions/kt571.kt | 1 + .../tests/regressions/kt575.fir.kt | 32 ---- .../diagnostics/tests/regressions/kt575.kt | 1 + .../tests/regressions/kt580.fir.kt | 22 --- .../diagnostics/tests/regressions/kt580.kt | 1 + .../tests/regressions/kt588.fir.kt | 14 -- .../diagnostics/tests/regressions/kt588.kt | 1 + .../tests/regressions/kt604.fir.kt | 20 -- .../diagnostics/tests/regressions/kt604.kt | 1 + .../tests/regressions/kt630.fir.kt | 6 - .../diagnostics/tests/regressions/kt630.kt | 1 + .../tests/regressions/kt691.fir.kt | 2 - .../diagnostics/tests/regressions/kt691.kt | 1 + .../tests/regressions/kt743.fir.kt | 7 - .../diagnostics/tests/regressions/kt743.kt | 1 + .../tests/regressions/kt750.fir.kt | 10 - .../diagnostics/tests/regressions/kt750.kt | 1 + .../regressions/kt7585/twoparents.fir.kt | 16 -- .../tests/regressions/kt7585/twoparents.kt | 1 + .../tests/regressions/kt847.fir.kt | 4 - .../diagnostics/tests/regressions/kt847.kt | 1 + .../tests/regressions/kt860.fir.kt | 14 -- .../diagnostics/tests/regressions/kt860.kt | 1 + .../tests/regressions/kt9808.fir.kt | 8 - .../diagnostics/tests/regressions/kt9808.kt | 1 + .../propertyWithExtensionTypeInvoke.fir.kt | 7 - .../propertyWithExtensionTypeInvoke.kt | 1 + .../anonymousObjectFromTopLevelMember.fir.kt | 24 --- .../anonymousObjectFromTopLevelMember.kt | 1 + .../tests/resolve/dslMarker/kt29948.fir.kt | 19 -- .../tests/resolve/dslMarker/kt29948.kt | 1 + .../tests/resolve/dslMarker/kt31360.fir.kt | 25 --- .../tests/resolve/dslMarker/kt31360.kt | 1 + ...kedReceiverWithCapturedTypeArgument.fir.kt | 11 -- .../markedReceiverWithCapturedTypeArgument.kt | 1 + .../dslMarker/unsupportedFeature.fir.kt | 28 --- .../resolve/dslMarker/unsupportedFeature.kt | 1 + .../resolve/implicitReceiverProperty.fir.kt | 33 ---- .../tests/resolve/implicitReceiverProperty.kt | 1 + ...inkedLambdasDependentOnExpectedType.fir.kt | 7 - ...eInLinkedLambdasDependentOnExpectedType.kt | 1 + .../resolve/invoke/implicitInvoke.fir.kt | 33 ---- .../tests/resolve/invoke/implicitInvoke.kt | 1 + .../resolve/invoke/invokeAsExtension.fir.kt | 61 ------ .../tests/resolve/invoke/invokeAsExtension.kt | 1 + .../resolve/invoke/invokeAsMember.fir.kt | 60 ------ .../tests/resolve/invoke/invokeAsMember.kt | 1 + .../invoke/invokeAsMemberExtension.fir.kt | 123 ------------ .../resolve/invoke/invokeAsMemberExtension.kt | 1 + .../invokeNonExtensionLambdaInContext.fir.kt | 7 - .../invokeNonExtensionLambdaInContext.kt | 1 + .../kt3833-invokeInsideNestedClass.fir.kt | 35 ---- .../invoke/kt3833-invokeInsideNestedClass.kt | 1 + .../resolve/invoke/kt4321InvokeOnEnum.fir.kt | 35 ---- .../resolve/invoke/kt4321InvokeOnEnum.kt | 1 + .../resolve/invoke/valNamedInvoke.fir.kt | 9 - .../tests/resolve/invoke/valNamedInvoke.kt | 1 + ...analyzeArgsInFreeExpressionPosition.fir.kt | 12 -- .../analyzeArgsInFreeExpressionPosition.kt | 1 + .../tests/resolve/nestedCalls/kt7597.fir.kt | 8 - .../tests/resolve/nestedCalls/kt7597.kt | 1 + .../noStopOnReceiverUnstableSmartCast.fir.kt | 27 --- .../noStopOnReceiverUnstableSmartCast.kt | 1 + .../resolve/objectLiteralAsArgument.fir.kt | 36 ---- .../tests/resolve/objectLiteralAsArgument.kt | 1 + .../extensionReceiverAndVarargs.fir.kt | 12 -- .../extensionReceiverAndVarargs.kt | 1 + .../resolve/overloadConflicts/kt10472.fir.kt | 13 -- .../resolve/overloadConflicts/kt10472.kt | 1 + .../overloadConflicts/numberOfDefaults.fir.kt | 10 - .../overloadConflicts/numberOfDefaults.kt | 1 + .../varargWithMoreSpecificSignature.fir.kt | 9 - .../varargWithMoreSpecificSignature.kt | 1 + .../resolve/overloadConflicts/varargs.fir.kt | 11 -- .../resolve/overloadConflicts/varargs.kt | 1 + .../varargsWithRecursiveGenerics.fir.kt | 21 --- .../varargsWithRecursiveGenerics.kt | 1 + .../priority/invokeExtensionVsOther.fir.kt | 18 -- .../priority/invokeExtensionVsOther.kt | 1 + .../priority/invokeExtensionVsOther2.fir.kt | 13 -- .../priority/invokeExtensionVsOther2.kt | 1 + .../tests/resolve/priority/kt9810.fir.kt | 12 -- .../tests/resolve/priority/kt9810.kt | 1 + .../syntheticPropertiesVsMembers.fir.kt | 36 ---- .../priority/syntheticPropertiesVsMembers.kt | 1 + .../resolveAnnotatedLambdaArgument.fir.kt | 12 -- .../resolve/resolveAnnotatedLambdaArgument.kt | 1 + .../resolveWithFunctionLiterals.fir.kt | 30 --- .../resolve/resolveWithFunctionLiterals.kt | 1 + ...resolveWithFunctionLiteralsOverload.fir.kt | 31 --- .../resolveWithFunctionLiteralsOverload.kt | 1 + ...ameterInDefaultValueInLocalFunction.fir.kt | 7 - ...eParameterInDefaultValueInLocalFunction.kt | 1 + .../samConversions/GenericSubstitution.fir.kt | 29 --- .../samConversions/GenericSubstitution.kt | 1 + .../GenericSubstitutionKT.fir.kt | 27 --- .../samConversions/GenericSubstitutionKT.kt | 1 + .../tests/samConversions/SimpleCorrect.fir.kt | 34 ---- .../tests/samConversions/SimpleCorrect.kt | 1 + .../samConversions/SimpleCorrectKT.fir.kt | 31 --- .../tests/samConversions/SimpleCorrectKT.kt | 1 + ...ndidatesFromKotlinAndJavaInOneScope.fir.kt | 26 --- ...meCandidatesFromKotlinAndJavaInOneScope.kt | 1 + .../AmbiguityBetweenRootAndPackage.fir.kt | 12 -- .../scopes/AmbiguityBetweenRootAndPackage.kt | 1 + .../NoAmbiguityBetweenRootAndPackage.fir.kt | 12 -- .../NoAmbiguityBetweenRootAndPackage.kt | 1 + .../classHeader/simpleDelegation.fir.kt | 10 - .../scopes/classHeader/simpleDelegation.kt | 1 + .../tests/scopes/genericVsNested.fir.kt | 57 ------ .../tests/scopes/genericVsNested.kt | 1 + .../inheritance/companionObjectsOrder.fir.kt | 37 ---- .../inheritance/companionObjectsOrder.kt | 1 + .../inheritance/severalCompanions.fir.kt | 22 --- .../scopes/inheritance/severalCompanions.kt | 1 + .../scopes/inheritance/statics/jjkj.fir.kt | 43 ----- .../tests/scopes/inheritance/statics/jjkj.kt | 1 + .../scopes/inheritance/statics/kjk.fir.kt | 37 ---- .../tests/scopes/inheritance/statics/kjk.kt | 1 + .../statics/oneInterfaceManyTimes.fir.kt | 55 ------ .../statics/oneInterfaceManyTimes.kt | 1 + .../inheritance/statics/overloadStatic.fir.kt | 20 -- .../inheritance/statics/overloadStatic.kt | 1 + .../statics/staticFunVsImport.fir.kt | 50 ----- .../inheritance/statics/staticFunVsImport.kt | 1 + .../statics/staticPropertyVsImport.fir.kt | 59 ------ .../statics/staticPropertyVsImport.kt | 1 + .../statics/staticVsCompanion.fir.kt | 36 ---- .../inheritance/statics/staticVsCompanion.kt | 1 + .../statics/staticsFromjava.fir.kt | 51 ----- .../inheritance/statics/staticsFromjava.kt | 1 + .../statics/staticsFromjavaAfterKotlin.fir.kt | 27 --- .../statics/staticsFromjavaAfterKotlin.kt | 1 + .../diagnostics/tests/scopes/kt1078.fir.kt | 16 -- .../diagnostics/tests/scopes/kt1078.kt | 1 + .../diagnostics/tests/scopes/kt1579.fir.kt | 10 - .../diagnostics/tests/scopes/kt1579.kt | 1 + .../tests/scopes/kt1579_map_entry.fir.kt | 19 -- .../tests/scopes/kt1579_map_entry.kt | 1 + .../diagnostics/tests/scopes/kt1642.fir.kt | 9 - .../diagnostics/tests/scopes/kt1642.kt | 1 + .../diagnostics/tests/scopes/kt2262.fir.kt | 16 -- .../diagnostics/tests/scopes/kt2262.kt | 1 + .../diagnostics/tests/scopes/kt587.fir.kt | 11 -- .../diagnostics/tests/scopes/kt587.kt | 1 + .../diagnostics/tests/scopes/kt939.fir.kt | 18 -- .../diagnostics/tests/scopes/kt939.kt | 1 + .../innerClassInJava.fir.kt | 24 --- .../protectedVisibility/innerClassInJava.kt | 1 + ...SuperCallConstructorJavaSamePackage.fir.kt | 30 --- .../nonSuperCallConstructorJavaSamePackage.kt | 1 + .../tests/scopes/sameClassNameResolve.fir.kt | 10 - .../tests/scopes/sameClassNameResolve.kt | 1 + .../tests/sealed/DoubleInner.fir.kt | 9 - .../diagnostics/tests/sealed/DoubleInner.kt | 1 + .../tests/sealed/ExhaustiveWhen.fir.kt | 16 -- .../tests/sealed/ExhaustiveWhen.kt | 1 + .../sealed/ExhaustiveWhenDoubleInner.fir.kt | 16 -- .../tests/sealed/ExhaustiveWhenDoubleInner.kt | 1 + .../tests/sealed/ExhaustiveWhenNegated.fir.kt | 16 -- .../tests/sealed/ExhaustiveWhenNegated.kt | 1 + .../sealed/ExhaustiveWhenNegatedTwice.fir.kt | 17 -- .../sealed/ExhaustiveWhenNegatedTwice.kt | 1 + .../sealed/ExhaustiveWhenOnNullable.fir.kt | 17 -- .../tests/sealed/ExhaustiveWhenOnNullable.kt | 1 + .../ExhaustiveWhenWithAdditionalMember.fir.kt | 18 -- .../ExhaustiveWhenWithAdditionalMember.kt | 1 + .../sealed/ExhaustiveWhenWithElse.fir.kt | 15 -- .../tests/sealed/ExhaustiveWhenWithElse.kt | 1 + .../diagnostics/tests/sealed/NotFinal.fir.kt | 10 - .../diagnostics/tests/sealed/NotFinal.kt | 1 + .../tests/sealed/OperationWhen.fir.kt | 20 -- .../diagnostics/tests/sealed/OperationWhen.kt | 1 + .../tests/sealed/WithInterface.fir.kt | 10 - .../diagnostics/tests/sealed/WithInterface.kt | 1 + .../classInitializersWithoutPrimary.fir.kt | 4 - .../classInitializersWithoutPrimary.kt | 1 + .../usingOuterInstance.fir.kt | 8 - .../headerCallChecker/usingOuterInstance.kt | 1 + .../usingOuterProperty.fir.kt | 8 - .../headerCallChecker/usingOuterProperty.kt | 1 + .../initializationFromOtherInstance.fir.kt | 15 -- .../initializationFromOtherInstance.kt | 1 + .../lambdaInDelegation.fir.kt | 5 - .../lambdaInDelegation.kt | 1 + .../noDefaultIfEmptySecondary.fir.kt | 4 - .../noDefaultIfEmptySecondary.kt | 1 + ...ertypeInitWithSecondaryConstructors.fir.kt | 6 - ...oSupertypeInitWithSecondaryConstructors.kt | 1 + .../shadowing/ShadowPropertyInClosure.fir.kt | 3 - .../shadowing/ShadowPropertyInClosure.kt | 1 + .../shadowing/ShadowPropertyInFor.fir.kt | 11 -- .../tests/shadowing/ShadowPropertyInFor.kt | 1 + .../shadowing/ShadowPropertyInFunction.fir.kt | 10 - .../shadowing/ShadowPropertyInFunction.kt | 1 + .../noNameShadowingForSimpleParameters.fir.kt | 24 --- .../noNameShadowingForSimpleParameters.kt | 1 + .../smartCasts/falseUnnecessaryCall.fir.kt | 11 -- .../tests/smartCasts/falseUnnecessaryCall.kt | 1 + .../smartCasts/genericIntersection.fir.kt | 7 - .../tests/smartCasts/genericIntersection.kt | 1 + .../smartCasts/implicitToGrandSon.fir.kt | 11 -- .../tests/smartCasts/implicitToGrandSon.kt | 1 + ...OfSmartcastsAgainstGenericFunctions.fir.kt | 13 -- ...lityOfSmartcastsAgainstGenericFunctions.kt | 1 + .../intersectionScope/simple.fir.kt | 12 -- .../smartCasts/intersectionScope/simple.kt | 1 + .../validTypeParametersNoSmartCast.fir.kt | 15 -- .../validTypeParametersNoSmartCast.kt | 1 + .../tests/smartCasts/kt3244.fir.kt | 12 -- .../diagnostics/tests/smartCasts/kt3244.kt | 1 + .../tests/smartCasts/kt3572.fir.kt | 17 -- .../diagnostics/tests/smartCasts/kt3572.kt | 1 + .../lambdaArgumentNoSubstitutedReturn.fir.kt | 19 -- .../lambdaArgumentNoSubstitutedReturn.kt | 1 + .../noUnnecessarySmartCastForReceiver.fir.kt | 7 - .../noUnnecessarySmartCastForReceiver.kt | 1 + .../tests/smartCasts/typeDegradation.fir.kt | 17 -- .../tests/smartCasts/typeDegradation.kt | 1 + .../variables/doWhileWithMiddleBreak.fir.kt | 12 -- .../variables/doWhileWithMiddleBreak.kt | 1 + .../variables/initialization.fir.kt | 8 - .../smartCasts/variables/initialization.kt | 1 + .../tests/smartCasts/variables/kt7599.fir.kt | 23 --- .../tests/smartCasts/variables/kt7599.kt | 1 + .../variables/propertyNotNeeded.fir.kt | 10 - .../smartCasts/variables/propertyNotNeeded.kt | 1 + .../variables/propertySubtype.fir.kt | 10 - .../smartCasts/variables/propertySubtype.kt | 1 + .../variables/propertySubtypeInMember.fir.kt | 10 - .../variables/propertySubtypeInMember.kt | 1 + .../propertySubtypeInMemberCheck.fir.kt | 13 -- .../variables/propertySubtypeInMemberCheck.kt | 1 + .../smartCasts/variables/whileTrue.fir.kt | 13 -- .../tests/smartCasts/variables/whileTrue.kt | 1 + .../smartCasts/varnotnull/unnecessary.fir.kt | 12 -- .../smartCasts/varnotnull/unnecessary.kt | 1 + .../varnotnull/unnecessaryWithBranch.fir.kt | 12 -- .../varnotnull/unnecessaryWithBranch.kt | 1 + .../smartCasts/whenSubjectImpossible.fir.kt | 10 - .../tests/smartCasts/whenSubjectImpossible.kt | 1 + .../whenSubjectImpossibleJava.fir.kt | 11 -- .../smartCasts/whenSubjectImpossibleJava.kt | 1 + .../apiVersion/sinceOldVersionIsOK.fir.kt | 18 -- .../apiVersion/sinceOldVersionIsOK.kt | 1 + .../inlineFunctionAlways.fir.kt | 16 -- .../inlineFunctionAlways.kt | 1 + .../tests/substitutions/kt1558-short.fir.kt | 5 - .../tests/substitutions/kt1558-short.kt | 1 + .../subtyping/functionTypeAsSuperType.fir.kt | 45 ----- .../subtyping/functionTypeAsSuperType.kt | 1 + ...tForTypeParameterWithMultipleBounds.fir.kt | 18 -- ...umentForTypeParameterWithMultipleBounds.kt | 1 + .../tests/subtyping/kt-1457.fir.kt | 12 -- .../diagnostics/tests/subtyping/kt-1457.kt | 1 + .../diagnostics/tests/subtyping/kt2069.fir.kt | 14 -- .../diagnostics/tests/subtyping/kt2069.kt | 1 + ...WarningsOnAnonymousObjectInVariable.fir.kt | 4 - ...ressWarningsOnAnonymousObjectInVariable.kt | 1 + .../suppressWarningsOnClassObject.fir.kt | 6 - .../suppressWarningsOnClassObject.kt | 1 + .../suppressWarningsOnExpression.fir.kt | 4 - .../suppressWarningsOnExpression.kt | 1 + .../allWarnings/suppressWarningsOnFile.fir.kt | 7 - .../allWarnings/suppressWarningsOnFile.kt | 1 + .../suppressWarningsOnFunction.fir.kt | 4 - .../allWarnings/suppressWarningsOnFunction.kt | 1 + .../suppressWarningsOnObject.fir.kt | 4 - .../allWarnings/suppressWarningsOnObject.kt | 1 + .../suppressWarningsOnParameter.fir.kt | 3 - .../suppressWarningsOnParameter.kt | 1 + .../suppressWarningsOnProperty.fir.kt | 4 - .../allWarnings/suppressWarningsOnProperty.kt | 1 + .../suppressWarningsOnPropertyAccessor.fir.kt | 5 - .../suppressWarningsOnPropertyAccessor.kt | 1 + .../javaProperties/AbbreviationName.fir.kt | 20 -- .../javaProperties/AbbreviationName.kt | 1 + .../javaProperties/CompiledClass.fir.kt | 6 - .../javaProperties/CompiledClass.kt | 1 + .../javaProperties/FalseGetters.fir.kt | 21 --- .../javaProperties/FalseGetters.kt | 1 + .../javaProperties/FromTwoBases.fir.kt | 19 -- .../javaProperties/FromTwoBases.kt | 1 + .../javaProperties/GenericClass.fir.kt | 10 - .../javaProperties/GenericClass.kt | 1 + .../javaProperties/GetA.fir.kt | 10 - .../javaProperties/GetA.kt | 1 + .../javaProperties/GetterAndSetter.fir.kt | 14 -- .../javaProperties/GetterAndSetter.kt | 1 + .../javaProperties/OnlyAscii.fir.kt | 22 --- .../javaProperties/OnlyAscii.kt | 1 + .../javaProperties/SetterOnly.fir.kt | 9 - .../javaProperties/SetterOnly.kt | 1 + .../TypeParameterReceiver.fir.kt | 16 -- .../javaProperties/TypeParameterReceiver.kt | 1 + .../samAdapters/PassNull.fir.kt | 10 - .../samAdapters/PassNull.kt | 1 + .../derivedInterfaces.fir.kt | 13 -- .../derivedInterfaces.kt | 1 + .../fillInStackTrace.fir.kt | 4 - .../backwardCompatibility/fillInStackTrace.kt | 1 + .../hashMapGetOrDefault.fir.kt | 6 - .../hashMapGetOrDefault.kt | 1 + .../tests/targetedBuiltIns/removeIf.fir.kt | 12 -- .../tests/targetedBuiltIns/removeIf.kt | 1 + .../tests/thisAndSuper/traitSuperCall.fir.kt | 24 --- .../tests/thisAndSuper/traitSuperCall.kt | 1 + ...qualifiedSuperWithDeeperHierarchies.fir.kt | 51 ----- .../unqualifiedSuperWithDeeperHierarchies.kt | 1 + .../unqualifiedSuperWithGenerics.fir.kt | 22 --- .../unqualifiedSuperWithGenerics.kt | 1 + ...withMethodOfAnyOverridenInInterface.fir.kt | 8 - .../withMethodOfAnyOverridenInInterface.kt | 1 + .../unqualifiedSuper/withMethodsOfAny.fir.kt | 10 - .../unqualifiedSuper/withMethodsOfAny.kt | 1 + .../tests/typealias/aliasesOnly.fir.kt | 8 - .../tests/typealias/aliasesOnly.kt | 1 + .../tests/typealias/classReference.fir.kt | 3 - .../tests/typealias/classReference.kt | 1 + .../tests/typealias/enumEntryQualifier.fir.kt | 6 - .../tests/typealias/enumEntryQualifier.kt | 1 + .../typealias/functionTypeInTypeAlias.fir.kt | 3 - .../typealias/functionTypeInTypeAlias.kt | 1 + .../genericTypeAliasConstructor.fir.kt | 10 - .../typealias/genericTypeAliasConstructor.kt | 1 + .../diagnostics/tests/typealias/import.fir.kt | 25 --- .../diagnostics/tests/typealias/import.kt | 1 + .../typealias/importForTypealiasObject.fir.kt | 18 -- .../typealias/importForTypealiasObject.kt | 1 + .../importFromTypeAliasObject.fir.kt | 15 -- .../typealias/importFromTypeAliasObject.kt | 1 + .../tests/typealias/inGenerics.fir.kt | 12 -- .../diagnostics/tests/typealias/inGenerics.kt | 1 + .../typealias/inheritedNestedTypeAlias.fir.kt | 20 -- .../typealias/inheritedNestedTypeAlias.kt | 1 + .../typealias/innerTypeAliasAsType2.fir.kt | 24 --- .../tests/typealias/innerTypeAliasAsType2.kt | 1 + .../tests/typealias/isAsWithTypeAlias.fir.kt | 5 - .../tests/typealias/isAsWithTypeAlias.kt | 1 + .../tests/typealias/localTypeAlias.fir.kt | 19 -- .../tests/typealias/localTypeAlias.kt | 1 + .../tests/typealias/methodReference.fir.kt | 7 - .../tests/typealias/methodReference.kt | 1 + .../tests/typealias/nestedSubstituted.fir.kt | 9 - .../tests/typealias/nestedSubstituted.kt | 1 + .../diagnostics/tests/typealias/noRHS.fir.kt | 6 - .../diagnostics/tests/typealias/noRHS.kt | 1 + .../typealias/parameterSubstitution.fir.kt | 8 - .../tests/typealias/parameterSubstitution.kt | 1 + .../tests/typealias/simpleTypeAlias.fir.kt | 8 - .../tests/typealias/simpleTypeAlias.kt | 1 + .../starProjectionInTypeAliasArgument.fir.kt | 6 - .../starProjectionInTypeAliasArgument.kt | 1 + .../typeAliasArgumentsInConstructor.fir.kt | 11 -- .../typeAliasArgumentsInConstructor.kt | 1 + .../typeAliasConstructorReturnType.fir.kt | 18 -- .../typeAliasConstructorReturnType.kt | 1 + .../typeAliasInAnonymousObjectType.fir.kt | 5 - .../typeAliasInAnonymousObjectType.kt | 1 + .../tests/typealias/typeAliasNotNull.fir.kt | 6 - .../tests/typealias/typeAliasNotNull.kt | 1 + .../tests/typealias/typeAliasObject.fir.kt | 32 ---- .../tests/typealias/typeAliasObject.kt | 1 + .../typealias/typealiasRhsAnnotations.fir.kt | 16 -- .../typealias/typealiasRhsAnnotations.kt | 1 + .../typealiasRhsAnnotationsInArguments.fir.kt | 11 -- .../typealiasRhsAnnotationsInArguments.kt | 1 + .../diagnostics/tests/varargs/kt1781.fir.kt | 13 -- .../diagnostics/tests/varargs/kt1781.kt | 1 + .../diagnostics/tests/varargs/kt1835.fir.kt | 12 -- .../diagnostics/tests/varargs/kt1835.kt | 1 + .../diagnostics/tests/varargs/kt2163.fir.kt | 7 - .../diagnostics/tests/varargs/kt2163.kt | 1 + .../diagnostics/tests/varargs/kt422.fir.kt | 17 -- .../diagnostics/tests/varargs/kt422.kt | 1 + .../tests/varargs/varargsAndOut2.fir.kt | 9 - .../tests/varargs/varargsAndOut2.kt | 1 + .../variance/privateToThis/Abstract.fir.kt | 7 - .../tests/variance/privateToThis/Abstract.kt | 1 + .../privateToThis/ValReassigned.fir.kt | 20 -- .../variance/privateToThis/ValReassigned.kt | 1 + .../tests/when/AnnotatedWhenStatement.fir.kt | 8 - .../tests/when/AnnotatedWhenStatement.kt | 1 + .../when/EmptyConditionWithExpression.fir.kt | 8 - .../when/EmptyConditionWithExpression.kt | 1 + .../EmptyConditionWithExpressionEnum.fir.kt | 9 - .../when/EmptyConditionWithExpressionEnum.kt | 1 + .../tests/when/ExhaustiveBoolean.fir.kt | 8 - .../tests/when/ExhaustiveBoolean.kt | 1 + .../when/ExhaustiveBooleanBrackets.fir.kt | 7 - .../tests/when/ExhaustiveBooleanBrackets.kt | 1 + .../when/ExhaustiveBooleanComplex.fir.kt | 8 - .../tests/when/ExhaustiveBooleanComplex.kt | 1 + .../when/ExhaustiveBooleanNullable.fir.kt | 9 - .../tests/when/ExhaustiveBooleanNullable.kt | 1 + .../ExhaustivePlatformEnumAnnotated.fir.kt | 23 --- .../when/ExhaustivePlatformEnumAnnotated.kt | 1 + .../when/ExhaustivePlatformEnumElse.fir.kt | 21 --- .../tests/when/ExhaustivePlatformEnumElse.kt | 1 + .../when/ExhaustivePlatformEnumNull.fir.kt | 22 --- .../tests/when/ExhaustivePlatformEnumNull.kt | 1 + .../tests/when/NoElseWhenStatement.fir.kt | 6 - .../tests/when/NoElseWhenStatement.kt | 1 + .../when/NonExhaustiveWarningElse.fir.kt | 12 -- .../tests/when/NonExhaustiveWarningElse.kt | 1 + .../when/NonExhaustiveWarningNull.fir.kt | 14 -- .../tests/when/NonExhaustiveWarningNull.kt | 1 + .../diagnostics/tests/when/kt10811.fir.kt | 24 --- .../diagnostics/tests/when/kt10811.kt | 1 + .../invisibleOutsideOfWhen.fir.kt | 14 -- .../invisibleOutsideOfWhen.kt | 1 + .../noSubjectVariableName.fir.kt | 10 - .../noSubjectVariableName.kt | 1 + .../softModifierName.fir.kt | 7 - .../withSubjectVariable/softModifierName.kt | 1 + .../subjectVariableInIsPattern.fir.kt | 8 - .../subjectVariableInIsPattern.kt | 1 + .../ClassObjectAnnotatedWithItsKClass.fir.kt | 12 -- .../ClassObjectAnnotatedWithItsKClass.kt | 1 + .../annotations/TransientOnDelegate.fir.kt | 5 - .../annotations/TransientOnDelegate.kt | 1 + .../orderWithValue.fir.kt | 9 - .../annotationParameters/orderWithValue.kt | 1 + .../orderWithoutValue.fir.kt | 8 - .../annotationParameters/orderWithoutValue.kt | 1 + .../valueArrayOnly.fir.kt | 15 -- .../annotationParameters/valueArrayOnly.kt | 1 + .../valueArrayWithDefault.fir.kt | 15 -- .../valueArrayWithDefault.kt | 1 + .../arg.fir.kt | 7 - .../javaAnnotationsWithKClassParameter/arg.kt | 1 + .../argAndOtherDefault.fir.kt | 9 - .../argAndOtherDefault.kt | 1 + .../argArray.fir.kt | 7 - .../argArray.kt | 1 + .../argWithDefault.fir.kt | 8 - .../argWithDefault.kt | 1 + .../argWithDefaultAndOther.fir.kt | 9 - .../argWithDefaultAndOther.kt | 1 + .../twoArgs.fir.kt | 8 - .../twoArgs.kt | 1 + .../value.fir.kt | 8 - .../value.kt | 1 + .../valueAndOtherDefault.fir.kt | 12 -- .../valueAndOtherDefault.kt | 1 + .../valueArray.fir.kt | 9 - .../valueArray.kt | 1 + .../valueWithDefault.fir.kt | 9 - .../valueWithDefault.kt | 1 + .../valueWithDefaultAndOther.fir.kt | 10 - .../valueWithDefaultAndOther.kt | 1 + .../jvmField/inSingleFileFacade.fir.kt | 12 -- .../jvmField/inSingleFileFacade.kt | 1 + ...assOutArrayInAnnotationsOutVariance.fir.kt | 7 - .../kClassOutArrayInAnnotationsOutVariance.kt | 1 + .../kotlinAnnotation.fir.kt | 5 - .../kotlinAnnotation.kt | 1 + .../annotations/targetuse.fir.kt | 21 --- .../testsWithStdLib/annotations/targetuse.kt | 1 + .../flowInlining/expressionBody.fir.kt | 18 -- .../flowInlining/expressionBody.kt | 1 + .../irrelevantUnknownClosure.fir.kt | 23 --- .../flowInlining/irrelevantUnknownClosure.kt | 1 + .../flowInlining/nonLocalReturn.fir.kt | 18 -- .../flowInlining/nonLocalReturn.kt | 1 + .../varDefiniteInitalization.fir.kt | 42 ----- .../exactlyOnce/varDefiniteInitalization.kt | 1 + .../dsl/callUsualContractFunction.fir.kt | 42 ----- .../dsl/callUsualContractFunction.kt | 1 + ...rsiveContractCustomContractFunction.fir.kt | 39 ---- ...recursiveContractCustomContractFunction.kt | 1 + .../contracts/dsl/fqnContractFunction.fir.kt | 20 -- .../contracts/dsl/fqnContractFunction.kt | 1 + .../dsl/rewriteAtSliceFunctor.fir.kt | 10 - .../contracts/dsl/rewriteAtSliceFunctor.kt | 1 + .../contracts/fromStdlib/synchronize.fir.kt | 11 -- .../contracts/fromStdlib/synchronize.kt | 1 + .../smartcasts/safecallAndReturnsNull.fir.kt | 17 -- .../smartcasts/safecallAndReturnsNull.kt | 1 + .../noDeprecationOnReadBytes.fir.kt | 9 - .../deprecated/noDeprecationOnReadBytes.kt | 1 + .../delegatedProperty.fir.kt | 7 - .../delegatedProperty.kt | 1 + .../duplicateJvmSignature/jvmNames.fir.kt | 22 --- .../duplicateJvmSignature/jvmNames.kt | 1 + ...otlinMembersVsJavaNonVisibleStatics.fir.kt | 22 --- .../kotlinMembersVsJavaNonVisibleStatics.kt | 1 + .../testsWithStdLib/elvisOnUnitInLet.fir.kt | 9 - .../testsWithStdLib/elvisOnUnitInLet.kt | 1 + .../experimental/bodyUsages.fir.kt | 30 --- .../experimental/bodyUsages.kt | 1 + .../experimentalOnWholeModule.fir.kt | 23 --- .../experimental/experimentalOnWholeModule.kt | 1 + .../experimental/fullFqNameUsage.fir.kt | 12 -- .../experimental/fullFqNameUsage.kt | 1 + .../experimental/importStatement.fir.kt | 27 --- .../experimental/importStatement.kt | 1 + ...talOnFileWithVeryExperimentalMarker.fir.kt | 30 --- ...imentalOnFileWithVeryExperimentalMarker.kt | 1 + .../useExperimentalOnWholeModule.fir.kt | 22 --- .../useExperimentalOnWholeModule.kt | 1 + .../useExperimentalTargets.fir.kt | 57 ------ .../experimental/useExperimentalTargets.kt | 1 + ...forInFieldUpdatedInLoopBodyBefore13.fir.kt | 15 -- .../forInFieldUpdatedInLoopBodyBefore13.kt | 1 + ...DelegatedPropertyAssignmentBefore13.fir.kt | 16 -- ...ocalDelegatedPropertyAssignmentBefore13.kt | 1 + .../rangeVariableAssignment13.fir.kt | 19 -- .../rangeVariableAssignment13.kt | 1 + .../testsWithStdLib/ifElseJavaList.fir.kt | 16 -- .../testsWithStdLib/ifElseJavaList.kt | 1 + .../internalAnnotationsOnTypes.fir.kt | 30 --- .../internalAnnotationsOnTypes.kt | 1 + .../annotationsForResolve/kt35210.fir.kt | 12 -- .../annotationsForResolve/kt35210.kt | 1 + .../onlyInputTypeAndJava.fir.kt | 18 -- .../onlyInputTypeAndJava.kt | 1 + ...putTypeRecursiveBoundAndProjections.fir.kt | 24 --- ...lyInputTypeRecursiveBoundAndProjections.kt | 1 + ...putTypesAnnotationWithPlatformTypes.fir.kt | 19 -- ...lyInputTypesAnnotationWithPlatformTypes.kt | 1 + .../onlyInputTypesWithVarargs.fir.kt | 26 --- .../onlyInputTypesWithVarargs.kt | 1 + .../propagationOfNoInferAnnotation.fir.kt | 25 --- .../propagationOfNoInferAnnotation.kt | 1 + .../inference/arrayConstructor.fir.kt | 14 -- .../inference/arrayConstructor.kt | 1 + .../inference/delegates/kt31219.fir.kt | 17 -- .../inference/delegates/kt31219.kt | 1 + .../inference/delegates/kt31679.fir.kt | 20 -- .../inference/delegates/kt31679.kt | 1 + .../inference/delegates/kt32249.fir.kt | 18 -- .../inference/delegates/kt32249.kt | 1 + .../inference/intersectionInputType.fir.kt | 12 -- .../inference/intersectionInputType.kt | 1 + .../testsWithStdLib/inference/kt30292.fir.kt | 5 - .../testsWithStdLib/inference/kt30292.kt | 1 + .../testsWithStdLib/inference/kt35847.fir.kt | 17 -- .../testsWithStdLib/inference/kt35847.kt | 1 + ...inlineOnlySuppressesNothingToInline.fir.kt | 31 --- .../inlineOnlySuppressesNothingToInline.kt | 1 + .../patternCompileCallableReference.fir.kt | 8 - .../java/patternCompileCallableReference.kt | 1 + .../testsWithStdLib/javaForKClass.fir.kt | 28 --- .../testsWithStdLib/javaForKClass.kt | 1 + .../testsWithStdLib/kt7585/delegate.fir.kt | 76 -------- .../testsWithStdLib/kt7585/delegate.kt | 1 + .../diagnostics/testsWithStdLib/kt9985.fir.kt | 3 - .../diagnostics/testsWithStdLib/kt9985.kt | 1 + .../multiplatform/jvmOverloads.fir.kt | 11 -- .../multiplatform/jvmOverloads.kt | 1 + .../testsWithStdLib/native/noBody.fir.kt | 25 --- .../testsWithStdLib/native/noBody.kt | 1 + .../testsWithStdLib/native/override.fir.kt | 9 - .../testsWithStdLib/native/override.kt | 1 + .../overrideWithFunctionalType.fir.kt | 17 -- .../overrideWithFunctionalType.kt | 1 + .../testsWithStdLib/pureReifiable.fir.kt | 12 -- .../testsWithStdLib/pureReifiable.kt | 1 + .../pureReifiableArrayOperations.fir.kt | 18 -- .../pureReifiableArrayOperations.kt | 1 + .../invalidFqName.fir.kt | 28 --- .../invalidFqName.kt | 1 + .../wrongTypeParametersCount.fir.kt | 40 ---- .../wrongTypeParametersCount.kt | 1 + .../testsWithStdLib/regression/ea63992.fir.kt | 7 - .../testsWithStdLib/regression/ea63992.kt | 1 + .../testsWithStdLib/regression/kt26806.fir.kt | 9 - .../testsWithStdLib/regression/kt26806.kt | 1 + .../reified/nonCallableReiefied.fir.kt | 11 -- .../reified/nonCallableReiefied.kt | 1 + .../resolve/javaPackageMembers.fir.kt | 9 - .../resolve/javaPackageMembers.kt | 1 + .../testsWithStdLib/resolve/kt10103.fir.kt | 1 - .../testsWithStdLib/resolve/kt10103.kt | 1 + .../testsWithStdLib/resolve/kt10732a.fir.kt | 10 - .../testsWithStdLib/resolve/kt10732a.kt | 1 + .../resolve/samConstructorVsFun.fir.kt | 30 --- .../resolve/samConstructorVsFun.kt | 1 + .../shadowingInDestructuring.fir.kt | 10 - .../shadowingInDestructuring.kt | 1 + .../smartcasts/listOfGeneric.fir.kt | 8 - .../smartcasts/listOfGeneric.kt | 1 + .../testsWithStdLib/streams.fir.kt | 9 - .../diagnostics/testsWithStdLib/streams.kt | 1 + ...riableDeclarationWithEnabledFeature.fir.kt | 20 -- ...tiVariableDeclarationWithEnabledFeature.kt | 1 + .../trailingComma/noDisambiguation.fir.kt | 10 - .../trailingComma/noDisambiguation.kt | 1 + .../typeArgumentsWithEnabledFeature.fir.kt | 28 --- .../typeArgumentsWithEnabledFeature.kt | 1 + .../typeParametersWithEnabledFeature.fir.kt | 51 ----- .../typeParametersWithEnabledFeature.kt | 1 + .../whenEntryWithEnabledFeature.fir.kt | 50 ----- .../whenEntryWithEnabledFeature.kt | 1 + .../typealias/exceptionTypeAliases.fir.kt | 3 - .../typealias/exceptionTypeAliases.kt | 1 + .../typealias/hashMapTypeAlias.fir.kt | 20 -- .../typealias/hashMapTypeAlias.kt | 1 + .../testsWithStdLib/varargs/kt4172j.fir.kt | 9 - .../testsWithStdLib/varargs/kt4172j.kt | 1 + .../testsWithStdLib/varargs/kt5534.fir.kt | 6 - .../testsWithStdLib/varargs/kt5534.kt | 1 + .../testsWithStdLib/when/kt10192.fir.kt | 20 -- .../testsWithStdLib/when/kt10192.kt | 1 + .../AbstractFirOldFrontendDiagnosticsTest.kt | 7 +- .../org/jetbrains/kotlin/fir/FirTestUtils.kt | 31 +++ 2268 files changed, 1175 insertions(+), 19754 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/AssignToArrayElement.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/DiamondFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/DiamondFunctionGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/Dollar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/LiteralAsResult.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/MultilineStringTemplates.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/ProcessingEmptyImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/PropertyInitializers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/ShiftFunctionTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/UnitValue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/UnusedParametersVersion10.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/VarargTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/extensionFunctionType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/noNameProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/onExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/onLoops.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/documented.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/functionExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/javaDocumented.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/javaretention.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/objectLiteral.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/retention.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/target.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/options/targets/suppress.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/annotations/typeAnnotations.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/CustomGetSet.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/CustomGetVal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/CustomGetVar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/CustomSet.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/FieldAsProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/FieldDerived.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/FieldInLocal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/FieldOnVal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/FieldOnVar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/backingField/kt782packageLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/expectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/object.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/classVsPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/emptyLhs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/empty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/localConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/generic/kt10968.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/generic/kt12286.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/generic/kt35896.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/generic/kt7470.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/kt25433.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/kt32256.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/kt35959.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/classFromClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/genericClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/kt7564.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/constructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/sam.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/typealiases.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/AsErasedFine.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/AsErasedStar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsErasedStar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsTraits.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/NullableToNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/WhenWithExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/bare/AsNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/bare/NullableAs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/delegate.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/lateInit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/localObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/nobacking.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/outer.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/notADataClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/oneValParam.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/twoValParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/dataClasses/twoVarParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/declarationChecks/kt2142.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/backingField.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/localVariable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/kt8154.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/deprecated/thisUsage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/classObjectInEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/commonSupertype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/emptyConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/enumMissingName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/enumWithEmptyName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/importEnumFromJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inline.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/existingClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/insideClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/insideClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/insideEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/insideObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/insideTrait.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/inner/twoEnums.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/kt2834.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/multipleConstructors.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/evaluate/float.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/delegate.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/implements.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/internalAndProtected.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/localFromInternal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/localFromPrivate.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/nested.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/privateFromLocal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/GenericIterator.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/kt2317.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/kt3470.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/extensions/object.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/fileDependencyRecursion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/funInterface/basicFunInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/Common.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/kt2906.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/functionLiterals/returnNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/PseudoRawTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/kt408.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/kt1575-Class.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/kt1575-Function.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/kt9203_1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/nullability/kt25182.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/recursive.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ClassClash.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportTwoTimes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/ImportsConflicting.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/PackageVsClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/completion/kt36233.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/kt7433.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/immutableArrayList.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/intersectionWithEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/kt32434.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/kt35702.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/kt619.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/kt24490.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/kt32081.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/kt32207.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/opposite.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt1358.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt1944.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2294.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2484.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2505.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2514.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2588.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt3174.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt32106.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt3344.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt37043.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt8132.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/anonymousObjects.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/default.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/inlineReified.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/enumEntries.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/extensionFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/localClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/localClassInsideNested.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/nestedClassInObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/outerProtectedMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/outerSuperClassMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/inner/traits.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/KJKInheritance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/OverrideVararg.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/Simple.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/UnboxingNulls.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/annotationsInheritance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/contravariantIterable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/exceptionMessage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/flexibleNothing.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/javaStaticImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt1402.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt1431.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt2152.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt2394.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt3307.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt3311.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/kt7523.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/matchers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/mutableIterator.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/overrideRawType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/properties/interface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/samWithConsumer.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/specialBridges.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/staticMethodInClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/types/arrayList.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/types/returnCollection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/types/typeParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/kt53.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/labels/kt3920.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/labels/kt4586.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/labels/kt4603.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/lateinit/local/localLateinit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/modifiers/const/kt12248.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/modifiers/const/kt15913.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/kt14249.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/varargConflict.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/implDynamic.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/localObjectInsideObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/objects/objectInsideFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/operatorRem/operatorRem.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/kt10939.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/kt1998.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/kt7068.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/kt7068_2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/kt7440.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/AbstractFunImplemented.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/AbstractValImplemented.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/AbstractVarImplemented.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/DelegationFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/DelegationVal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/DelegationVar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/PropertyInConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/SuspiciousCase1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/fakeEquals.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/kt6014.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/kt8990.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/typeParameters/kt9850.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/dereference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/elvis.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/getParentOfType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/intersection/map.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/list.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/string.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/override.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/safeCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/samConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/privateInFile/kt12429.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/reassignment/noifelse.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/Jet121.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/Jet17.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/Jet183-1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/Jet53.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/Jet67.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/Jet68.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/OverrideResolution.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/ea40964.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/ea43298.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/ea53340.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/ea69735.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/intchar.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt13954.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt14740.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt1550.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt16086.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt1647.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt2376.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt26-1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt26.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt28001.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt316.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt32836.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt337.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt3535.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt3647.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt3731.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt385.109.441.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt394.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt469.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt4693.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt549.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt571.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt575.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt580.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt588.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt604.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt630.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt691.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt743.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt750.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt847.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt860.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/kt9808.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/priority/kt9810.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/genericVsNested.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt1078.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt1579.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt1642.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt2262.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt587.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/kt939.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/DoubleInner.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/NotFinal.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/OperationWhen.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/WithInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/genericIntersection.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/kt3244.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/kt3572.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/typeDegradation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/initialization.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/substitutions/kt1558-short.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/subtyping/kt-1457.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/subtyping/kt2069.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/aliasesOnly.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/classReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/import.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/inGenerics.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/localTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/methodReference.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/nestedSubstituted.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/noRHS.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/parameterSubstitution.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasObject.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/varargs/kt1781.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/varargs/kt1835.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/varargs/kt2163.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/varargs/kt422.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/varargs/varargsAndOut2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/NoElseWhenStatement.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/kt10811.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/javaForKClass.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/kt9985.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/native/noBody.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/native/override.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/pureReifiable.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/streams.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/when/kt10192.fir.kt create mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt index 561dff00e12..d1da86b99e6 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/AbstractFir2IrTextTest.kt @@ -9,7 +9,6 @@ import com.intellij.openapi.extensions.Extensions import com.intellij.openapi.project.Project import com.intellij.psi.PsiElementFinder import com.intellij.psi.search.GlobalSearchScope -import junit.framework.TestCase import org.jetbrains.kotlin.asJava.finder.JavaElementFinder import org.jetbrains.kotlin.backend.common.serialization.signature.IdSignatureDescriptor import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM @@ -37,23 +36,12 @@ abstract class AbstractFir2IrTextTest : AbstractIrTextTestCase() { } override fun doTest(filePath: String) { - val originalTextPath = filePath.replace(".kt", ".txt") + val oldFrontendTextPath = filePath.replace(".kt", ".txt") val firTextPath = filePath.replace(".kt", ".fir.txt") - val originalText = File(originalTextPath) - val firText = File(firTextPath) - if (originalText.exists() && firText.exists()) { - val originalLines = originalText.readLines() - val firLines = firText.readLines() - TestCase.assertFalse( - "Dumps via FIR & via old FE are the same. Please delete .fir.txt dump and add // FIR_IDENTICAL to test source", - firLines.withIndex().all { (index, line) -> - val trimmed = line.trim() - val originalTrimmed = originalLines.getOrNull(index)?.trim() - trimmed.isEmpty() && originalTrimmed?.isEmpty() != false || trimmed == originalTrimmed - } && originalLines.withIndex().all { (index, line) -> - index < firLines.size || line.trim().isEmpty() - } - ) + val oldFrontendTextFile = File(oldFrontendTextPath) + val firTextFile = File(firTextPath) + if (oldFrontendTextFile.exists() && firTextFile.exists()) { + compareAndMergeFirFileAndOldFrontendFile(oldFrontendTextFile, firTextFile) } super.doTest(filePath) } diff --git a/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.fir.kt b/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.fir.kt deleted file mode 100644 index 65e6d55d878..00000000000 --- a/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// http://youtrack.jetbrains.net/issue/KT-419 - -class A(w: Int) { - var c = w - - init { - c = 81 - } -} - diff --git a/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.kt b/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.kt index 65e6d55d878..34b70b7c831 100644 --- a/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.kt +++ b/compiler/testData/diagnostics/tests/AnonymousInitializerVarAndConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // http://youtrack.jetbrains.net/issue/KT-419 class A(w: Int) { diff --git a/compiler/testData/diagnostics/tests/AssignToArrayElement.fir.kt b/compiler/testData/diagnostics/tests/AssignToArrayElement.fir.kt deleted file mode 100644 index 43f8284a476..00000000000 --- a/compiler/testData/diagnostics/tests/AssignToArrayElement.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun getArray(): Array = throw Exception() -fun getList(): MutableList = throw Exception() -fun fn() { - getArray()[1] = 2 - getList()[1] = 2 - getArray()[1]++ - getList()[1]++ - getArray()[1] += 2 - getList()[1] += 2 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/AssignToArrayElement.kt b/compiler/testData/diagnostics/tests/AssignToArrayElement.kt index 43f8284a476..7600d50611e 100644 --- a/compiler/testData/diagnostics/tests/AssignToArrayElement.kt +++ b/compiler/testData/diagnostics/tests/AssignToArrayElement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun getArray(): Array = throw Exception() fun getList(): MutableList = throw Exception() fun fn() { diff --git a/compiler/testData/diagnostics/tests/DiamondFunction.fir.kt b/compiler/testData/diagnostics/tests/DiamondFunction.fir.kt deleted file mode 100644 index 0d8b9a77755..00000000000 --- a/compiler/testData/diagnostics/tests/DiamondFunction.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -interface Base { - fun f() = 1 -} - -open class Left() : Base - -interface Right : Base - -class Diamond() : Left(), Right diff --git a/compiler/testData/diagnostics/tests/DiamondFunction.kt b/compiler/testData/diagnostics/tests/DiamondFunction.kt index 0d8b9a77755..cc3204a20a1 100644 --- a/compiler/testData/diagnostics/tests/DiamondFunction.kt +++ b/compiler/testData/diagnostics/tests/DiamondFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Base { fun f() = 1 } diff --git a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.fir.kt b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.fir.kt deleted file mode 100644 index d84e34a40a8..00000000000 --- a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -interface Base

{ - fun f() = 1 -} - -open class Left

() : Base

- -interface Right

: Base

- -class Diamond

() : Left

(), Right

diff --git a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt index d84e34a40a8..5cf48d32c23 100644 --- a/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt +++ b/compiler/testData/diagnostics/tests/DiamondFunctionGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Base

{ fun f() = 1 } diff --git a/compiler/testData/diagnostics/tests/Dollar.fir.kt b/compiler/testData/diagnostics/tests/Dollar.fir.kt deleted file mode 100644 index ca13dc9c9d9..00000000000 --- a/compiler/testData/diagnostics/tests/Dollar.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -package dollar - -open class `$$$$$`() { -} -open class `$`() { -} -open class `$$`(`$$$$` : `$$$$$`?) : `$`() { - val `$$$` : `$$$$$`? = `$$$$` - open public fun `$$$$$$`() : `$$$$$`? { - return `$$$` - } -} diff --git a/compiler/testData/diagnostics/tests/Dollar.kt b/compiler/testData/diagnostics/tests/Dollar.kt index ca13dc9c9d9..d6800d82e2f 100644 --- a/compiler/testData/diagnostics/tests/Dollar.kt +++ b/compiler/testData/diagnostics/tests/Dollar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package dollar open class `$$$$$`() { diff --git a/compiler/testData/diagnostics/tests/LiteralAsResult.fir.kt b/compiler/testData/diagnostics/tests/LiteralAsResult.fir.kt deleted file mode 100644 index 434e19277b7..00000000000 --- a/compiler/testData/diagnostics/tests/LiteralAsResult.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// Here we want just to check return type -// Should be () -> Int -fun foo() = { 42 } diff --git a/compiler/testData/diagnostics/tests/LiteralAsResult.kt b/compiler/testData/diagnostics/tests/LiteralAsResult.kt index 434e19277b7..b183a5e33a0 100644 --- a/compiler/testData/diagnostics/tests/LiteralAsResult.kt +++ b/compiler/testData/diagnostics/tests/LiteralAsResult.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Here we want just to check return type // Should be () -> Int fun foo() = { 42 } diff --git a/compiler/testData/diagnostics/tests/MultilineStringTemplates.fir.kt b/compiler/testData/diagnostics/tests/MultilineStringTemplates.fir.kt deleted file mode 100644 index 715007c246c..00000000000 --- a/compiler/testData/diagnostics/tests/MultilineStringTemplates.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -fun box() : String { - val s = "abc" - val test1 = """$s""" - if (test1 != "abc") return "Fail 1: $test1" - - val test2 = """${s}""" - if (test2 != "abc") return "Fail 2: $test2" - - val test3 = """ "$s" """ - if (test3 != " \"abc\" ") return "Fail 3: $test3" - - val test4 = """ "${s}" """ - if (test4 != " \"abc\" ") return "Fail 4: $test4" - - val test5 = -""" - ${s.length} -""" - if (test5 != "\n 3\n") return "Fail 5: $test5" - - val test6 = """\n""" - if (test6 != "\\n") return "Fail 6: $test6" - - val test7 = """\${'$'}foo""" - if (test7 != "\\\$foo") return "Fail 7: $test7" - - val test8 = """$ foo""" - if (test8 != "$ foo") return "Fail 8: $test8" - - return "OK" -} - - -fun new() : String { - return """ - sdfasdf - ${a} - ds"asdfas - $b - asgfaf - """ - -} diff --git a/compiler/testData/diagnostics/tests/MultilineStringTemplates.kt b/compiler/testData/diagnostics/tests/MultilineStringTemplates.kt index 715007c246c..5735549f1e0 100644 --- a/compiler/testData/diagnostics/tests/MultilineStringTemplates.kt +++ b/compiler/testData/diagnostics/tests/MultilineStringTemplates.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun box() : String { val s = "abc" val test1 = """$s""" diff --git a/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.fir.kt b/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.fir.kt deleted file mode 100644 index df495e555ff..00000000000 --- a/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -abstract class B() { - abstract fun foo2(arg: Int = 239) : Int -} - -class C() : B() { - override fun foo2(arg: Int) : Int = arg -} - -fun invokeIt() { - C().foo2() -} diff --git a/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.kt b/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.kt index df495e555ff..07fd8cfc4f7 100644 --- a/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.kt +++ b/compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class B() { abstract fun foo2(arg: Int = 239) : Int } diff --git a/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.fir.kt b/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.fir.kt deleted file mode 100644 index 95d4fdcc9c8..00000000000 --- a/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ - -interface Aaa { - fun zzz(value: T): Unit -} - -class Bbb() : Aaa { - override fun zzz(value: T) { } -} - -fun foo() { - var a = Bbb() - a.zzz(10.0) -} diff --git a/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.kt b/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.kt index 95d4fdcc9c8..6ee54b7a688 100644 --- a/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/OverridenFunctionAndSpecifiedTypeParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Aaa { fun zzz(value: T): Unit diff --git a/compiler/testData/diagnostics/tests/ProcessingEmptyImport.fir.kt b/compiler/testData/diagnostics/tests/ProcessingEmptyImport.fir.kt deleted file mode 100644 index 35c39eae02b..00000000000 --- a/compiler/testData/diagnostics/tests/ProcessingEmptyImport.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -import - -fun firstFun() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/ProcessingEmptyImport.kt b/compiler/testData/diagnostics/tests/ProcessingEmptyImport.kt index 35c39eae02b..95a51664ea3 100644 --- a/compiler/testData/diagnostics/tests/ProcessingEmptyImport.kt +++ b/compiler/testData/diagnostics/tests/ProcessingEmptyImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import fun firstFun() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/PropertyInitializers.fir.kt b/compiler/testData/diagnostics/tests/PropertyInitializers.fir.kt deleted file mode 100644 index 08153981e4d..00000000000 --- a/compiler/testData/diagnostics/tests/PropertyInitializers.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class Foo(val a: Int, b: Int) { - val c = a + b - - val d: Int - get() = a - - val e: Int - get() = b -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/PropertyInitializers.kt b/compiler/testData/diagnostics/tests/PropertyInitializers.kt index 08153981e4d..5cc3a808f9d 100644 --- a/compiler/testData/diagnostics/tests/PropertyInitializers.kt +++ b/compiler/testData/diagnostics/tests/PropertyInitializers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo(val a: Int, b: Int) { val c = a + b diff --git a/compiler/testData/diagnostics/tests/ShiftFunctionTypes.fir.kt b/compiler/testData/diagnostics/tests/ShiftFunctionTypes.fir.kt deleted file mode 100644 index cfc6fb59656..00000000000 --- a/compiler/testData/diagnostics/tests/ShiftFunctionTypes.fir.kt +++ /dev/null @@ -1,52 +0,0 @@ -// FILE: f.kt -class A { -} - -// FILE: f.kt -package n - class B -// FILE: f.kt -abstract class XXX() { - abstract val a : Int - abstract val a2 : n.B - abstract val a3 : (A) - abstract val a31 : (n.B) - abstract val a4 : A? - abstract val a5 : (A)? - abstract val a6 : (A?) - abstract val a7 : (A) -> n.B - abstract val a8 : (A, n.B) -> n.B - -//val a9 : (A, B) -//val a10 : (B)? -> B - - val a11 : ((Int) -> Int)? = null - val a12 : ((Int) -> (Int))? = null - abstract val a13 : Int.(Int) -> Int - abstract val a14 : n.B.(Int) -> Int - abstract val a15 : Int? .(Int) -> Int - abstract val a152 : (Int?).(Int) -> Int -// abstract val a151 : Int?.(Int) -> Int - abstract val a16 : (Int) -> (Int) -> Int - abstract val a17 : ((Int) -> Int).(Int) -> Int - abstract val a18 : (Int) -> ((Int) -> Int) - abstract val a19 : ((Int) -> Int) -> Int -} - -abstract class YYY() { - abstract val a7 : (a : A) -> n.B - abstract val a8 : (a : A, b : n.B) -> n.B -//val a9 : (A, B) -//val a10 : (B)? -> B - val a11 : ((a : Int) -> Int)? = null - val a12 : ((a : Int) -> (Int))? = null - abstract val a13 : Int.(a : Int) -> Int - abstract val a14 : n.B.(a : Int) -> Int - abstract val a15 : Int? .(a : Int) -> Int - abstract val a152 : (Int?).(a : Int) -> Int -//abstract val a151 : Int?.(a : Int) -> Int - abstract val a16 : (a : Int) -> (a : Int) -> Int - abstract val a17 : ((a : Int) -> Int).(a : Int) -> Int - abstract val a18 : (a : Int) -> ((a : Int) -> Int) - abstract val a19 : (b : (a : Int) -> Int) -> Int -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/ShiftFunctionTypes.kt b/compiler/testData/diagnostics/tests/ShiftFunctionTypes.kt index cfc6fb59656..4c617645291 100644 --- a/compiler/testData/diagnostics/tests/ShiftFunctionTypes.kt +++ b/compiler/testData/diagnostics/tests/ShiftFunctionTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: f.kt class A { } diff --git a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.fir.kt b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.fir.kt deleted file mode 100644 index 6698a262bcb..00000000000 --- a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// dummy test of syntax error highlighting in tests - -fun get() { - 1 + 2 2 3 4 -} diff --git a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt index 6698a262bcb..b654b3512f8 100644 --- a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt +++ b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // dummy test of syntax error highlighting in tests fun get() { diff --git a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.fir.kt b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.fir.kt deleted file mode 100644 index 7114933f970..00000000000 --- a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.fir.kt +++ /dev/null @@ -1 +0,0 @@ -fun f() { diff --git a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt index 7114933f970..ec4fa5e62f6 100644 --- a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt +++ b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlightingEof.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun f() { diff --git a/compiler/testData/diagnostics/tests/UnitValue.fir.kt b/compiler/testData/diagnostics/tests/UnitValue.fir.kt deleted file mode 100644 index b4d92bc704a..00000000000 --- a/compiler/testData/diagnostics/tests/UnitValue.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !CHECK_TYPE - -fun test() { - return checkSubtype(Unit) -} diff --git a/compiler/testData/diagnostics/tests/UnitValue.kt b/compiler/testData/diagnostics/tests/UnitValue.kt index b4d92bc704a..2162408ca16 100644 --- a/compiler/testData/diagnostics/tests/UnitValue.kt +++ b/compiler/testData/diagnostics/tests/UnitValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test() { diff --git a/compiler/testData/diagnostics/tests/UnusedParametersVersion10.fir.kt b/compiler/testData/diagnostics/tests/UnusedParametersVersion10.fir.kt deleted file mode 100644 index b3c56ab9bd4..00000000000 --- a/compiler/testData/diagnostics/tests/UnusedParametersVersion10.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// !LANGUAGE: -SingleUnderscoreForParameterName - -val x = 1.let { arg -> } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/UnusedParametersVersion10.kt b/compiler/testData/diagnostics/tests/UnusedParametersVersion10.kt index b3c56ab9bd4..761dc5dccc3 100644 --- a/compiler/testData/diagnostics/tests/UnusedParametersVersion10.kt +++ b/compiler/testData/diagnostics/tests/UnusedParametersVersion10.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -SingleUnderscoreForParameterName val x = 1.let { arg -> } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.fir.kt b/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.fir.kt deleted file mode 100644 index 6331a7778ed..00000000000 --- a/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// JAVAC_EXPECTED_FILE -class Foo1() : java.util.ArrayList() - -open class Bar() { - fun v() : Int = 1 - val v : Int = 1 -} - -class Barr() : Bar() {} diff --git a/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.kt b/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.kt index 6331a7778ed..a10b657213a 100644 --- a/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.kt +++ b/compiler/testData/diagnostics/tests/ValAndFunOverrideCompatibilityClash.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE class Foo1() : java.util.ArrayList() diff --git a/compiler/testData/diagnostics/tests/VarargTypes.fir.kt b/compiler/testData/diagnostics/tests/VarargTypes.fir.kt deleted file mode 100644 index 66e2f692ab9..00000000000 --- a/compiler/testData/diagnostics/tests/VarargTypes.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// KT-389 Wrong type inference for varargs etc. - -import java.util.* - -fun foob(vararg a : Byte) : ByteArray = a -fun fooc(vararg a : Char) : CharArray = a -fun foos(vararg a : Short) : ShortArray = a -fun fooi(vararg a : Int) : IntArray = a -fun fool(vararg a : Long) : LongArray = a -fun food(vararg a : Double) : DoubleArray = a -fun foof(vararg a : Float) : FloatArray = a -fun foob(vararg a : Boolean) : BooleanArray = a -fun foos(vararg a : String) : Array = a - -fun test() { - Arrays.asList(1, 2, 3) - Arrays.asList(1, 2, 3) - - foob(1, 2, 3) - foos(1, 2, 3) - fooc('1', '2', '3') - fooi(1, 2, 3) - fool(1, 2, 3) - food(1.0, 2.0, 3.0) - foof(1.0.toFloat(), 2.0.toFloat(), 3.0.toFloat()) -} diff --git a/compiler/testData/diagnostics/tests/VarargTypes.kt b/compiler/testData/diagnostics/tests/VarargTypes.kt index 66e2f692ab9..e0556ada868 100644 --- a/compiler/testData/diagnostics/tests/VarargTypes.kt +++ b/compiler/testData/diagnostics/tests/VarargTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-389 Wrong type inference for varargs etc. import java.util.* diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.fir.kt deleted file mode 100644 index 32e92a33f72..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -annotation class ann -class Annotated(@ann val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt index 32e92a33f72..223f6cc30a9 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedConstructor.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL annotation class ann class Annotated(@ann val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.fir.kt deleted file mode 100644 index bdb7dca248a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -annotation class My - -fun foo() { - val s = object { - @My fun bar() {} - } - s.bar() -} diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.kt index bdb7dca248a..35ff1b7231e 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class My fun foo() { diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.fir.kt deleted file mode 100644 index 1f95a8ea8ec..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -annotation class My - -fun foo(): Int { - val s = object { - @My val bar: Int = 0 - } - return s.bar -} diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.kt index 1f95a8ea8ec..87075c9bc9c 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedLocalObjectProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class My fun foo(): Int { diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.fir.kt deleted file mode 100644 index 1d30d760f42..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -@Target(AnnotationTarget.TYPE) -annotation class My - -fun foo() { - for (i: @My Int in 0..41) { - if (i == 13) return - } -} diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.kt index 1d30d760f42..6bc18a98a9d 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedLoop.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.TYPE) annotation class My diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.fir.kt deleted file mode 100644 index af41d3d5944..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// Result type can be annotated -@Target(AnnotationTarget.TYPE) -annotation class My(val x: Int) - -fun foo(): @My(42) Int = 24 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.kt index af41d3d5944..fd4ef0b44e8 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedResultType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Result type can be annotated @Target(AnnotationTarget.TYPE) annotation class My(val x: Int) diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.fir.kt deleted file mode 100644 index e98b5122708..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -annotation class My - -fun foo(arg: Int): Int { - try { - return 1 / (arg - arg) - } catch (e: @My Exception) { - return -1 - } -} diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.kt b/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.kt index e98b5122708..de5ebc35adb 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotatedTryCatch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class My fun foo(arg: Int): Int { diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.fir.kt deleted file mode 100644 index a1ef09e0da3..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -annotation class Base(val x: Int) - -annotation class UseBase(val b: Base = Base(0)) - -@UseBase class My diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt index a1ef09e0da3..9958b3741e3 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationAsDefaultParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class Base(val x: Int) annotation class UseBase(val b: Base = Base(0)) diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.fir.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.fir.kt deleted file mode 100644 index bfc2133b520..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -package test - -annotation class A(val a: Int = 12, val b: String = "Test", val c: String) - -@A(a = 12, c = "Hello") -object SomeObject diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt index bfc2133b520..32a91ac5b67 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationOnObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test annotation class A(val a: Int = 12, val b: String = "Test", val c: String) diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.fir.kt b/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.fir.kt deleted file mode 100644 index fe2e95895bd..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -annotation class Ann - -class C { - fun foo() { - class Local { - @Ann - } - } - - @Ann -} - -@Ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.kt b/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.kt index fe2e95895bd..33a9c4d00a3 100644 --- a/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.kt +++ b/compiler/testData/diagnostics/tests/annotations/DanglingNoBrackets.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class Ann class C { diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.fir.kt b/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.fir.kt deleted file mode 100644 index 8a0f5e78d5f..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -annotation class Ann - -class C { - fun test() { - @Ann - } - - fun foo() { - class Local { - @Ann - } - } - @Ann -} - -@Ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt b/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt index 8a0f5e78d5f..074ebcd2833 100644 --- a/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt +++ b/compiler/testData/diagnostics/tests/annotations/DanglingWithBrackets.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class Ann class C { diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.fir.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.fir.kt deleted file mode 100644 index 86351a434ee..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// Class CAN be recursively annotated -@RecursivelyAnnotated(1) -annotation class RecursivelyAnnotated(val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt index 86351a434ee..9efbc5e55d1 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotated.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Class CAN be recursively annotated @RecursivelyAnnotated(1) annotation class RecursivelyAnnotated(val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.fir.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.fir.kt deleted file mode 100644 index 638a1728975..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// Properties can be recursively annotated -annotation class ann(val x: Int) -@ann(x) const val x: Int = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt index 638a1728975..be320233080 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedGlobalProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Properties can be recursively annotated annotation class ann(val x: Int) @ann(x) const val x: Int = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.fir.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.fir.kt deleted file mode 100644 index e4277530222..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -// Class constructor parameter CAN be recursively annotated -annotation class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt index e4277530222..73d97511b95 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameter.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL // Class constructor parameter CAN be recursively annotated annotation class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.fir.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.fir.kt deleted file mode 100644 index f3227d7dccd..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// Class constructor parameter type CAN be recursively annotated -@Target(AnnotationTarget.TYPE) -annotation class RecursivelyAnnotated(val x: @RecursivelyAnnotated(1) Int) diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.kt index f3227d7dccd..444869f0a02 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Class constructor parameter type CAN be recursively annotated @Target(AnnotationTarget.TYPE) annotation class RecursivelyAnnotated(val x: @RecursivelyAnnotated(1) Int) diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.fir.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.fir.kt deleted file mode 100644 index e4277530222..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -// Class constructor parameter CAN be recursively annotated -annotation class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.kt b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.kt index e4277530222..73d97511b95 100644 --- a/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.kt +++ b/compiler/testData/diagnostics/tests/annotations/RecursivelyAnnotatedParameterWithAt.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL // Class constructor parameter CAN be recursively annotated annotation class RecursivelyAnnotated(@RecursivelyAnnotated(1) val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.fir.kt b/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.fir.kt deleted file mode 100644 index f034031bb3a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// This test checks that annotations on extension function types are preserved. See the corresponding .txt file - -@Target(AnnotationTarget.TYPE) -annotation class ann - -interface Some { - fun f1(): String.() -> Int - fun f2(): @ExtensionFunctionType() (String.() -> Int) - fun f3(): @ann String.() -> Int - fun f4(): @ExtensionFunctionType @ann() (String.() -> Int) -} diff --git a/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.kt b/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.kt index f034031bb3a..1b29466d9e8 100644 --- a/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.kt +++ b/compiler/testData/diagnostics/tests/annotations/extensionFunctionType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // This test checks that annotations on extension function types are preserved. See the corresponding .txt file @Target(AnnotationTarget.TYPE) diff --git a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.fir.kt b/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.fir.kt deleted file mode 100644 index 17b9a770ad2..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -// !DIAGNOSTICS: -FINAL_SUPERTYPE -// This error needs to be suppressed to cause light class generation - -class Foo : Target() diff --git a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.kt b/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.kt index 17b9a770ad2..eb27486d006 100644 --- a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.kt +++ b/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -FINAL_SUPERTYPE // This error needs to be suppressed to cause light class generation diff --git a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.fir.kt b/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.fir.kt deleted file mode 100644 index 7a63ab0f4e5..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -SUPERTYPES_FOR_ANNOTATION_CLASS -VIRTUAL_MEMBER_HIDDEN -FINAL_SUPERTYPE -MISSING_DEPENDENCY_SUPERCLASS -// These errors need to be suppressed to cause light class generation -// FILE: test.kt - -annotation class Ann : Target() - -annotation class Ann2(vararg val allowedTargets: AnnotationTarget) : Target() - -interface I : J { - override fun foo(): List = throw Exception() -} -class C : I { - fun bar(): Set = throw Exception() -} -annotation class Ann3 : C() -annotation class Ann4 : I - -// FILE: J.java - -import java.util.Collection; -import kotlin.annotation.Target; - -public interface J extends Target { - Collection foo(); -} diff --git a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt b/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt index 7a63ab0f4e5..cf809419027 100644 --- a/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt +++ b/compiler/testData/diagnostics/tests/annotations/inheritFromAnnotationClass2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -SUPERTYPES_FOR_ANNOTATION_CLASS -VIRTUAL_MEMBER_HIDDEN -FINAL_SUPERTYPE -MISSING_DEPENDENCY_SUPERCLASS // These errors need to be suppressed to cause light class generation // FILE: test.kt diff --git a/compiler/testData/diagnostics/tests/annotations/noNameProperty.fir.kt b/compiler/testData/diagnostics/tests/annotations/noNameProperty.fir.kt deleted file mode 100644 index 3fcd987d7ab..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/noNameProperty.fir.kt +++ /dev/null @@ -1 +0,0 @@ -annotation class Ann(val x: Int, val ) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/noNameProperty.kt b/compiler/testData/diagnostics/tests/annotations/noNameProperty.kt index 3fcd987d7ab..a81327727eb 100644 --- a/compiler/testData/diagnostics/tests/annotations/noNameProperty.kt +++ b/compiler/testData/diagnostics/tests/annotations/noNameProperty.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL annotation class Ann(val x: Int, val ) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/onExpression.fir.kt b/compiler/testData/diagnostics/tests/annotations/onExpression.fir.kt deleted file mode 100644 index 9ffd58eb14a..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/onExpression.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun foo() = @ann 1 - -@Target(AnnotationTarget.EXPRESSION) -@Retention(AnnotationRetention.SOURCE) -annotation class ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/onExpression.kt b/compiler/testData/diagnostics/tests/annotations/onExpression.kt index 9ffd58eb14a..0f0a6daed6f 100644 --- a/compiler/testData/diagnostics/tests/annotations/onExpression.kt +++ b/compiler/testData/diagnostics/tests/annotations/onExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo() = @ann 1 @Target(AnnotationTarget.EXPRESSION) diff --git a/compiler/testData/diagnostics/tests/annotations/onLoops.fir.kt b/compiler/testData/diagnostics/tests/annotations/onLoops.fir.kt deleted file mode 100644 index 2ec18eb93d2..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/onLoops.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -fun test() { - @ann - while (2 < 1) {} - - @ann - do {} while (2 < 1) - - @ann - for (i in 1..2) {} -} - -annotation class ann \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/onLoops.kt b/compiler/testData/diagnostics/tests/annotations/onLoops.kt index 2ec18eb93d2..bf5acfe7d2d 100644 --- a/compiler/testData/diagnostics/tests/annotations/onLoops.kt +++ b/compiler/testData/diagnostics/tests/annotations/onLoops.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test() { @ann while (2 < 1) {} diff --git a/compiler/testData/diagnostics/tests/annotations/options/annotationAsArg.kt b/compiler/testData/diagnostics/tests/annotations/options/annotationAsArg.kt index 5484366eef0..0eae504116c 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/annotationAsArg.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/annotationAsArg.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Annotation(val x: Int) { fun baz() {} fun bar() = x diff --git a/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.fir.kt deleted file mode 100644 index e2c064206da..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -class Annotation { - fun setProblemGroup() {} - fun getQuickFixes() = 0 -} - -fun registerQuickFix(annotation: Annotation) { - annotation.setProblemGroup() - val fixes = annotation.getQuickFixes() -} diff --git a/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.kt b/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.kt index e2c064206da..bcd405c190c 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/annotationAsArgComplex.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE class Annotation { fun setProblemGroup() {} diff --git a/compiler/testData/diagnostics/tests/annotations/options/documented.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/documented.fir.kt deleted file mode 100644 index 6b97984be50..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/documented.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -@MustBeDocumented -annotation class DocAnn - -annotation class NotDocAnn - -@DocAnn class My - -@NotDocAnn class Your diff --git a/compiler/testData/diagnostics/tests/annotations/options/documented.kt b/compiler/testData/diagnostics/tests/annotations/options/documented.kt index 6b97984be50..363c6671772 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/documented.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/documented.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @MustBeDocumented annotation class DocAnn diff --git a/compiler/testData/diagnostics/tests/annotations/options/functionExpression.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/functionExpression.fir.kt deleted file mode 100644 index 7bd5906366e..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/functionExpression.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -@Target(AnnotationTarget.EXPRESSION) -@Retention(AnnotationRetention.SOURCE) -annotation class ExprAnn - -@Target(AnnotationTarget.FUNCTION) -annotation class FunAnn - -fun foo(): Int { - val x = @ExprAnn fun() = 1 - val y = @FunAnn fun() = 2 - return x() + y() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/functionExpression.kt b/compiler/testData/diagnostics/tests/annotations/options/functionExpression.kt index 7bd5906366e..cbf7fb85c65 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/functionExpression.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/functionExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.EXPRESSION) @Retention(AnnotationRetention.SOURCE) annotation class ExprAnn diff --git a/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.fir.kt deleted file mode 100644 index 3c50e6cf83b..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: DocumentedAnnotations.java - -import java.lang.annotation.*; - -public class DocumentedAnnotations { - - @Documented public @interface DocAnn {}; - - public @interface NotDocAnn {}; - - @Documented @Retention(RetentionPolicy.RUNTIME) public @interface RunDocAnn {}; -} - -// FILE: DocumentedAnnotations.kt - -@DocumentedAnnotations.DocAnn class My - -@DocumentedAnnotations.NotDocAnn class Your - -@DocumentedAnnotations.RunDocAnn class His diff --git a/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt b/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt index 3c50e6cf83b..eae032b0d7f 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/javaDocumented.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: DocumentedAnnotations.java import java.lang.annotation.*; diff --git a/compiler/testData/diagnostics/tests/annotations/options/javaretention.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/javaretention.fir.kt deleted file mode 100644 index 9da8584e996..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/javaretention.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -// FILE: AnnotationRetentions.java - -import java.lang.annotation.*; - -public class AnnotationRetentions { - - public @interface BaseAnnotation { - - } - - @Retention(RetentionPolicy.SOURCE) - public @interface SourceAnnotation { - - } - - @Retention(RetentionPolicy.CLASS) - public @interface BinaryAnnotation { - - } - - @Retention(RetentionPolicy.RUNTIME) - public @interface RuntimeAnnotation { - - } -} - -// FILE: AnnotationRetentions.kt - -@AnnotationRetentions.BaseAnnotation class BaseClass - -@AnnotationRetentions.SourceAnnotation class SourceClass - -@AnnotationRetentions.BinaryAnnotation class BinaryClass - -@AnnotationRetentions.RuntimeAnnotation class RuntimeClass diff --git a/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt b/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt index 9da8584e996..c1f33507600 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/javaretention.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: AnnotationRetentions.java import java.lang.annotation.*; diff --git a/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.fir.kt deleted file mode 100644 index 4f9a6d917c8..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -@Target(AnnotationTarget.CLASS) -annotation class Ann - -open class My - -fun foo(): My { - return (@Ann object: My() {}) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.kt b/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.kt index 4f9a6d917c8..9e42ca41500 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/objectLiteral.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.CLASS) annotation class Ann diff --git a/compiler/testData/diagnostics/tests/annotations/options/retention.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/retention.fir.kt deleted file mode 100644 index 2ea2d384d69..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/retention.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -@Retention(AnnotationRetention.SOURCE) -annotation class sourceann - -@sourceann class AnnotatedAtSource diff --git a/compiler/testData/diagnostics/tests/annotations/options/retention.kt b/compiler/testData/diagnostics/tests/annotations/options/retention.kt index 2ea2d384d69..20a6fa20adf 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/retention.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/retention.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Retention(AnnotationRetention.SOURCE) annotation class sourceann diff --git a/compiler/testData/diagnostics/tests/annotations/options/target.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/target.fir.kt deleted file mode 100644 index 107ff9bb57f..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/target.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -@Target(AnnotationTarget.CLASS) -annotation class base - -@base data class My(val x: Int) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/options/target.kt b/compiler/testData/diagnostics/tests/annotations/options/target.kt index 107ff9bb57f..f97f6815b15 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/target.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/target.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.CLASS) annotation class base diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.fir.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.fir.kt deleted file mode 100644 index a2bcb5cb48c..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -@file:Suppress("abc") - -fun foo(): Int { - @Suppress("xyz") return 1 -} diff --git a/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.kt b/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.kt index a2bcb5cb48c..4fa00cc2a8a 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.kt +++ b/compiler/testData/diagnostics/tests/annotations/options/targets/suppress.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @file:Suppress("abc") fun foo(): Int { diff --git a/compiler/testData/diagnostics/tests/annotations/typeAnnotations.fir.kt b/compiler/testData/diagnostics/tests/annotations/typeAnnotations.fir.kt deleted file mode 100644 index d0e22f7c574..00000000000 --- a/compiler/testData/diagnostics/tests/annotations/typeAnnotations.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER -class A - -@Target(AnnotationTarget.TYPE) -annotation class x - -fun @x A.foo(a: @x Int) { - val v: @x Int = 1 -} - -fun @x List<@x T>.foo(l: List<@x T>): @x List<@x T> = throw Exception() - -fun List<@x T>.firstTyped(): U = throw Exception() - -val @x List<@x T>.f: Int get() = 42 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt index d0e22f7c574..f8c4a8c0fdc 100644 --- a/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt +++ b/compiler/testData/diagnostics/tests/annotations/typeAnnotations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER class A diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetSet.fir.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetSet.fir.kt deleted file mode 100644 index db201619dcb..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetSet.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class Flower() { - - var minusOne: Int = 1 - get() = field + 1 - set(n: Int) { field = n - 1 } -} diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetSet.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetSet.kt index db201619dcb..ec12dbb342f 100644 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetSet.kt +++ b/compiler/testData/diagnostics/tests/backingField/CustomGetSet.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Flower() { var minusOne: Int = 1 diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetVal.fir.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetVal.fir.kt deleted file mode 100644 index 383f29764d2..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetVal.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class CustomGetVal() { - val zz = 1 - get() = field * 2 -} diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetVal.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetVal.kt index 383f29764d2..efe72b1bf1d 100644 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetVal.kt +++ b/compiler/testData/diagnostics/tests/backingField/CustomGetVal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class CustomGetVal() { val zz = 1 get() = field * 2 diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.fir.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.fir.kt deleted file mode 100644 index c76eab0e2c4..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -package customGetValGlobal - val zz = 1 - get() = field * 2 diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.kt index c76eab0e2c4..6923bc50489 100644 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.kt +++ b/compiler/testData/diagnostics/tests/backingField/CustomGetValGlobal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package customGetValGlobal val zz = 1 get() = field * 2 diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetVar.fir.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetVar.fir.kt deleted file mode 100644 index 62aebd10741..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetVar.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class Raise() { - var zz = 1 - get() = field * 2 -} diff --git a/compiler/testData/diagnostics/tests/backingField/CustomGetVar.kt b/compiler/testData/diagnostics/tests/backingField/CustomGetVar.kt index 62aebd10741..e07350e95cf 100644 --- a/compiler/testData/diagnostics/tests/backingField/CustomGetVar.kt +++ b/compiler/testData/diagnostics/tests/backingField/CustomGetVar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Raise() { var zz = 1 get() = field * 2 diff --git a/compiler/testData/diagnostics/tests/backingField/CustomSet.fir.kt b/compiler/testData/diagnostics/tests/backingField/CustomSet.fir.kt deleted file mode 100644 index e2319e7505a..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/CustomSet.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class Raise() { - var zz = 1 - set(it) { field = it / 2 } -} diff --git a/compiler/testData/diagnostics/tests/backingField/CustomSet.kt b/compiler/testData/diagnostics/tests/backingField/CustomSet.kt index e2319e7505a..1bfb7db8f77 100644 --- a/compiler/testData/diagnostics/tests/backingField/CustomSet.kt +++ b/compiler/testData/diagnostics/tests/backingField/CustomSet.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Raise() { var zz = 1 set(it) { field = it / 2 } diff --git a/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.fir.kt b/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.fir.kt deleted file mode 100644 index a0990d567d3..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class My(val field: Int) { - // Backing field, initializer - val second: Int = 0 - get() = field - - // No backing field, no initializer - val third: Int - get() = this.field -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.kt b/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.kt index a0990d567d3..1d70aa7fc06 100644 --- a/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.kt +++ b/compiler/testData/diagnostics/tests/backingField/FieldAsProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class My(val field: Int) { // Backing field, initializer val second: Int = 0 diff --git a/compiler/testData/diagnostics/tests/backingField/FieldDerived.fir.kt b/compiler/testData/diagnostics/tests/backingField/FieldDerived.fir.kt deleted file mode 100644 index 02c7621e8ff..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/FieldDerived.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -open class Base { - open val x: Int = 1 - get() = field - 1 -} - -class Other: Base() { - override val x = 2 -} - -class Another: Base() { - override val x = 3 - get() = field + 1 -} - -class NoBackingField: Base() { - override val x: Int - get() = 5 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/backingField/FieldDerived.kt b/compiler/testData/diagnostics/tests/backingField/FieldDerived.kt index 02c7621e8ff..ced269b1a44 100644 --- a/compiler/testData/diagnostics/tests/backingField/FieldDerived.kt +++ b/compiler/testData/diagnostics/tests/backingField/FieldDerived.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Base { open val x: Int = 1 get() = field - 1 diff --git a/compiler/testData/diagnostics/tests/backingField/FieldInLocal.fir.kt b/compiler/testData/diagnostics/tests/backingField/FieldInLocal.fir.kt deleted file mode 100644 index cc14a9b10cd..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/FieldInLocal.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -fun foo() { - open class Local { - val my: Int = 2 - get() = field - } - val your = object: Local() { - val your: Int = 3 - get() = field - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/backingField/FieldInLocal.kt b/compiler/testData/diagnostics/tests/backingField/FieldInLocal.kt index cc14a9b10cd..a5994817b01 100644 --- a/compiler/testData/diagnostics/tests/backingField/FieldInLocal.kt +++ b/compiler/testData/diagnostics/tests/backingField/FieldInLocal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE fun foo() { open class Local { diff --git a/compiler/testData/diagnostics/tests/backingField/FieldOnVal.fir.kt b/compiler/testData/diagnostics/tests/backingField/FieldOnVal.fir.kt deleted file mode 100644 index 02554ee0a3b..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/FieldOnVal.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -val my: Int = 21 - get() = field * 2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/backingField/FieldOnVal.kt b/compiler/testData/diagnostics/tests/backingField/FieldOnVal.kt index 02554ee0a3b..befc2399656 100644 --- a/compiler/testData/diagnostics/tests/backingField/FieldOnVal.kt +++ b/compiler/testData/diagnostics/tests/backingField/FieldOnVal.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL val my: Int = 21 get() = field * 2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/backingField/FieldOnVar.fir.kt b/compiler/testData/diagnostics/tests/backingField/FieldOnVar.fir.kt deleted file mode 100644 index 882c035d8e2..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/FieldOnVar.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -var my: Int = 0 - get() = -field - set(arg) { - field = arg - } diff --git a/compiler/testData/diagnostics/tests/backingField/FieldOnVar.kt b/compiler/testData/diagnostics/tests/backingField/FieldOnVar.kt index 882c035d8e2..1293fef29fb 100644 --- a/compiler/testData/diagnostics/tests/backingField/FieldOnVar.kt +++ b/compiler/testData/diagnostics/tests/backingField/FieldOnVar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL var my: Int = 0 get() = -field set(arg) { diff --git a/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.fir.kt b/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.fir.kt deleted file mode 100644 index a5bd01f37dc..00000000000 --- a/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// KT-782 Allow backing field usage for accessors of variables on namespace level - -package kt782 - -val z : Int = 34 - -val y : Int = 11 -get() { - return field -} - -val x : Int -get() = z - -val w : Int = 56 -get() = field \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.kt b/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.kt index a5bd01f37dc..94b89b456d5 100644 --- a/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.kt +++ b/compiler/testData/diagnostics/tests/backingField/kt782packageLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-782 Allow backing field usage for accessors of variables on namespace level package kt782 diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.fir.kt deleted file mode 100644 index 870501ae0fb..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: 1.kt - -package a - -import b.B.* -import kotlin.reflect.KClass - -class Companion - -val f: KClass = Companion::class - -// FILE: 2.kt - -package b - -class B { - companion object Companion -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.kt b/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.kt index 870501ae0fb..c57d4a25232 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedCompanion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: 1.kt package a diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.fir.kt deleted file mode 100644 index 0b2434d7c0d..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: 1.kt - -package a - -import b.* -import kotlin.reflect.KClass - -class A -object B - -val f: KClass = A::class -val g: KClass = B::class - -// FILE: 2.kt - -package b - -object A -object B diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.kt b/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.kt index 0b2434d7c0d..0acfc06da8f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/classVsStarImportedObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: 1.kt package a diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.fir.kt deleted file mode 100644 index 2babceacb13..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -import kotlin.reflect.KClass - -fun test(s: String) { - val f: () -> Int = s::hashCode - val g: () -> String = s::toString - val h: (Any?) -> Boolean = s::equals - - val k: KClass = s::class - val l: KClass<*> = s::class - val m: KClass = String::class - val n: KClass = Unit::class -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.kt b/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.kt index 2babceacb13..8669e3dad53 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/expectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE import kotlin.reflect.KClass diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/object.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/object.fir.kt deleted file mode 100644 index d2b6f013005..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/object.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !CHECK_TYPE - -object Obj { - fun foo() {} - val bar = 2 -} - -fun test() { - checkSubtype<() -> Unit>(Obj::foo) - checkSubtype<() -> Int>(Obj::bar) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/object.kt b/compiler/testData/diagnostics/tests/callableReference/bound/object.kt index d2b6f013005..04b9bf37cdf 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/object.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/object.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE object Obj { diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.fir.kt deleted file mode 100644 index 43b869004af..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: A.java - -class A { - public CharSequence getFoo() { return null; } -} - -// FILE: test.kt - -fun test() { - with (A()) { - foo::toString - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.kt b/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.kt index 43b869004af..eb756a0a6e7 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/syntheticExtensionOnLHS.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java class A { diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.fir.kt deleted file mode 100644 index 928a186a85c..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun get(t: T): () -> String { - return t::toString -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.kt b/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.kt index 928a186a85c..16da5b99615 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/valueOfTypeParameterType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun get(t: T): () -> String { return t::toString } diff --git a/compiler/testData/diagnostics/tests/callableReference/classVsPackage.fir.kt b/compiler/testData/diagnostics/tests/callableReference/classVsPackage.fir.kt deleted file mode 100644 index 13c46fdf61e..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/classVsPackage.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// MODULE: m1 -// FILE: 1.kt - -package a - -class b { - class c -} - -// MODULE: m2 -// FILE: 2.kt - -package a.b - -class c { - fun foo() {} -} - -// MODULE: m3(m1, m2) -// FILE: test.kt - -package test - -fun test() = a.b.c::foo diff --git a/compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt b/compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt index 13c46fdf61e..b2569fd80eb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt +++ b/compiler/testData/diagnostics/tests/callableReference/classVsPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: 1.kt diff --git a/compiler/testData/diagnostics/tests/callableReference/emptyLhs.fir.kt b/compiler/testData/diagnostics/tests/callableReference/emptyLhs.fir.kt deleted file mode 100644 index cf009c8a4fe..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/emptyLhs.fir.kt +++ /dev/null @@ -1,41 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION, -EXTENSION_SHADOWED_BY_MEMBER -// !LANGUAGE: +CallableReferencesToClassMembersWithEmptyLHS - -val topLevelVal = 1 -fun topLevelFun() = 2 - -val A.extensionVal: Int get() = 3 -fun A.extensionFun(): Int = 4 - -class A { - val memberVal = 5 - fun memberFun() = 6 - - val ok1 = ::topLevelVal - val ok2 = ::topLevelFun - - fun fail1() { - ::extensionVal - ::extensionFun - } - - fun fail2() { - ::memberVal - ::memberFun - } -} - - - -val ok1 = ::topLevelVal -val ok2 = ::topLevelFun - -fun A.fail1() { - ::extensionVal - ::extensionFun -} - -fun A.fail2() { - ::memberVal - ::memberFun -} diff --git a/compiler/testData/diagnostics/tests/callableReference/emptyLhs.kt b/compiler/testData/diagnostics/tests/callableReference/emptyLhs.kt index cf009c8a4fe..a8c3213b4f3 100644 --- a/compiler/testData/diagnostics/tests/callableReference/emptyLhs.kt +++ b/compiler/testData/diagnostics/tests/callableReference/emptyLhs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION, -EXTENSION_SHADOWED_BY_MEMBER // !LANGUAGE: +CallableReferencesToClassMembersWithEmptyLHS diff --git a/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.fir.kt deleted file mode 100644 index 76c0a667973..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -open class A { - fun foo() = 42 - - object B: A() -} - -fun test() { - (A::foo)(A.B) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.kt b/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.kt index 76c0a667973..e29595fc828 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/callableRefrenceOnNestedObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A { fun foo() = 42 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.fir.kt deleted file mode 100644 index fef4ee7ca36..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -class A { - fun main() { - val x = ::A - - checkSubtype>(x) - } -} - -class SomeOtherClass { - fun main() { - val x = ::A - - checkSubtype>(x) - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.kt index fef4ee7ca36..33e983821bb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.fir.kt deleted file mode 100644 index fef220c5282..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: A.kt - -open class A(val x: T) - -// FILE: AFactory.kt - -abstract class AFactory { - abstract fun create(): A? -} - -// FILE: Util.kt - -inline fun createWith(x: T, f: (T) -> A?) - = f(x) - -// FILE: B.kt - -class B(x: Int) : A(x) { - companion object : AFactory() { - override fun create(): A? = createWith(0, ::B) - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.kt index fef220c5282..172a9838e35 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromCompanion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.kt open class A(val x: T) diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.fir.kt deleted file mode 100644 index 07c789acecf..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -class A -class B - -fun A.ext() { - val x = ::A - val y = ::B - - checkSubtype>(x) - checkSubtype>(y) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.kt index 07c789acecf..e9967137450 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.fir.kt deleted file mode 100644 index 56af7cecad4..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -class A - -class B { - fun A.ext() { - val x = ::A - val y = ::B - - checkSubtype>(x) - checkSubtype>(y) - } - - fun B.ext() { - val x = ::A - val y = ::B - - checkSubtype>(x) - checkSubtype>(y) - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.kt index 56af7cecad4..b301effa6fb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromExtensionInClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.fir.kt deleted file mode 100644 index 4417c6fdef1..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -class A - -fun main() { - val x = ::A - - checkSubtype>(x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.kt index 4417c6fdef1..b93494ea99b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/constructorFromTopLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/empty.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/empty.fir.kt deleted file mode 100644 index 243660cb419..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/empty.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class A - -fun main() { - val x = :: ; - val y = A:: -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/empty.kt b/compiler/testData/diagnostics/tests/callableReference/function/empty.kt index 243660cb419..3ab1ac576f8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/empty.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/empty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A fun main() { diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.fir.kt deleted file mode 100644 index 5434e7241ab..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS:-UNUSED_VARIABLE - -import kotlin.reflect.* - -class A { - fun foo() {} -} - -fun A?.foo() {} - -val f: KFunction1 = A::foo -val g: KFunction1 = A?::foo diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.kt index 5434e7241ab..60b405b104e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/extensionOnNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS:-UNUSED_VARIABLE import kotlin.reflect.* diff --git a/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.fir.kt deleted file mode 100644 index 4127983d232..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction1 - -class A(val t: T) { - fun foo(): T = t -} - -fun bar() { - val x = A::foo - - checkSubtype, String>>(x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.kt b/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.kt index 4127983d232..47187cfe094 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/genericClassFromTopLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction1 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.fir.kt deleted file mode 100644 index 1cc92a66444..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !CHECK_TYPE -// FILE: test/A.java - -package test; - -import java.util.Arrays; - -public class A { - public static void main(String[] args) { - System.out.println(Arrays.asList(args)); - } -} - -// FILE: 1.kt - -import kotlin.reflect.* -import test.A - -fun foo(args: Array) { - val main2 = A::main - checkSubtype, Unit>>(main2) - main2(args) - (A::main)(args) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.kt b/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.kt index 1cc92a66444..a5a11074c78 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/javaStaticMethod.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: test/A.java diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.fir.kt deleted file mode 100644 index d42785c511b..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -fun main() { - class A - - val x = ::A - checkSubtype>(x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.kt index d42785c511b..8fed93a2d00 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/localConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.fir.kt deleted file mode 100644 index 28dcb81eeaa..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -fun main() { - class A - - class B { - fun Int.foo() { - val x = ::A - checkSubtype>(x) - } - fun A.foo() { - val x = ::A - checkSubtype>(x) - } - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.kt index 28dcb81eeaa..a602da14566 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromExtensionInLocalClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.fir.kt deleted file mode 100644 index 0bcab8a24d6..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -import kotlin.reflect.KFunction0 - -fun main() { - class A - - class B { - val x = ::A - val f: KFunction0 = x - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.kt index 0bcab8a24d6..a26758a80ea 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.KFunction0 fun main() { diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.fir.kt deleted file mode 100644 index 9fd725f079d..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -fun main() { - class A - - fun A.foo() { - val x = ::A - checkSubtype>(x) - } - - fun Int.foo() { - val x = ::A - checkSubtype>(x) - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.kt b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.kt index 9fd725f079d..eaeef095c65 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/localConstructorFromLocalExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.fir.kt deleted file mode 100644 index 143296f288d..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !CHECK_TYPE -// FILE: a.kt - -package a.b.c - -class D { - fun foo() = 42 -} - -// FILE: b.kt - -import kotlin.reflect.KFunction1 - -fun main() { - val x = a.b.c.D::foo - - checkSubtype>(x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.kt b/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.kt index 143296f288d..0d57ba4bedc 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/longQualifiedName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.fir.kt deleted file mode 100644 index 1a7e3240ca9..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KFunction0 - -class A { - class Nested -} - -fun main() { - val x = A::Nested - - checkSubtype>(x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.kt index 1a7e3240ca9..b20c7336b16 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromTopLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.fir.kt deleted file mode 100644 index 77ed0bde41f..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -fun bar() = 42 - -fun main() { - fun bar() = 239 - - ::bar -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.kt b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.kt index 77ed0bde41f..8a80fe950d5 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityLocalVsTopLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION fun bar() = 42 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.fir.kt deleted file mode 100644 index 4a1fcff935d..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// SKIP_TXT -// FILE: A.java -class A { - private static void foo() {} - public String foo(int x) {} -} -// FILE: main.kt -fun main() { - (A::foo)(A(), 1) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.kt b/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.kt index 4a1fcff935d..ffad512dcf0 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/privateStaticAndPublicMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // FILE: A.java class A { diff --git a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.fir.kt b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.fir.kt deleted file mode 100644 index a4caa63e3d4..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType - -fun foo(a: String, b: Int = 5): String { - return a + b -} - -fun bar1(body: (String) -> String): String { - return body("something") -} - -fun bar2(body: (String, Int) -> String): String { - return body("something", 0) -} - -fun test() { - bar1(::foo) - bar2(::foo) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.kt b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.kt index a4caa63e3d4..dfdffd4f930 100644 --- a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.kt +++ b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType_enabled.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +FunctionReferenceWithDefaultValueAsOtherType fun foo(a: String, b: Int = 5): String { diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.fir.kt deleted file mode 100644 index 895abad9df6..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Case -fun test(case: Case) {} -fun runTest(method: (Case) -> Unit) {} - -fun runTestGeneric(f: (Case) -> Unit) {} - -fun test() { - runTest(::test) - runTestGeneric(::test) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.kt b/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.kt index 895abad9df6..e0887f9e9e4 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/argumentExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Case diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.fir.kt deleted file mode 100644 index fa82df7a68f..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// KT-10968 Callable reference: type inference by function return type - -fun getT(): T = null!! - -fun getString() = "" - -fun test() { - val a : () -> String = ::getString - val b : () -> String = ::getT -} diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.kt index fa82df7a68f..854da4e1ab6 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/kt10968.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // KT-10968 Callable reference: type inference by function return type diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.fir.kt deleted file mode 100644 index 2286bb05bcf..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// KT-12286 Strange type is required for generic callable reference - -fun > maxOf(a: T, b: T): T = if (a < b) b else a - -fun > useMaxOf() { - val f: (T, T) -> T = ::maxOf -} diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.kt index 2286bb05bcf..cf46750f5a8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/kt12286.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // KT-12286 Strange type is required for generic callable reference diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.fir.kt deleted file mode 100644 index d726da863a1..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-35896 - -interface B - -class Inv - -class Foo(x: Int): B> - -fun bar(list: T2, fn: (S) -> B) {} - -fun foo(list: Inv) { - bar(list, ::Foo) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.kt index d726da863a1..3cec1d7a63e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/kt35896.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // ISSUE: KT-35896 diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.fir.kt deleted file mode 100644 index 8a20367ae65..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - - -fun shuffle(x: List): List = x - -fun bar() { - val s: (List) -> List = ::shuffle -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.kt index 8a20367ae65..d8106f0789e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/kt7470.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.fir.kt b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.fir.kt deleted file mode 100644 index 17b15007eff..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun fun2(f: kotlin.reflect.KFunction1, a: A1) { - f.invoke(a) -} - -fun containsRegex(vararg otherPatterns: String) {} - -fun main() { - fun2(::containsRegex, arrayOf("foo")) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.kt b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.kt index 17b15007eff..61459c671ad 100644 --- a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.kt +++ b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVarargAndKFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.fir.kt b/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.fir.kt deleted file mode 100644 index bc6855270e0..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_VARIABLE - -fun test() { - data class Pair(val first: F, val second: S) - val (x, y) = - Pair(1, - if (1 == 1) - Pair::first - else - Pair::second) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.kt b/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.kt index 2305ed384be..295c95df3eb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt15439_completeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_VARIABLE fun test() { diff --git a/compiler/testData/diagnostics/tests/callableReference/kt25433.fir.kt b/compiler/testData/diagnostics/tests/callableReference/kt25433.fir.kt deleted file mode 100644 index b9a172d117d..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/kt25433.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// Issue: KT-25433 - -import kotlin.reflect.* - -fun hidden(nameProp: KProperty1, value: R) {} -fun hiddenFun(nameFunc: KFunction1, value: R) {} - -class App(val nullable: String?) { - fun nullableFun(): String? = null -} - -fun test() { - hidden(App::nullable, "foo") - hiddenFun(App::nullableFun, "foo") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/kt25433.kt b/compiler/testData/diagnostics/tests/callableReference/kt25433.kt index b9a172d117d..6dbefb55767 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt25433.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt25433.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER // Issue: KT-25433 diff --git a/compiler/testData/diagnostics/tests/callableReference/kt32256.fir.kt b/compiler/testData/diagnostics/tests/callableReference/kt32256.fir.kt deleted file mode 100644 index 09de610906f..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/kt32256.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -// Issue: KT-32256 - -fun main() { - myMethod(::refA) - myMethod(::refB) - anotherMethod(::refA) - anotherMethod(::refB) -} - -suspend fun refA(input: String): String { - return input -} - -suspend fun refB(): String { - return "Hello, World!" -} - -fun myMethod(f: suspend (String) -> String) {} - -fun myMethod(f: suspend () -> String) {} - -fun anotherMethod(f: suspend (I) -> O) {} - -fun anotherMethod(f: suspend () -> O) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/kt32256.kt b/compiler/testData/diagnostics/tests/callableReference/kt32256.kt index 09de610906f..b54cdbaa996 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt32256.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt32256.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // Issue: KT-32256 diff --git a/compiler/testData/diagnostics/tests/callableReference/kt35959.fir.kt b/compiler/testData/diagnostics/tests/callableReference/kt35959.fir.kt deleted file mode 100644 index 81c3ef8e1eb..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/kt35959.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-35959 - -interface Expect - -inline val Expect.and: Expect get() = this -infix fun Expect.and(assertionCreator: Expect.() -> Unit): Expect = this - -fun id(x: K): K = x - -fun test(): Expect.(Expect.() -> Unit) -> Expect = id(Expect::and) diff --git a/compiler/testData/diagnostics/tests/callableReference/kt35959.kt b/compiler/testData/diagnostics/tests/callableReference/kt35959.kt index 81c3ef8e1eb..1be035af1f3 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt35959.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt35959.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // ISSUE: KT-35959 diff --git a/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.fir.kt b/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.fir.kt deleted file mode 100644 index 20a66918169..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// !LANGUAGE: +NewInference - -import kotlin.reflect.KFunction1 -import kotlin.reflect.KFunction2 - -object Foo { - fun bar(fn: KFunction1): String = "" - fun bar(fn: KFunction2): Int = 10 -} - -class A -class B - -fun A.test() = true // everything is OK without this line -fun B.test() = true - -fun main() { - val x = Foo.bar(B::test) // ambiguity in NI -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.kt b/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.kt index 20a66918169..d8174d599da 100644 --- a/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.kt +++ b/compiler/testData/diagnostics/tests/callableReference/noAmbiguityWhenAllReferencesAreInapplicable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // !LANGUAGE: +NewInference diff --git a/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.fir.kt deleted file mode 100644 index ec5c86975b4..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KProperty1 - -open class Base { - val foo: Int = 42 -} - -open class Derived : Base() - -fun test() { - val o = Base::foo - checkSubtype>(o) - checkSubtype(o.get(Derived())) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.kt b/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.kt index ec5c86975b4..04cffdb9f7b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/accessViaSubclass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KProperty1 diff --git a/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.fir.kt deleted file mode 100644 index 8630be83473..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS:-UNUSED_VARIABLE - -import kotlin.reflect.* - -class A(var g: A) { - val f: Int = 0 - - fun test() { - val fRef: KProperty1 = A::f - val gRef: KMutableProperty1 = A::g - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.kt b/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.kt index 8630be83473..9d147b16864 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/classFromClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS:-UNUSED_VARIABLE import kotlin.reflect.* diff --git a/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.fir.kt deleted file mode 100644 index ac0014dd549..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE - -val Any?.meaning: Int - get() = 42 - -fun test() { - val f = Any?::meaning - checkSubtype(f.get(null)) - checkSubtype(f.get("")) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt b/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt index ac0014dd549..6edd24d038b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/extensionPropertyOnNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE val Any?.meaning: Int diff --git a/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.fir.kt deleted file mode 100644 index bc4cf86bfff..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun check1(p: kotlin.reflect.KProperty1<*, *>) {} -fun check2(p: kotlin.reflect.KProperty1) {} - -val CharSequence.x: Any get() = this -val BooleanArray.x: Any get() = this - -fun box() { - check1(CharSequence::x) // error in NI, ok in OI - check2(CharSequence::x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt b/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt index bc4cf86bfff..ccbbf5c0d92 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/extensionsSameName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/property/genericClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/genericClass.fir.kt deleted file mode 100644 index 3c1181248c1..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/genericClass.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KProperty1 - -class A(val t: T) { - val foo: T = t -} - -fun bar() { - val x = A::foo - checkSubtype, String>>(x) - checkSubtype, Any?>>(x) - - val y = A<*>::foo - checkSubtype, Any?>>(y) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt b/compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt index 3c1181248c1..94a01d13be1 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/genericClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KProperty1 diff --git a/compiler/testData/diagnostics/tests/callableReference/property/kt7564.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/kt7564.fir.kt deleted file mode 100644 index 0be4a663de9..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/kt7564.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -import kotlin.reflect.* - -fun checkSubtype(t: T) = t - -class A(var g: A) { - val f: Int = 0 - - fun test() { - checkSubtype>(A::f) - checkSubtype>(A::g) - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/property/kt7564.kt b/compiler/testData/diagnostics/tests/callableReference/property/kt7564.kt index 0be4a663de9..449d48ca669 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/kt7564.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/kt7564.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.* fun checkSubtype(t: T) = t diff --git a/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.fir.kt deleted file mode 100644 index b63c2baea8f..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// KT-12982 Incorrect type inference when accessing mutable protected property via reflection - -import kotlin.reflect.KMutableProperty1 - -class Foo { - protected var x = 0 - - fun baz(p: KMutableProperty1) = p - fun print() = baz(Foo::x) -} - - -open class A { - protected fun a() {} -} - -open class B : A() { - val x = C::a - val y = C()::a -} - -class C : B() diff --git a/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.kt b/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.kt index b63c2baea8f..e9372a0fb8a 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/protectedVarFromClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-12982 Incorrect type inference when accessing mutable protected property via reflection import kotlin.reflect.KMutableProperty1 diff --git a/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.fir.kt deleted file mode 100644 index 4cae96f7f07..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -import kotlin.reflect.KProperty1 - -fun getProperty(x: T, property: KProperty1): R = - property.get(x) - -class Person(val name: String) - -val name1 = getProperty(Person("John Smith"), Person::name) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.kt b/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.kt index 4cae96f7f07..2e911fde323 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/returnTypeDependentOnGenericProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.KProperty1 fun getProperty(x: T, property: KProperty1): R = diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.fir.kt deleted file mode 100644 index 55fa377705e..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -fun foo(s: String) {} - -object Scope { - fun foo(a: Int) {} - fun foo(b: Boolean) {} - - fun bar(f: (T) -> Unit): T = TODO() - - fun test() { - val s: String = bar(::foo) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.kt index 55fa377705e..35214db5dc1 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/applicableCallableReferenceFromDistantScope.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.fir.kt deleted file mode 100644 index bcae8c1979b..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun foo() {} -fun foo(s: String) {} - -fun fn(f: () -> Unit) {} - -fun test() { - fn(::foo) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.kt index bcae8c1979b..d7155d78475 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/byArgType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() {} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.fir.kt deleted file mode 100644 index eacdd3e44de..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KFunction2 - -class Foo - -fun test(fn: KFunction2, String>) = null - -fun Foo.bar(vararg x: String) = "" -fun Foo.bar(vararg x: Int) = "" - - -fun actualTest() { - test(Foo::bar) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.kt index eacdd3e44de..2e760830626 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/callableReferenceToVarargWithOverload.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.fir.kt deleted file mode 100644 index 0af36281c6b..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun test() { - foo(String::extensionReceiver) - foo(::valueParameter) -} - -fun CharSequence.extensionReceiver(): CharSequence = TODO() -fun String.extensionReceiver(): String = TODO() - -fun valueParameter(c: CharSequence): CharSequence = TODO() -fun valueParameter(s: String): CharSequence = TODO() - -fun foo(f: (String) -> R) {} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.kt index 0af36281c6b..0d5c66806e6 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseMostSpecificCandidateUsingCandidateDescriptorNotReflectionType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun test() { diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.fir.kt deleted file mode 100644 index c0c15118202..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty1 - -class Inv - -fun foo(prop: KProperty1, p: String = "") {} - -fun foo(prop: KProperty1>, p: Int = 42) {} - -class A { - val prop = 42 -} - -fun test() { - foo(A::prop) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.kt index c0c15118202..221ee54d77c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseOuterCallBySingleCallableReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.fir.kt deleted file mode 100644 index 6cde9ce2b55..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Klass { - constructor(a: Int) {} - constructor(a: String) {} -} - -fun user(f: (Int) -> Klass) {} - -fun fn() { - user(::Klass) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.kt index 6cde9ce2b55..0df5c43c1d9 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/constructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Klass { diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.fir.kt deleted file mode 100644 index abf0ac624ee..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE - -abstract class A { - inner class InnerInA -} - -abstract class B : A() - -fun foo(a: A) { - if (a is B) { - val v = a::InnerInA - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.kt index abf0ac624ee..0a9192b1755 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/innerClassConstructorOnOuterClassInstance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE abstract class A { diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.fir.kt deleted file mode 100644 index 128893c5704..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER - -class OverloadTest { - fun foo(bar: Boolean) {} - fun foo(bar: Any?) {} -} - -inline fun OverloadTest.overload(value: T?, function: (T) -> Unit) { -} - -fun OverloadTest.overloadBoolean(value: Boolean?) = overload(value, OverloadTest()::foo) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.kt index 128893c5704..1cae2473da8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/kt10036_bound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER class OverloadTest { diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.fir.kt deleted file mode 100644 index 47b939fef44..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// KT-12751 Type inference failed with forEach and bound reference - -class L - -fun L.foo(action: (T) -> Unit): Unit {} - -class B { - fun remove(charSequence: CharSequence) {} -} - -fun foo(list: L, b: B) { - list.foo(b::remove) - list.foo(b::remove) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.kt index 47b939fef44..daeb401376c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/kt12751.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // KT-12751 Type inference failed with forEach and bound reference diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.fir.kt deleted file mode 100644 index 5ff33d63ea2..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -import kotlin.reflect.KProperty0 -import kotlin.reflect.KProperty1 - -object A - -fun property(property: KProperty1) = A - -fun property(property: KProperty0) = A - -val K.key get() : A = property(Map.Entry::key) // overload resolution ambiguity in the NI, OK in the OI diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.kt index 5ff33d63ea2..3b742bdf7a9 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.fir.kt deleted file mode 100644 index 393f4b28250..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -// KT-8596 Rewrite at slice LEXICAL_SCOPE for nested class constructor reference in an argument position - -class K { - class Nested -} - -fun foo(f: Any) {} - -fun test1() { - foo(K::Nested) -} - -// KT-10567 Error: Rewrite at slice LEXICAL_SCOPE key: REFERENCE_EXPRESSION - -class Foo(val a: String, val b: String) - -fun test2() { - val prop : Foo.() -> String = if (true) { - Foo::a - } else { - Foo::b - } -} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt index 393f4b28250..e3d685cd2ca 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/kt8596.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // KT-8596 Rewrite at slice LEXICAL_SCOPE for nested class constructor reference in an argument position diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.fir.kt deleted file mode 100644 index 4ee3798be78..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface Base -class Inv : Base - -fun foo(x: Int): Inv = TODO() -fun foo(y: String): Inv = TODO() - -fun bar(f: (T) -> Inv, p: String = "") {} - -fun bar(f: (T) -> Inv, p: Int = 4) {} - -fun test() { - bar(::foo) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.kt index 4ee3798be78..6be74e6b805 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/multipleOutersAndMultipleCallableReferences.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.fir.kt deleted file mode 100644 index 8a1a1d391b2..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty0 -import kotlin.reflect.KProperty1 - -fun property(property: KProperty0): Int = 1 -fun property(property: KProperty1): String = "" - -val subject = "" - -class O { - val subject = "" -} - -val someProperty0 = property(::subject) -val someProperty1 = property(O::subject) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.kt index 8a1a1d391b2..cbfbf2b8610 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/noAmbiguityBetweenTopLevelAndMemberProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty0 diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.fir.kt deleted file mode 100644 index b925d9861e5..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !CHECK_TYPE -// KT-12322 Overload resolution ambiguity with constructor references when class has a companion object - -class Foo { - companion object -} - -fun test() { - val a = ::Foo - checkSubtype<() -> Foo>(a) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.kt index b925d9861e5..9a4f65b829f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/noFakeDescriptorForObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // KT-12322 Overload resolution ambiguity with constructor references when class has a companion object diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.fir.kt deleted file mode 100644 index f2c83059d3e..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// KT-12799 Bound callable references not resolved for overload - -class C { - fun xf1(){} - fun xf1(s: String){} -} - -fun foo(p: (String) -> Unit){} - -fun bar(c: C) { - foo(c::xf1) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.kt index f2c83059d3e..576e2645994 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // KT-12799 Bound callable references not resolved for overload diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.fir.kt deleted file mode 100644 index 3bb136804eb..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION -// KT-9601 Chose maximally specific function in callable reference - -open class A { - fun foo(a: Any) {} - fun fas(a: Int) {} -} -class B: A() { - fun foo(a: Int) {} - fun fas(a: Any) {} -} - -fun test() { - B::foo - B::fas -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.kt index 3bb136804eb..bc024807c1b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadsMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION // KT-9601 Chose maximally specific function in callable reference diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.fir.kt deleted file mode 100644 index d63b58549f1..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -interface A -interface B - -fun foo(i: A) {} -fun foo(b: B) {} - -fun bar1(f: (T) -> Unit): T = TODO() -fun bar2(f: (T) -> Unit, e: T) {} - -fun test(a: A, b: B) { - val expectedType1: A = bar1(::foo) - val expectedType2: B = bar1(::foo) - - bar2(::foo, a) - bar2(::foo, b) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.kt index d63b58549f1..34108c51820 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/postponedResolveOfManyCallableReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.fir.kt deleted file mode 100644 index 5a9c7237ffb..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !LANGUAGE: +NewInference - -interface Base - -fun materialize(): K = TODO() - -fun Base.transform(): T = materialize() - -fun test(child: Base) { - child == child.transform() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.kt index 5a9c7237ffb..458dbf5d3a8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveEqualsOperatorWithAnyExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference interface Base diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.fir.kt deleted file mode 100644 index 44b0d4c9074..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.* - -class A { - val x = 1 - fun x() {} -} - -fun f1(): KProperty = A::x // ok, property -fun f2(): (A) -> Unit = A::x // ok, function \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.kt index 44b0d4c9074..ce66a1fc368 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/valVsFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.* diff --git a/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.fir.kt b/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.fir.kt deleted file mode 100644 index 8fe7a6dc817..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty1 - -class Sample(val str: String) - -class Inv - -class Form { - operator fun get(field: KProperty1<*, F>): Inv = TODO() -} - -fun foo(i: Inv) {} - -fun test(f: Form) { - foo(f[Sample::str]) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.kt b/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.kt index 8fe7a6dc817..7d9556225ca 100644 --- a/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.kt +++ b/compiler/testData/diagnostics/tests/callableReference/rewriteAtSliceOnGetOperator.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/sam.fir.kt b/compiler/testData/diagnostics/tests/callableReference/sam.fir.kt deleted file mode 100644 index e733d9060f1..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/sam.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// FILE: test/GenericSam.java - -package test; - -public interface GenericSam { - void invoke(T t); -} - -// FILE: test.kt - -import test.GenericSam - -fun f1() = Runnable::class -fun f2() = Runnable::run -fun f3() = java.lang.Runnable::class -fun f4() = java.lang.Runnable::run - -fun f5() = GenericSam::class -fun f6() = GenericSam<*>::invoke -fun f7() = test.GenericSam::class -fun f8() = test.GenericSam::invoke - -fun g1() = Runnable {}::class -fun g2() = Runnable {}::run -fun g3() = java.lang.Runnable {}::class -fun g4() = java.lang.Runnable {}::run - -fun g5() = GenericSam {}::class -fun g6() = GenericSam {}::invoke -fun g7() = test.GenericSam {}::class -fun g8() = test.GenericSam {}::invoke diff --git a/compiler/testData/diagnostics/tests/callableReference/sam.kt b/compiler/testData/diagnostics/tests/callableReference/sam.kt index e733d9060f1..7095e33a06c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/sam.kt +++ b/compiler/testData/diagnostics/tests/callableReference/sam.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: test/GenericSam.java package test; diff --git a/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.fir.kt b/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.fir.kt deleted file mode 100644 index e6d7d426df4..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.* - -interface Parent -class Child : Parent - -class ChildHolder(var child: Child) - -interface Inv - -class Form { - fun get0(field: KMutableProperty): Inv = TODO() - fun get1(field: KProperty): Inv = TODO() - fun get2(field: KCallable): Inv = TODO() - fun get3(field: KMutableProperty1<*, F>): Inv = TODO() -} - -fun radio(field: Inv) {} - -fun test(form: Form) { - radio(form.get0(ChildHolder::child)) - radio(form.get1(ChildHolder::child)) - radio(form.get2(ChildHolder::child)) - radio(form.get3(ChildHolder::child)) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.kt b/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.kt index e6d7d426df4..6da26cea28f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.kt +++ b/compiler/testData/diagnostics/tests/callableReference/subtypeArgumentFromRHSForReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.fir.kt b/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.fir.kt deleted file mode 100644 index fdde41c88ed..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-32452 - -interface A { - suspend fun foo(input: String): String -} - -open class B { - fun call(function: suspend T.(U) -> R): R = TODO() - - fun call(function: suspend T.(U) -> List): List = TODO() -} - -class MyService : A, B() { - override suspend fun foo(input: String) = call(A::foo) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.kt b/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.kt index fdde41c88ed..b11587e76e2 100644 --- a/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.kt +++ b/compiler/testData/diagnostics/tests/callableReference/suspendCallableReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER // ISSUE: KT-32452 diff --git a/compiler/testData/diagnostics/tests/callableReference/typealiases.fir.kt b/compiler/testData/diagnostics/tests/callableReference/typealiases.fir.kt deleted file mode 100644 index 6d4bbab403e..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/typealiases.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !WITH_NEW_INFERENCE -// Issue: KT-31199 - -typealias Global = String - -fun String.toUpperCase(): String = TODO() - -inline fun Iterable.myMap(transform: (T) -> R): List { - TODO() -} - -fun usesGlobal(p: List) { - p.myMap(Global::toUpperCase) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/typealiases.kt b/compiler/testData/diagnostics/tests/callableReference/typealiases.kt index 6d4bbab403e..187b27cc0ed 100644 --- a/compiler/testData/diagnostics/tests/callableReference/typealiases.kt +++ b/compiler/testData/diagnostics/tests/callableReference/typealiases.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !WITH_NEW_INFERENCE // Issue: KT-31199 diff --git a/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.fir.kt b/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.fir.kt deleted file mode 100644 index 80d7bc794bb..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !CHECK_TYPE - -class Foo - -fun Foo?.bar() {} - -fun test() { - val r1 = Foo ?:: bar - checkSubtype<(Foo?) -> Unit>(r1) - - val r2 = Foo ? :: bar - checkSubtype<(Foo?) -> Unit>(r2) - - val r3 = Foo ? ? :: bar - checkSubtype<(Foo?) -> Unit>(r3) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.kt b/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.kt index 80d7bc794bb..cd336aa8bb5 100644 --- a/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.kt +++ b/compiler/testData/diagnostics/tests/callableReference/whitespacesInExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE class Foo diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedFine.fir.kt b/compiler/testData/diagnostics/tests/cast/AsErasedFine.fir.kt deleted file mode 100644 index ef761f25328..00000000000 --- a/compiler/testData/diagnostics/tests/cast/AsErasedFine.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ - -fun ff(c: MutableCollection) = c as MutableList diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedFine.kt b/compiler/testData/diagnostics/tests/cast/AsErasedFine.kt index ef761f25328..1e02ffa3327 100644 --- a/compiler/testData/diagnostics/tests/cast/AsErasedFine.kt +++ b/compiler/testData/diagnostics/tests/cast/AsErasedFine.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL fun ff(c: MutableCollection) = c as MutableList diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedStar.fir.kt b/compiler/testData/diagnostics/tests/cast/AsErasedStar.fir.kt deleted file mode 100644 index 2ec2a30cb89..00000000000 --- a/compiler/testData/diagnostics/tests/cast/AsErasedStar.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ - -fun ff(l: Any) = l as MutableList<*> - diff --git a/compiler/testData/diagnostics/tests/cast/AsErasedStar.kt b/compiler/testData/diagnostics/tests/cast/AsErasedStar.kt index 2ec2a30cb89..c400f40637e 100644 --- a/compiler/testData/diagnostics/tests/cast/AsErasedStar.kt +++ b/compiler/testData/diagnostics/tests/cast/AsErasedStar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun ff(l: Any) = l as MutableList<*> diff --git a/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.fir.kt b/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.fir.kt deleted file mode 100644 index b7dde7e3775..00000000000 --- a/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun f(a: (Int) -> Unit) { - a as Int.() -> Unit - - f1(a as Int.() -> Unit) -} - -fun f1(a: Int.() -> Unit) { - a as (Int) -> Unit - f(a as (Int) -> Unit) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.kt b/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.kt index b7dde7e3775..343c7c708ec 100644 --- a/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.kt +++ b/compiler/testData/diagnostics/tests/cast/ExtensionAsNonExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun f(a: (Int) -> Unit) { a as Int.() -> Unit diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.fir.kt deleted file mode 100644 index 5df28bb45fd..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -open class BaseTwo -open class DerivedWithOne: BaseTwo() - -// a is BaseTwo => if (a is DerivedWithOne) a is DerivedWithOne -fun testing(a: BaseTwo) = a is DerivedWithOne diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.kt index 5df28bb45fd..2e1adf4ddb7 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForDerivedWithOneSubstitutedAndOneSameGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class BaseTwo open class DerivedWithOne: BaseTwo() diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.fir.kt deleted file mode 100644 index 09d7b2f6792..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -open class A -open class B: A() - -open class Base -open class SubBase : Base() - -// l is Base<+B> => if (l is SubBase) l is SubBase<+B> => l is SubBase<+A> -fun ff(l: Base) = l is SubBase diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.kt index 09d7b2f6792..68b3d3ed7fd 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForOverridenVarianceWithProjection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A open class B: A() diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.fir.kt deleted file mode 100644 index 41baa2a3676..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -open class BaseMulti -class SomeMultiDerived: BaseMulti() - -// t is BaseMulti<+String, String> => if (t is SomeMultiDerived) => t is SomeMultiDerived<+String> => -// => (String <: Any, SomeMultiDerived) t is SomeMultiDerived<+Any> -fun someDerived(t: BaseMulti) = t is SomeMultiDerived diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.kt index 41baa2a3676..36802bbfdd4 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithTwoSameTypeSubstitutions.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class BaseMulti class SomeMultiDerived: BaseMulti() diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.fir.kt deleted file mode 100644 index a481246aaad..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -open class Base -class Some: Base() - -// No erased types in check -fun f(a: Base) = a is Some diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.kt index a481246aaad..ebde844dcb5 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowForTypeWithoutTypeArguments.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Base class Some: Base() diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.fir.kt deleted file mode 100644 index 995258b9f83..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ - -open class A - -class B : A() - -fun ff(l: MutableCollection) = l is MutableList - diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.kt index 995258b9f83..daef60ebe8f 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowParameterSubtype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.fir.kt deleted file mode 100644 index d8986f1938f..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ - -fun ff(l: MutableCollection) = l is MutableList - diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.kt index d8986f1938f..2b5253d22e2 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameClassParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun ff(l: MutableCollection) = l is MutableList diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.fir.kt deleted file mode 100644 index d835e23aed3..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ - -fun ff(l: MutableCollection) = l is MutableList - diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.kt b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.kt index d835e23aed3..452179ba77e 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedAllowSameParameterParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun ff(l: MutableCollection) = l is MutableList diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.fir.kt deleted file mode 100644 index a27a5165198..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -interface A -interface B -fun testing(a: A) = a as B diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.kt b/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.kt index a27a5165198..391c1e73829 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedNonGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A interface B fun testing(a: A) = a as B diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.fir.kt deleted file mode 100644 index 0a32f3a862f..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.fir.kt +++ /dev/null @@ -1 +0,0 @@ -fun testing(a: T?) = a is T diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.kt b/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.kt index 0a32f3a862f..9f1f83a2202 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedNullableTasT.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun testing(a: T?) = a is T diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedStar.fir.kt b/compiler/testData/diagnostics/tests/cast/IsErasedStar.fir.kt deleted file mode 100644 index 0143c3643ff..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsErasedStar.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ - -fun ff(l: Any) = l is MutableList<*> diff --git a/compiler/testData/diagnostics/tests/cast/IsErasedStar.kt b/compiler/testData/diagnostics/tests/cast/IsErasedStar.kt index 0143c3643ff..c9ae4bd1e22 100644 --- a/compiler/testData/diagnostics/tests/cast/IsErasedStar.kt +++ b/compiler/testData/diagnostics/tests/cast/IsErasedStar.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL fun ff(l: Any) = l is MutableList<*> diff --git a/compiler/testData/diagnostics/tests/cast/IsTraits.fir.kt b/compiler/testData/diagnostics/tests/cast/IsTraits.fir.kt deleted file mode 100644 index defcbfb3bc9..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsTraits.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -interface Aaa -interface Bbb - -fun f(a: Aaa) = a is Bbb diff --git a/compiler/testData/diagnostics/tests/cast/IsTraits.kt b/compiler/testData/diagnostics/tests/cast/IsTraits.kt index defcbfb3bc9..7e1f24be372 100644 --- a/compiler/testData/diagnostics/tests/cast/IsTraits.kt +++ b/compiler/testData/diagnostics/tests/cast/IsTraits.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Aaa interface Bbb diff --git a/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.fir.kt b/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.fir.kt deleted file mode 100644 index 598a3e7c21e..00000000000 --- a/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// check that there is no SOE on checking for instance -interface Visitor -interface Acceptor - -class Word : Acceptor> - -class V : Visitor - -class S, U : Visitor>(val visitor: U, val acceptor: T) { - fun test() { - visitor is V - acceptor is Word - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.kt b/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.kt index 598a3e7c21e..2128aadb2c0 100644 --- a/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.kt +++ b/compiler/testData/diagnostics/tests/cast/IsWithCycleUpperBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // check that there is no SOE on checking for instance interface Visitor interface Acceptor diff --git a/compiler/testData/diagnostics/tests/cast/NullableToNullable.fir.kt b/compiler/testData/diagnostics/tests/cast/NullableToNullable.fir.kt deleted file mode 100644 index cd76ae9a3c2..00000000000 --- a/compiler/testData/diagnostics/tests/cast/NullableToNullable.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// From KT-13324: always succeeds -val x = null as String? -// From KT-260: sometimes succeeds -fun foo(a: String?): Int? { - val c = a as? Int? - return c -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/NullableToNullable.kt b/compiler/testData/diagnostics/tests/cast/NullableToNullable.kt index cd76ae9a3c2..ef045bf58f8 100644 --- a/compiler/testData/diagnostics/tests/cast/NullableToNullable.kt +++ b/compiler/testData/diagnostics/tests/cast/NullableToNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // From KT-13324: always succeeds val x = null as String? // From KT-260: sometimes succeeds diff --git a/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.fir.kt b/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.fir.kt deleted file mode 100644 index fcd72edcbe1..00000000000 --- a/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface I1 -interface I2 - -fun foo(i: I1) {} -fun foo(i: I2) {} - -fun bar(i: I1) { - if (i is I2) { - foo(i as I1) - foo(i as I2) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt b/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt index fcd72edcbe1..7583e0a7699 100644 --- a/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt +++ b/compiler/testData/diagnostics/tests/cast/StableTypeForUselessCast.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface I1 diff --git a/compiler/testData/diagnostics/tests/cast/WhenWithExpression.fir.kt b/compiler/testData/diagnostics/tests/cast/WhenWithExpression.fir.kt deleted file mode 100644 index 9a60e0bf91e..00000000000 --- a/compiler/testData/diagnostics/tests/cast/WhenWithExpression.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class List(val size : Int) { - companion object { - val Nil = List(0) - } -} - -fun List.join() = - when (this) { - List.Nil -> "[]" // CANNOT_CHECK_FOR_ERASED was reported - else -> "" - } diff --git a/compiler/testData/diagnostics/tests/cast/WhenWithExpression.kt b/compiler/testData/diagnostics/tests/cast/WhenWithExpression.kt index 9a60e0bf91e..d036a290867 100644 --- a/compiler/testData/diagnostics/tests/cast/WhenWithExpression.kt +++ b/compiler/testData/diagnostics/tests/cast/WhenWithExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class List(val size : Int) { companion object { val Nil = List(0) diff --git a/compiler/testData/diagnostics/tests/cast/bare/AsNullable.fir.kt b/compiler/testData/diagnostics/tests/cast/bare/AsNullable.fir.kt deleted file mode 100644 index 48f5318520a..00000000000 --- a/compiler/testData/diagnostics/tests/cast/bare/AsNullable.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE - -interface Tr -interface G : Tr - -fun test(tr: Tr) { - val v = tr as G? - // If v is not nullable, there will be a warning on this line: - checkSubtype>(v!!) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/bare/AsNullable.kt b/compiler/testData/diagnostics/tests/cast/bare/AsNullable.kt index 48f5318520a..135ba5ef2b5 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/AsNullable.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/AsNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface Tr diff --git a/compiler/testData/diagnostics/tests/cast/bare/NullableAs.fir.kt b/compiler/testData/diagnostics/tests/cast/bare/NullableAs.fir.kt deleted file mode 100644 index 85d624a9139..00000000000 --- a/compiler/testData/diagnostics/tests/cast/bare/NullableAs.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !CHECK_TYPE - -interface Tr -interface G : Tr - -fun test(tr: Tr?) { - val v = tr as G - checkSubtype>(v) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/bare/NullableAs.kt b/compiler/testData/diagnostics/tests/cast/bare/NullableAs.kt index 85d624a9139..3d7ec076245 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/NullableAs.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/NullableAs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface Tr diff --git a/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.fir.kt b/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.fir.kt deleted file mode 100644 index 3914084b7cb..00000000000 --- a/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE - -interface Tr -interface G : Tr - -fun test(tr: Tr?) { - val v = tr as G? - // If v is not nullable, there will be a warning on this line: - checkSubtype>(v!!) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.kt b/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.kt index 3914084b7cb..a564368368d 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/NullableAsNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface Tr diff --git a/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.fir.kt b/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.fir.kt deleted file mode 100644 index 61818b7a817..00000000000 --- a/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class G - -fun f(q: Any) = q is G<*> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.kt b/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.kt index 61818b7a817..6027ee9ea8e 100644 --- a/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.kt +++ b/compiler/testData/diagnostics/tests/cast/isErasedAnyAndStarred.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class G fun f(q: Any) = q is G<*> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.fir.kt b/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.fir.kt deleted file mode 100644 index 437cb1b0ef8..00000000000 --- a/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class G - -fun f(q: Q) = q is G<*> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.kt b/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.kt index 437cb1b0ef8..47e2f408bc0 100644 --- a/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.kt +++ b/compiler/testData/diagnostics/tests/cast/isErasedTAndStarred.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class G fun f(q: Q) = q is G<*> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.fir.kt b/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.fir.kt deleted file mode 100644 index f53785c40c6..00000000000 --- a/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class G -interface Tr - -fun f(q: Tr) = q is G<*> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.kt b/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.kt index f53785c40c6..09d741c8383 100644 --- a/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.kt +++ b/compiler/testData/diagnostics/tests/cast/isErasedUnrelatedAndStarred.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class G interface Tr diff --git a/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.fir.kt b/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.fir.kt deleted file mode 100644 index 15e4ca66f5c..00000000000 --- a/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -open class A { - fun foo() {} -} -class B : A() - -fun test(b: B?) { - (b as A).foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.kt b/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.kt index 15e4ca66f5c..2a1a388b246 100644 --- a/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.kt +++ b/compiler/testData/diagnostics/tests/cast/neverSucceeds/CastToNotNullSuper.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.fir.kt b/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.fir.kt deleted file mode 100644 index 5b84d1aa74f..00000000000 --- a/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -import kotlin.reflect.KClass - -abstract class Base(val klass: KClass) - -class DerivedClass : Base(DerivedClass::class) - -object DerivedObject : Base(DerivedObject::class) - -enum class TestEnum { - TEST_ENTRY -} - -val test1: KClass = DerivedClass::class -val test2: KClass = DerivedObject::class -val test3: KClass = TestEnum::class -val test4: KClass = TestEnum.TEST_ENTRY::class \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.kt b/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.kt index 5b84d1aa74f..459fc93c017 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.kt +++ b/compiler/testData/diagnostics/tests/classLiteral/classAndObjectLiteralType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.KClass abstract class Base(val klass: KClass) diff --git a/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.fir.kt b/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.fir.kt deleted file mode 100644 index d44fdcba193..00000000000 --- a/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -package test.foo.bar - -class A - -val k = test.foo.bar.A::class - -val l = java.lang.Class::class diff --git a/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.kt b/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.kt index d44fdcba193..9dde753c8e9 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.kt +++ b/compiler/testData/diagnostics/tests/classLiteral/qualifiedClassLiteral.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test.foo.bar class A diff --git a/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.fir.kt b/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.fir.kt deleted file mode 100644 index ecfe5bc206b..00000000000 --- a/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class A - -val k = A::class diff --git a/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.kt b/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.kt index ecfe5bc206b..9b4840ac1c3 100644 --- a/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.kt +++ b/compiler/testData/diagnostics/tests/classLiteral/simpleClassLiteral.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A val k = A::class diff --git a/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.fir.kt b/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.fir.kt deleted file mode 100644 index a76c28aba66..00000000000 --- a/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// http://youtrack.jetbrains.net/issue/KT-20 - -class A() { - val x = 1 - - companion object { - val y = x - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.kt b/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.kt index a76c28aba66..01f64fd4696 100644 --- a/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.kt +++ b/compiler/testData/diagnostics/tests/classObjects/ClassObjectCannotAccessClassFields.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // http://youtrack.jetbrains.net/issue/KT-20 class A() { diff --git a/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.fir.kt b/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.fir.kt deleted file mode 100644 index 250ca38501f..00000000000 --- a/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER - -fun box(): String { - try { - // Objects - val i = Int - val d = Double - val f = Float - val l = Long - val sh = Short - val b = Byte - val ch = Char - val st = String - - test(Int) - test(Double) - test(Float) - test(Long) - test(Short) - test(Byte) - test(String) - test(Char) - - // Common Double - Double.POSITIVE_INFINITY - Double.NEGATIVE_INFINITY - Double.NaN - - // Common Float - Float.POSITIVE_INFINITY - Float.NEGATIVE_INFINITY - Float.NaN - } - catch (e: Throwable) { - return "Error: \n" + e - } - - return "OK" -} - -fun test(a: Any) {} - - diff --git a/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.kt b/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.kt index 250ca38501f..096fa89f29f 100644 --- a/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.kt +++ b/compiler/testData/diagnostics/tests/classObjects/builtInClassObjects.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER fun box(): String { diff --git a/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.fir.kt b/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.fir.kt deleted file mode 100644 index bc68cc2cd51..00000000000 --- a/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -package f - -import f.A.Companion.B - -class A { - companion object { - class B - } -} - -fun test() = B() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.kt b/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.kt index bc68cc2cd51..d88568d7259 100644 --- a/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.kt +++ b/compiler/testData/diagnostics/tests/classObjects/importClassInClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package f import f.A.Companion.B diff --git a/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.fir.kt b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.fir.kt deleted file mode 100644 index 498426201be..00000000000 --- a/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -package test - -class Test { - fun test(): Int = 12 - - companion object { - val a = test() // Check if resolver will be able to infer type of a variable - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt index 498426201be..0c00daf5196 100644 --- a/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt +++ b/compiler/testData/diagnostics/tests/classObjects/resolveFunctionInsideClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test class Test { diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.fir.kt b/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.fir.kt deleted file mode 100644 index 68aef2e6c7b..00000000000 --- a/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +ArrayLiteralsInAnnotations -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNSUPPORTED - -annotation class Anno(val a: Array = [""], val b: IntArray = []) - -@Anno([], []) -fun test() {} - -fun arrayOf(): Array = TODO() -fun intArrayOf(): Array = TODO() - -fun local() { - val a1: IntArray = [1, 2] - val a2: IntArray = [] - - val s1: Array = [""] - val s2: Array = [] -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.kt b/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.kt index 68aef2e6c7b..8461651d41b 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/resolveToFunctionFromBuiltIns.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ArrayLiteralsInAnnotations // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNSUPPORTED diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.fir.kt deleted file mode 100644 index 269ed78f62b..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class My(val x: Int) { - val y: Int = x + 3 - val z: Int? = foo() - - fun foo() = if (x >= 0) x else if (y >= 0) y else null -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.kt b/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.kt index 269ed78f62b..ef271df0f24 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/afterInitialization.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class My(val x: Int) { val y: Int = x + 3 val z: Int? = foo() diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/delegate.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/delegate.fir.kt deleted file mode 100644 index 87b106a035c..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/delegate.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class Delegate(val x: Int) { - operator fun getValue(t: Any?, p: KProperty<*>): Int = x -} - -class My { - val x: Int by Delegate(this.foo()) - - fun foo(): Int = x -} diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/delegate.kt b/compiler/testData/diagnostics/tests/constructorConsistency/delegate.kt index 87b106a035c..0c565704cda 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/delegate.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/delegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.fir.kt deleted file mode 100644 index bcfc88c8f58..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ - -private const val A = 0L -private val B = 0L -private fun sample() = 0L - -private class PrivateClass - -class Foo { - var bar: Long = 0 - private var other: PrivateClass? = null - - init { - bar = A - bar = B - bar = sample() - other = PrivateClass() - } - - constructor() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.kt b/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.kt index bcfc88c8f58..f573b5143bd 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/initializerWithSecondaryConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL private const val A = 0L private val B = 0L diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.fir.kt deleted file mode 100644 index eb4204ba880..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -interface Wise { - fun doIt(): Int -} - -fun Wise(f: () -> Int) = object: Wise { - override fun doIt() = f() -} - -class My { - // Still dangerous (???), nobogy can guarantee what Wise() will do with this lambda - val x = Wise { foo() } - - val y = 42 - - fun foo() = y - - fun bar() = x.doIt() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.kt b/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.kt index eb4204ba880..39ca78693fd 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/lambdaInObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Wise { fun doIt(): Int } diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.fir.kt deleted file mode 100644 index 87b435651e6..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -class WithLateInit { - lateinit var x: String - - fun init(xx: String) { - x = xx - } - - init { - // This is obviously a bug, - // but with lateinit we explicitly want it to occur in runtime - use() - } - - fun use() = x -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.kt b/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.kt index 87b435651e6..763dd18d82c 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/lateInit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class WithLateInit { lateinit var x: String diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/localObject.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/localObject.fir.kt deleted file mode 100644 index c4f8951c4f0..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/localObject.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -open class Wise { - - val x = 1 - - open fun doIt(): Int = 42 -} - -class My { - - fun foo(): Int { - val wise = object: Wise() { - var xx = 1 - override fun doIt() = super.doIt() + bar(this) + xx - } - return wise.doIt() - } -} - -fun bar(wise: Wise): Int = wise.x \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/localObject.kt b/compiler/testData/diagnostics/tests/constructorConsistency/localObject.kt index c4f8951c4f0..bd2937e64da 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/localObject.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/localObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Wise { val x = 1 diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.fir.kt deleted file mode 100644 index 0d62f81b31f..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -class My { - - val x: Int - get() = 1 - - init { - // x has no backing field, so the call is safe - foo() - } - - fun foo() {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.kt b/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.kt index 0d62f81b31f..f52e83040f8 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/nobacking.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class My { val x: Int diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/outer.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/outer.fir.kt deleted file mode 100644 index a1027c124db..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/outer.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class Outer { - - fun foo() = 1 - - inner class Inner { - - val x = this@Outer.foo() - - val y = foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/outer.kt b/compiler/testData/diagnostics/tests/constructorConsistency/outer.kt index a1027c124db..b9b4c9b3f46 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/outer.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/outer.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { fun foo() = 1 diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.fir.kt b/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.fir.kt deleted file mode 100644 index 33054eb8a4c..00000000000 --- a/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class My { - val x: Int - - constructor(x: Int) { - this.x = x - } -} diff --git a/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.kt b/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.kt index 33054eb8a4c..1eef8f4f3aa 100644 --- a/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.kt +++ b/compiler/testData/diagnostics/tests/constructorConsistency/propertyAccess.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class My { val x: Int diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.fir.kt deleted file mode 100644 index 40c2f3f5871..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// KT-4034 An expression of type Nothing may not affect 'definite return' analysis - -interface JavaClassifierType -interface TypeUsage -interface JetType - -private fun transformClassifierType(classifierType: JavaClassifierType, howThisTypeIsUsed: TypeUsage): JetType? { - null!! -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.kt index 40c2f3f5871..1cbadb2c7e7 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/definiteReturn/kt4034.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // KT-4034 An expression of type Nothing may not affect 'definite return' analysis diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.fir.kt deleted file mode 100644 index 60304fd2db5..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.fir.kt +++ /dev/null @@ -1,34 +0,0 @@ -//KT-1066 false 'Variable cannot be initialized before declaration' - -package kt1066 - -fun randomDigit() = 0.toChar() - -fun foo(excluded: Set) { - var digit : Char - - do { - digit = randomDigit() -// ^^^^^ here! - } while (excluded.contains(digit)) -} - -fun test() { - var sum : Int = 0 - var first : Int = 1 - var second : Int = 2 - var temp : Int //= 0 // variable 'temp' initializer is redundant - - while (true) - { - if (second > 4000000) - break - - if (second % 2 == 0) - sum += second - - temp = second - second = first + second - first = temp - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.kt index 60304fd2db5..0446d1d3521 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1066.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1066 false 'Variable cannot be initialized before declaration' package kt1066 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.fir.kt deleted file mode 100644 index dc513f6d0fc..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -//KT-1156 Throwing exception on the right side of elvis operator marks code unreachable - - -fun foo(maybe: Int?) { - val i : Int = maybe ?: throw RuntimeException("No value") - System.out.println(i) -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.kt index dc513f6d0fc..5ebe95197a3 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1156.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1156 Throwing exception on the right side of elvis operator marks code unreachable diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.fir.kt deleted file mode 100644 index 0039e5d4d04..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -//KT-1189 StackOverflow in ide -package kt1189 -import java.util.concurrent.locks.ReentrantReadWriteLock - -inline fun ReentrantReadWriteLock.write(action: ()->T) : T { - val rl = readLock() - var readCount = 0 - val writeCount = getWriteHoldCount() - if(writeCount == 0) { - readCount = getReadHoldCount() - if(readCount > 0) - for(i in 1..readCount) - rl.unlock() - } - - val wl = writeLock() - wl.lock() - try { - return action() - } - finally { - if(readCount > 0) { - for(j in 1..readCount) { - rl.lock() - } - } - wl.unlock() - } -} - -fun foo() { - try { - return - } - finally { - for (i in 1..10) {} - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt index 0039e5d4d04..d69943d5e6f 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1189.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1189 StackOverflow in ide package kt1189 import java.util.concurrent.locks.ReentrantReadWriteLock diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.fir.kt deleted file mode 100644 index b4fef753131..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -//KT-1191 Wrong detection of unused parameters -package kt1191 - -interface FunctionalList { - val size: Int - val head: T - val tail: FunctionalList -} - -fun FunctionalList.plus(element: T) : FunctionalList = object: FunctionalList { - override val size: Int - get() = 1 + this@plus.size - override val tail: FunctionalList - get() = this@plus - override val head: T - get() = element -} - -fun foo(unused: Int) = object { - val a : Int get() = unused -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.kt index b4fef753131..0a794a01fb8 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1191.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1191 Wrong detection of unused parameters package kt1191 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.fir.kt deleted file mode 100644 index 6e975f1d8f9..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -//KT-1219 Incorrect 'unused value' error in closures - -package kt1219 - -fun Iterable.fold(a: R, op: (T, R) -> R) : R { - var r = a - this.foreach { r = op(it, r) } //unused value here - return r -} - -//KT-1301 Modification of local of outer function in a local function should not be marked as unused assignment -fun foo(){ - var local = 0 - fun bar(){ - local = 1 - } - - bar() - System.out.println(local) -} - -fun Iterable.foreach(operation: (element: T) -> Unit) { - for (elem in this) - operation(elem) -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.kt index 6e975f1d8f9..0358487467d 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1219.1301.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1219 Incorrect 'unused value' error in closures package kt1219 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.fir.kt deleted file mode 100644 index 1fadd54bb53..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -package a - -//KT-2166 Control flow analysis doesn't detect that a 'while(true)' loop never terminates -fun foo(): Int { - while (true) { - } -} - -//KT-2103 Compiler requires return statement after loop which never exits -fun foo1() : Boolean{ - while(true){ - if (bar()) continue - return true - } -} - -fun bar() : Boolean = true \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.kt index 1fadd54bb53..5a4057299d0 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2166_kt2103.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package a //KT-2166 Control flow analysis doesn't detect that a 'while(true)' loop never terminates diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.fir.kt deleted file mode 100644 index f326ec0a926..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -//KT-2226 Parameter used as delegation by object marked as unused -package a - -interface A { - fun foo() : Int -} - -class B : A { - override fun foo() = 10 -} -fun foo(b: B) : Int { - val o = object : A by b { - } - return o.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.kt index f326ec0a926..faa19f07436 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2226.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2226 Parameter used as delegation by object marked as unused package a diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.fir.kt deleted file mode 100644 index 2180b0912e5..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -//KT-2972 Wrong "unused value" warning when finally is present - -import java.io.Closeable - -public inline fun T.use(block: (T)-> R) : R { - var closed = false - try { - return block(this) - } catch (e: Exception) { - closed = true // warning here - try { - this.close() - } catch (closeException: Exception) { - // eat the closeException as we are already throwing the original cause - // and we don't want to mask the real exception - - // TODO on Java 7 we should call - // e.addSuppressed(closeException) - // to work like try-with-resources - // http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html#suppressed-exceptions - } - throw e - } finally { - if (!closed) { - this.close() - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.kt index 2180b0912e5..8201e81d9c5 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt2972.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2972 Wrong "unused value" warning when finally is present import java.io.Closeable diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.fir.kt deleted file mode 100644 index d9a7ecbfb9d..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -//KT-510 `this.` allows initialization without backing field - -package kt510 - -public open class Identifier1() { - var field : Boolean - init { - field = false; // error - } -} - - -public open class Identifier2() { - var field : Boolean - init { - this.field = false; - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.kt index d9a7ecbfb9d..3faf5dc59ba 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt510.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-510 `this.` allows initialization without backing field package kt510 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.fir.kt deleted file mode 100644 index 4095484537b..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -//KT-776 Wrong detection of unreachable code - -package kt776 - -fun test5() : Int { - var x = 0 - while(true) { - try { - if(x < 10) { - x++ - continue - } - else { - break - } - } - finally { - x++ - } - } - return x -} - -fun test1() : Int { - try { - if (true) { - return 1 - } - else { - return 2 - } - } - finally { - doSmth() //unreachable - } -} - -fun doSmth() {} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.kt index 4095484537b..85a5299ce0e 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt776.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-776 Wrong detection of unreachable code package kt776 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.fir.kt deleted file mode 100644 index 8c5ba56b94f..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -//KT-843 Don't highlight incomplete variables as unused - -package kt843 - -fun main() { - // Integer type - val // this word is grey, which looks strange -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.kt index 8c5ba56b94f..32919df13c4 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt843.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-843 Don't highlight incomplete variables as unused package kt843 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.fir.kt deleted file mode 100644 index 3cb2bd13754..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.fir.kt +++ /dev/null @@ -1,87 +0,0 @@ -fun println(obj: Any?) = obj - -class Demo0 { - private val some = object { - fun foo() { - println(state) - } - } - - private var state: Boolean = true -} - -class Demo1 { - private val some = object { - fun foo() { - if (state) - state = true - - println(state) - } - } - - private var state: Boolean = true -} - -class Demo1A { - fun foo() { - if (state) - state = true - - println(state) - } - - private var state: Boolean = true -} - -class Demo2 { - private val some = object { - fun foo() { - if (state) - state = true - else - state = false - - println(state) - } - } - - private var state: Boolean = true -} - -class Demo3 { - private val some = run { - if (state) - state = true - - println(state) - } - - private var state: Boolean = true -} - -fun exec(f: () -> T): T = f() - -class Demo4 { - private val some = exec { - if (state) - state = true - - println(state) - } - - private var state: Boolean = true -} - -class Demo5 { - private var state: Boolean = true - - private val some = object { - fun foo() { - if (state) - state = true - - println(state) - } - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.kt index 3cb2bd13754..72518ea0657 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/localObjectInConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun println(obj: Any?) = obj class Demo0 { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.fir.kt deleted file mode 100644 index 9ed477daa2e..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: -WarningOnMainUnusedParameter - -fun main(args: Array) { - -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.kt index 9ed477daa2e..9eac9dd15e2 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/mainWithoutWarningOnUnusedParam.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -WarningOnMainUnusedParameter fun main(args: Array) { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.fir.kt deleted file mode 100644 index eb493096c80..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -fun use(arg: String?) = arg - -fun sample(): String? { - try { - if (false) { - return "fail" - } else { - if (false) { - if (false) { - var foo: String? = null - try { - foo = "test" - } catch (e: Exception) { - return "fail" - } finally { - use(foo) // 'foo' is initialized here - } - } - return "fail" - } - } - } finally {} - return null -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.kt index eb493096c80..7c947cf2e4e 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nestedTryFinally.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun use(arg: String?) = arg fun sample(): String? { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.fir.kt deleted file mode 100644 index f09cc4b1f50..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !WITH_NEW_INFERENCE -// See also KT-5198 / KT-10186 - -inline fun doCall(f: () -> Unit) = f() - -fun test1(nonLocal: String): String { - val localResult = doCall { - return nonLocal //unreachable - } - return "NON_LOCAL_FAILED $localResult" //unreachable -} - -fun doSomething() {} - -fun test2() { - fun f(x: Any?) = x - f(null?.let { return }) - - // false unreachable here - doSomething() -} - -fun test3(x: Any?): Boolean = - x?.let { - return true - } ?: false diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.kt index f09cc4b1f50..d65b6ce01ee 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnUnreachable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // See also KT-5198 / KT-10186 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.fir.kt deleted file mode 100644 index 37c23610960..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun test(name: String?) { - try { - name?.let { - return - } - } - finally { - name?.hashCode() - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.kt index 37c23610960..ff79d074bf1 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/nonLocalReturnWithFinally.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test(name: String?) { try { name?.let { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.fir.kt deleted file mode 100644 index 6958b958954..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -class AnonymousInitializers(var a: String) { - init { - a = "s" - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.kt index 6958b958954..4b0a549c1dc 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class AnonymousInitializers(var a: String) { init { a = "s" diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.fir.kt deleted file mode 100644 index 953ca2944d0..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -fun f() { - var foo = 1 - try { - foo = 2 - throw RuntimeException() - } catch (e: Throwable) { - foo.hashCode() - } - throw Exception() -} - -fun g() { - var foo = 1 - try { - foo = 2 - f() - } catch (e: Throwable) { - foo.hashCode() - } -} - -fun h() { - try { - - } - finally { - var foo = 1 - try { - foo = 2 - g() - } - catch (e: Throwable) { - foo.hashCode() - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.kt index 953ca2944d0..f3cd646894a 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/tryWithAssignmentUsedInCatch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun f() { var foo = 1 try { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.fir.kt deleted file mode 100644 index 718684da9b5..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class Test { - lateinit var someRunnable: Runnable - init { - someRunnable = Runnable { someRunnable.run() } - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.kt index 718684da9b5..ad5366f45c5 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitRecursiveInLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Test { lateinit var someRunnable: Runnable init { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.fir.kt deleted file mode 100644 index 332526497b9..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -class Foo { - lateinit var bar: String - - constructor(baz: Int) { - // At best, we should have error here despite of lateinit - bar += baz - } -} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.kt index 332526497b9..b6d957353c9 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPlusAssign.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo { lateinit var bar: String diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.fir.kt deleted file mode 100644 index d1d946dbf1a..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Foo() { - lateinit var bar: String - - constructor(baz: Int) : this() { - bar = "" - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.kt index d1d946dbf1a..787c34ea219 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithPrimaryConstructorAndConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Foo() { diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.fir.kt deleted file mode 100644 index abee30f6f36..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class Foo { - lateinit var bar: String - - fun init() { - bar = "" - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.kt index abee30f6f36..8646a955559 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo { lateinit var bar: String diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.fir.kt deleted file mode 100644 index 2c54f35a1f5..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class Foo { - lateinit var x: String - - constructor(y: String) { - x = y - } - - constructor() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.kt index 2c54f35a1f5..0c366f92a76 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/normalLateinitWithTwoConstructors.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo { lateinit var x: String diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.fir.kt deleted file mode 100644 index 7495cd3595d..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !LANGUAGE: -SingleUnderscoreForParameterName -// See KT-8813, KT-9631 - -fun someApi(f: (Int) -> Unit) = f(42) - -fun test() { - someApi(fun(p: Int) {}) - // Apparently "p" cannot be removed because the signature is fixed by "someApi -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.kt index 7495cd3595d..a122b2a8706 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unusedInAnonymous.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -SingleUnderscoreForParameterName // See KT-8813, KT-9631 diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.fir.kt deleted file mode 100644 index 5757b44bd08..00000000000 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -fun foo(numbers: Collection) { - for (i in numbers) { - val b: Boolean - if (1 < 2) { - b = false - } - else { - b = true - } - use(b) - continue - } -} - -fun use(vararg a: Any?) = a diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.kt index 5757b44bd08..cce20d6ee90 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/varInitializationInIfInCycle.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(numbers: Collection) { for (i in numbers) { val b: Boolean diff --git a/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.fir.kt deleted file mode 100644 index d79dd7e77e0..00000000000 --- a/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// http://youtrack.jetbrains.net/issue/KT-552 -// KT-552 For variable unresolved if loop body is not block - -fun ff() { - var i = 1 - for (j in 1..10) - i += j -} diff --git a/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.kt b/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.kt index d79dd7e77e0..7d79d47a55a 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ForWithoutBraces.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // http://youtrack.jetbrains.net/issue/KT-552 // KT-552 For variable unresolved if loop body is not block diff --git a/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.fir.kt deleted file mode 100644 index b6c4f6021ac..00000000000 --- a/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// KT-6774 Cannot find equals() when comparing with null - -fun fn(t1: T, t2: T?) { - val x = if (true) t1 else t2 - x == null - x?.equals(null) - x?.hashCode() - x.toString() - x!!.hashCode() - - val y = t2 ?: t1 - y == t1 - y.equals(null) - y.hashCode() - y.toString() - y.hashCode() -} - -interface Tr { - fun foo() -} - -fun fn(t1: T, t2: T?) { - val x = if (true) t1 else t2 - x?.foo() - x!!.foo() - - val y = t2 ?: t1 - y.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.kt b/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.kt index b6c4f6021ac..fd4ef64eec6 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/commonSupertypeOfT.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-6774 Cannot find equals() when comparing with null fun fn(t1: T, t2: T?) { diff --git a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.fir.kt deleted file mode 100644 index 0e8ec5e19de..00000000000 --- a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -val ns: String? = null - -val testElvis1: String? = ns ?: "" -val testElvis2: String = run { ns ?: "" } -val testElvis3: String? = run { ns ?: "" } - -val testIf1: String? = if (true) "" else "" -val testIf2: String? = run { if (true) "" else "" } -val testIf3: String? = if (true) run { "" } else "" -val testIf4: String? = run { run { if (true) "" else "" } } -val testIf5: String? = run { if (true) run { "" } else "" } - -val testWhen1: String? = when { else -> "" } -val testWhen2: String? = run { when { else -> "" } } -val testWhen3: String? = when { else -> run { "" } } -val testWhen4: String? = run { run { when { else -> "" } } } -val testWhen5: String? = run { when { else -> run { "" } } } - -val testExcl1: String? = run { ns!! } -val testExcl2: String? = run { run { ns!! } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.kt b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.kt index 0e8ec5e19de..472b7a49b1e 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/specialConstructsWithNullableExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val ns: String? = null val testElvis1: String? = ns ?: "" diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.fir.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.fir.kt deleted file mode 100644 index f7631022981..00000000000 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// FILE: A.java - -public interface A extends A { - int getFoo(); -} - -// FILE: B.java - -public class B { - interface B1 extends B2 { - int getFoo(); - } - interface B2 extends B3 { - int getFoo(); - } - interface B3 extends B2 { - int getFoo(); - } -} - -// FILE: main.kt -fun foo() { - object : A { override fun getFoo() = 1 } - object : B.B1 { override fun getFoo() = 1 } - object : B.B2 { override fun getFoo() = 1 } - object : B.B3 { override fun getFoo() = 1 } -} - diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.kt index f7631022981..c7b16a865b8 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaCycle.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A extends A { diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.fir.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.fir.kt deleted file mode 100644 index 82a5d2f8eb6..00000000000 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: A.java - -public interface A extends A.B { - interface B extends A { public int getFoo() { return 1; } } -} - -// FILE: A0.java -public interface A0 extends A0.B { - interface B { public int getFoo() { return 1; } } -} - -// FILE: B.java - -public class B extends D { - public int getFoo() { return 1; } - public static class C { - public int getFoo() { return 1; } - } -} - -// FILE: D.java -public class D extends B.C { - public int getFoo() { return 1; } -} diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.kt index 82a5d2f8eb6..34db9848698 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/javaJavaNested.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A extends A.B { diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.fir.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.fir.kt deleted file mode 100644 index f33ddf14c37..00000000000 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -open class X - -class A: X() { - class B -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.kt index f33ddf14c37..d4d20b49b48 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/nestedClassInSuperClassParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class X class A: X() { diff --git a/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.fir.kt deleted file mode 100644 index 045ee011574..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -data class A(val component1: Int) - -fun foo(a: A) { - a.component1() - a.component1 -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.kt b/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.kt index 045ee011574..8f751a14ef2 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL data class A(val component1: Int) fun foo(a: A) { diff --git a/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.fir.kt deleted file mode 100644 index d4e07be97da..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class Outer { - private data class Nested(val c: Int) -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.kt b/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.kt index d4e07be97da..c00b9e96f3c 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { private data class Nested(val c: Int) } diff --git a/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.fir.kt deleted file mode 100644 index aa5c85f6323..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !LANGUAGE: +ProhibitDataClassesOverridingCopy - -interface WithCopy { - fun copy(str: T): WithCopy -} - -data class Test(val str: String, val int: Int) : WithCopy { - override fun copy(str: String) = copy(str, int) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.kt b/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.kt index aa5c85f6323..bbd4612a078 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/dataClassNotOverridingCopy.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitDataClassesOverridingCopy interface WithCopy { diff --git a/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.fir.kt deleted file mode 100644 index 1969596d600..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -abstract class Base { - final override fun equals(other: Any?) = false - final override fun hashCode() = 42 - - open override fun toString() = "OK" -} - -data class Data1(val field: String) : Base() - -interface AbstractAnyMembers { - abstract override fun equals(other: Any?): Boolean - abstract override fun hashCode(): Int - abstract override fun toString(): String -} - -data class Data2(val field: String): Base(), AbstractAnyMembers diff --git a/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.kt b/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.kt index 1969596d600..50a34131a8f 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/finalMembersInBaseClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class Base { final override fun equals(other: Any?) = false final override fun hashCode() = 42 diff --git a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.fir.kt deleted file mode 100644 index 7cb40548632..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -interface T { - fun component1(): Int -} - -data class A(val x: Int) : T diff --git a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.kt b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.kt index 7cb40548632..02fe1104d21 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface T { fun component1(): Int } diff --git a/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.fir.kt deleted file mode 100644 index 803873a0464..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !CHECK_TYPE - -data class A(val x: Int, val y: String) - -fun foo(a: A) { - val (b, c) = a - checkSubtype(b) - checkSubtype(c) -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.kt b/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.kt index 803873a0464..35bbcb5f3cc 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE data class A(val x: Int, val y: String) diff --git a/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.fir.kt deleted file mode 100644 index ce7a01130e6..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE - -data class A(val x: Int, val y: String) - -fun foo(arr: Array) { - for ((b, c) in arr) { - checkSubtype(b) - checkSubtype(c) - } -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.kt b/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.kt index ce7a01130e6..9e41806be02 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE data class A(val x: Int, val y: String) diff --git a/compiler/testData/diagnostics/tests/dataClasses/notADataClass.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/notADataClass.fir.kt deleted file mode 100644 index 2561937f3e4..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/notADataClass.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class A(val x: Int, val y: String) - -fun foo(a: A) { - a.component1() - a.component2() -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/notADataClass.kt b/compiler/testData/diagnostics/tests/dataClasses/notADataClass.kt index 2561937f3e4..f5d0ada181d 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/notADataClass.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/notADataClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A(val x: Int, val y: String) fun foo(a: A) { diff --git a/compiler/testData/diagnostics/tests/dataClasses/oneValParam.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/oneValParam.fir.kt deleted file mode 100644 index 6b9054c630b..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/oneValParam.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !CHECK_TYPE - -data class A(val x: Int) - -fun foo(a: A) { - checkSubtype(a.component1()) - a.component2() -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/oneValParam.kt b/compiler/testData/diagnostics/tests/dataClasses/oneValParam.kt index 6b9054c630b..548233d986b 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/oneValParam.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/oneValParam.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE data class A(val x: Int) diff --git a/compiler/testData/diagnostics/tests/dataClasses/twoValParams.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/twoValParams.fir.kt deleted file mode 100644 index 53228d514ad..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/twoValParams.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !CHECK_TYPE - -data class A(val x: Int, val y: String) - -fun foo(a: A) { - checkSubtype(a.component1()) - checkSubtype(a.component2()) -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/twoValParams.kt b/compiler/testData/diagnostics/tests/dataClasses/twoValParams.kt index 53228d514ad..cb0dcfcf3b4 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/twoValParams.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/twoValParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE data class A(val x: Int, val y: String) diff --git a/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.fir.kt deleted file mode 100644 index d7d038aabc3..00000000000 --- a/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !CHECK_TYPE - -data class A(var x: Int, var y: String) - -fun foo(a: A) { - checkSubtype(a.component1()) - checkSubtype(a.component2()) -} diff --git a/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.kt b/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.kt index d7d038aabc3..1043fdd9dce 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE data class A(var x: Int, var y: String) diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.fir.kt deleted file mode 100644 index d907ea26ca0..00000000000 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -package test - -fun a(s: String) { // <- ERROR - val (x, y) = Pair("", s) - println(x + y) -} - -fun b(s: String) { - val x = Pair("", s) - println(x) -} - -//from library -data class Pair(val a: A, val b: B) - -fun println(a: Any?) = a \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.kt index d907ea26ca0..89bfaa30188 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/kt2829.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test fun a(s: String) { // <- ERROR diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.fir.kt deleted file mode 100644 index 69faf3e913c..00000000000 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER - -fun test(list: A) { - if (true) { - val (c) = list - } - else {} - - if (true) { - Unit - val (c) = list - } - else {} - - when (1) { - 1 -> { - val (c) = list - } - } - - fn { it -> - val (a) = it - } -} - -class A { - operator fun component1() = 1 -} - -fun fn(x: (A) -> Unit) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.kt b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.kt index 69faf3e913c..8bba3cad912 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/destructuringDeclarations/lastDestructuringDeclarationInBlock.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER fun test(list: A) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2142.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/kt2142.fir.kt deleted file mode 100644 index 4410e01c0a1..00000000000 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt2142.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -//KT-2142 function local classes do not work - -package a - -fun foo() { - class Foo() {} - Foo() // Unresolved reference Foo -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2142.kt b/compiler/testData/diagnostics/tests/declarationChecks/kt2142.kt index 4410e01c0a1..df65c918ed4 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt2142.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt2142.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2142 function local classes do not work package a diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.fir.kt deleted file mode 100644 index 293bb83f024..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -val a: Int by Delegate() - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt index 293bb83f024..4f8c9899384 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutInitializer.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.fir.kt deleted file mode 100644 index 4276b095160..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -val a by Delegate() - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt index 4276b095160..96350b13a9c 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/absentErrorAboutType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.fir.kt deleted file mode 100644 index 7ad3dc1881f..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class B { - val a: Int by Delegate() - - fun foo() = $a -} - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt index 7ad3dc1881f..d178c812181 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/backingField.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.fir.kt deleted file mode 100644 index 7b2135dd43f..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -val a: Int by Delegate() - get - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt index 7b2135dd43f..1805827ea2d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/defaultGetter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.fir.kt deleted file mode 100644 index b64b84beb28..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -var a: Int by Delegate() - private set - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } - - operator fun setValue(t: Any?, p: KProperty<*>, i: Int) {} -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt index b64b84beb28..1af7d144fb1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/defaultSetter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.fir.kt deleted file mode 100644 index 1a63e3362c3..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -interface A { - val prop: Int -} - -class AImpl: A { - override val prop by Delegate() -} - -fun foo() { - AImpl().prop -} - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt index 1a63e3362c3..f88f145cd17 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/delegatedPropertyOverridedInTrait.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.fir.kt deleted file mode 100644 index 8c841bef535..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -val a: Int by A(1) - -class A(i: T) { - operator fun getValue(t: Any?, p: KProperty<*>): T { - throw Exception() - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt index 8c841bef535..9676deebe6d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/genericGetter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.fir.kt deleted file mode 100644 index c567c076187..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -open class Base -class Derived: Base() - -val a: Base by A() - -class A { - operator fun getValue(t: Any?, p: KProperty<*>): Derived { - return Derived() - } -} - diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt index c567c076187..30dff9e2eeb 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/getterWithSubtype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.fir.kt deleted file mode 100644 index 8025b9d7d9e..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class Inv2 - -fun create(g: (T) -> K): Inv2 = TODO() - -operator fun Inv2.getValue(o: Sample, desc: KProperty<*>): V1 = TODO() -operator fun Inv2.setValue(o: Sample, desc: KProperty<*>, value: V2) {} - -class Version(val version: Int) - -class Sample { - var version: Version by create(::Version) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.kt index 8025b9d7d9e..1413c1c4e75 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/callableReferenceArgumentInDelegatedExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.fir.kt deleted file mode 100644 index 93568f554b6..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -fun test(i: Int) { - val bad by myLazyDelegate { - createSample(i) { it.toString() } - } - - takeSample(bad) -} - -fun myLazyDelegate(i: () -> T): LazyDelegate = LazyDelegate(i()) - -class LazyDelegate(val v: T) { - operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO() -} - -class Sample - -fun takeSample(g: Sample) {} -fun createSample(i: T, a: (T) -> S): Sample = TODO() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.kt index 16a72a896cb..72ede8d8e92 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegateExpressionAsLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.fir.kt deleted file mode 100644 index 13953b3e5b5..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -class Delegate - -operator fun Delegate.getValue(thisRef: Any?, property: kotlin.reflect.KProperty<*>): T = TODO() - -fun createDelegate(f: () -> K): Delegate = TODO() - -fun test() { - val bar: () -> String by createDelegate { - return@createDelegate { "str" } - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.kt index 13953b3e5b5..cef2f0d193d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/delegatedExpressionWithLabeledReturnInsideLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.fir.kt deleted file mode 100644 index ad70419a6b2..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -package foo - -import kotlin.reflect.KProperty - -class A1 { - val a: String by MyProperty1() -} - -class MyProperty1 {} -operator fun MyProperty1.getValue(thisRef: Any?, desc: KProperty<*>): String { - throw Exception("$thisRef $desc") -} - -//-------------------- - -class A2 { - val a: String by MyProperty2() -} - -class MyProperty2 {} -operator fun MyProperty2.getValue(thisRef: Any?, desc: KProperty<*>): T { - throw Exception("$thisRef $desc") -} - -//-------------------- - -class A3 { - val a: String by MyProperty3() - - class MyProperty3 {} - - operator fun MyProperty3.getValue(thisRef: Any?, desc: KProperty<*>): T { - throw Exception("$thisRef $desc") - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt index ad70419a6b2..566784e333f 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/extensionGet.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package foo import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.fir.kt deleted file mode 100644 index 0e4b41d5ec0..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class A -class B - -fun A.toB(f: (V) -> K, g: (K) -> V): B = B() - -operator fun B.getValue(o: Any, desc: KProperty<*>): E1 = TODO() -operator fun B.setValue(o: Any, desc: KProperty<*>, value: E2) {} - -val q = A() - -class Test { - var prop by q.toB({ "abc" }, { "cde" }) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.kt index 0e4b41d5ec0..2bb5532b4ea 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/resultTypeOfLambdaForConventionMethods.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.fir.kt deleted file mode 100644 index 5cc2c1fec01..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -val b: First by lazy { - object : First { } -} - -private val withoutType by lazy { - object : First { } -} - -private val withTwoSupertypes by lazy { - object : First, Second { } -} - -class A { - val a: First by lazy { - object : First { } - } -} - -interface First -interface Second - -fun lazy(initializer: () -> T): Lazy = TODO() -interface Lazy { - operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.kt index 5cc2c1fec01..e27456f6bf8 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/typeOfLazyDelegatedPropertyWithObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.fir.kt deleted file mode 100644 index 684cd8878f4..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !CHECK_TYPE - -import kotlin.reflect.KProperty - -class A { - val a by MyProperty() - - fun test() { - checkSubtype(a) - } -} - -class MyProperty { - operator fun getValue(thisRef: R, desc: KProperty<*>): Int = throw Exception("$thisRef $desc") -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt index 684cd8878f4..f5ff6b1a870 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useCompleterWithoutExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.fir.kt deleted file mode 100644 index 2b4955d7f04..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.fir.kt +++ /dev/null @@ -1,76 +0,0 @@ -package foo - -import kotlin.reflect.KProperty - -class A1 { - var a1: String by MyProperty1() - var b1: String by getMyProperty1() -} - -var c1: String by getMyProperty1() -var d1: String by MyProperty1() - -fun getMyProperty1() = MyProperty1() - -class MyProperty1 { - - operator fun getValue(thisRef: R, desc: KProperty<*>): T { - println("get $thisRef ${desc.name}") - throw Exception() - } - - operator fun setValue(thisRef: R, desc: KProperty<*>, value: T) { - println("set $thisRef ${desc.name} $value") - } -} - -//-------------------------- - -class A2 { - var a2: String by MyProperty2() - var b2: String by getMyProperty2() -} - -var c2: String by getMyProperty2() -var d2: String by MyProperty2() - -fun getMyProperty2() = MyProperty2() - -class MyProperty2 { - - operator fun getValue(thisRef: Any?, desc: KProperty<*>): T { - println("get $thisRef ${desc.name}") - throw Exception() - } - - operator fun setValue(thisRef: Any?, desc: KProperty<*>, value: T) { - println("set $thisRef ${desc.name} $value") - } -} - -//-------------------------- - -class A3 { - var a3: String by MyProperty3() - var b3: String by getMyProperty3() -} - -var c3: String by getMyProperty3() -var d3: String by MyProperty3() - -fun getMyProperty3() = MyProperty3() - -class MyProperty3 { - - operator fun getValue(thisRef: T, desc: KProperty<*>): String { - println("get $thisRef ${desc.name}") - return "" - } - - operator fun setValue(thisRef: Any?, desc: KProperty<*>, value: T) { - println("set $thisRef ${desc.name} $value") - } -} - -//-------------------------- -fun println(a: Any?) = a diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt index 2b4955d7f04..6c3179ee4d1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package foo import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.fir.kt deleted file mode 100644 index 2a4e6fdd94a..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.fir.kt +++ /dev/null @@ -1,64 +0,0 @@ -package foo - -import kotlin.reflect.KProperty - -class A1 { - val a1: String by MyProperty1() - val b1: String by getMyProperty1() -} - -val c1: String by getMyProperty1() -val d1: String by MyProperty1() - -fun getMyProperty1() = MyProperty1() - -class MyProperty1 { - - operator fun getValue(thisRef: R, desc: KProperty<*>): T { - println("get $thisRef ${desc.name}") - throw Exception() - } -} - -//-------------------------- - -class A2 { - val a2: String by MyProperty2() - val b2: String by getMyProperty2() -} - -val c2: String by getMyProperty2() -val d2: String by MyProperty2() - -fun getMyProperty2() = MyProperty2() - -class MyProperty2 { - - operator fun getValue(thisRef: Any?, desc: KProperty<*>): T { - println("get $thisRef ${desc.name}") - throw Exception() - } -} - -//-------------------------- - -class A3 { - val a3: String by MyProperty3() - val b3: String by getMyProperty3() -} - -val c3: String by getMyProperty3() -val d3: String by MyProperty3() - -fun getMyProperty3() = MyProperty3() - -class MyProperty3 { - - operator fun getValue(thisRef: T, desc: KProperty<*>): String { - println("get $thisRef ${desc.name}") - return "" - } -} - -//-------------------------- -fun println(a: Any?) = a diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt index 2a4e6fdd94a..298f076c35d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/useExpectedTypeForVal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package foo import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.fir.kt deleted file mode 100644 index 4816a3d23d4..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -import kotlin.reflect.KProperty - -class Local { - fun foo() { - val a: Int by Delegate() - } -} - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt index 4816a3d23d4..c64477e3c2a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/localVariable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.fir.kt deleted file mode 100644 index 5ccafeeeac3..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Cell(val value: V) - -class GenericDelegate(val value: V) - -operator fun T.provideDelegate(a: Any?, p: Any?) = GenericDelegate(this) - -operator fun GenericDelegate.getValue(a: Any?, p: Any?) = Cell(value) - -val test1: Cell by "OK" -val test2: Cell by "OK" -val test3 by "OK" \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt index 5ccafeeeac3..5367bfddf09 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/genericProvideDelegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Cell(val value: V) diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt deleted file mode 100644 index 724f8ffddad..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object T3 { - interface Foo - - fun delegate(): Foo = TODO() - - operator fun Foo.provideDelegate(host: T3, p: Any?): Foo = TODO() - operator fun Foo.getValue(receiver: T3, p: Any?): T = TODO() - - val test1: String by delegate() -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt index 724f8ffddad..b3672a1d18d 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/hostAndReceiver3.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object T3 { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.fir.kt deleted file mode 100644 index 59e33c206a2..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this -operator fun String.getValue(a: Any?, p: KProperty<*>) = this - -fun test(): String { - val result by "OK" - return result -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt index 59e33c206a2..b49eddc40d1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/localDelegatedProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.fir.kt deleted file mode 100644 index ef9c64db88c..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE - -import kotlin.reflect.KProperty - -object Foo -object Bar -object Baz - -operator fun Foo.provideDelegate(receiver: Any?, property: KProperty<*>) = this -operator fun Bar.provideDelegate(receiver: Any?, property: KProperty<*>) = this - -operator fun Foo.getValue(nothing: Any?, property: KProperty<*>): Any = TODO() -operator fun Bar.getValue(nothing: Any?, property: KProperty<*>): Any = TODO() -operator fun Baz.getValue(nothing: Any?, property: KProperty<*>): Any = TODO() - -fun test() { - val bar by Baz -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.kt index ef9c64db88c..d64dad0cbe4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/overloadResolutionForSeveralProvideDelegates.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.fir.kt deleted file mode 100644 index 313f52e12ab..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -operator fun String.provideDelegate(a: Any?, p: KProperty<*>) = this -operator fun String.getValue(a: Any?, p: KProperty<*>) = this - -val test1: String by "OK" - -val test2 by "OK" \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt index 313f52e12ab..8ae8428e218 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/simpleProvideDelegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.fir.kt deleted file mode 100644 index 694a5ca0436..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -open class Base -class Derived: Base() - -var a: Derived by A() - -class A { - operator fun getValue(t: Any?, p: KProperty<*>): Derived { - return Derived() - } - - operator fun setValue(t: Any?, p: KProperty<*>, i: Base) {} -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt index 694a5ca0436..9c94281bc76 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/setterWithSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.fir.kt deleted file mode 100644 index f1864d532dc..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -import kotlin.reflect.KProperty - -class A - -object Delegate { - operator fun getValue(state: A, desc: KProperty<*>): Int = 0 - operator fun setValue(state: A, desc: KProperty<*>, value: Int) {} -} - -open class B { - val A.foo: Int by Delegate - var A.bar: Int by Delegate -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.kt b/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.kt index f1864d532dc..c6349cafdc3 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/severalReceivers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.KProperty class A diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.fir.kt deleted file mode 100644 index 04ef269bb5e..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class A { - var a: Int by Delegate() -} - -var aTopLevel: Int by Delegate() - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } - operator fun setValue(t: Any?, p: KProperty<*>, a: Int) {} -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt index 04ef269bb5e..4a55ee45e17 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisOfAnyType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.fir.kt deleted file mode 100644 index 656d940c014..00000000000 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -var b: Int by Delegate() - -class Delegate { - operator fun getValue(t: Any?, p: KProperty<*>): Int { - return 1 - } - - operator fun setValue(t: Any?, p: KProperty<*>, i: Int): Int { - return i - } -} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt index 656d940c014..fca67736d51 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/wrongSetterReturnType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.fir.kt b/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.fir.kt deleted file mode 100644 index a92b0861c9f..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -interface A { - fun foo() {} -} - -open class B(a: A) : A by a - -class C(a: A): B(a), A { -} - -fun b(c: C) { - c.foo(); -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.kt b/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.kt index a92b0861c9f..cce5a97a2fc 100644 --- a/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.kt +++ b/compiler/testData/diagnostics/tests/delegation/Delegation_Hierarchy.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.fir.kt b/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.fir.kt deleted file mode 100644 index 269d5360436..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -interface A { - fun foo() {} -} - -interface B : A {} - -class C(b : B) : B by b { - -} - diff --git a/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.kt b/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.kt index 269d5360436..c1b5f89692e 100644 --- a/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.kt +++ b/compiler/testData/diagnostics/tests/delegation/Delegation_ScopeInitializationOrder.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/delegation/kt8154.fir.kt b/compiler/testData/diagnostics/tests/delegation/kt8154.fir.kt deleted file mode 100644 index 066fef5fa23..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/kt8154.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -interface A { - fun foo() -} - -interface B : A { - fun bar() -} - -class BImpl(a: A) : B, A by a { - override fun bar() { throw UnsupportedOperationException() } -} diff --git a/compiler/testData/diagnostics/tests/delegation/kt8154.kt b/compiler/testData/diagnostics/tests/delegation/kt8154.kt index 066fef5fa23..463c668f1bf 100644 --- a/compiler/testData/diagnostics/tests/delegation/kt8154.kt +++ b/compiler/testData/diagnostics/tests/delegation/kt8154.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun foo() } diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.fir.kt deleted file mode 100644 index 861ec527e6b..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -public interface Base { - fun test() = "OK" -} - - -abstract class Impl : Base { - override abstract fun test(): String -} - -class Delegate : Base - - -fun box(): String { - object : Impl(), Base by Delegate() { - } - - return "OK" -} diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.kt index 861ec527e6b..3c76d7e80b3 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/abstractOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public interface Base { fun test() = "OK" } diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.fir.kt deleted file mode 100644 index 930bd45514c..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -public interface Base { - fun test() = "OK" -} - -public interface Base2 : Base - -class Delegate : Base2 - -fun box(): String { - object : Base, Base2 by Delegate() { - - } - - object : Base2, Base by Delegate() { - - } - - return "OK" -} diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.kt index 930bd45514c..71b0540f2f3 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public interface Base { fun test() = "OK" } diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.fir.kt deleted file mode 100644 index 9c55da1c50c..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -public interface Base { - val test: String - get() = "OK" -} - -public interface Base2 : Base - -class Delegate : Base2 - -fun box(): String { - object : Base, Base2 by Delegate() { - - } - - object : Base2, Base by Delegate() { - - } - - return "OK" -} diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.kt index 9c55da1c50c..ef2deddfb12 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/delegationToSubTypeProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public interface Base { val test: String get() = "OK" diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.fir.kt deleted file mode 100644 index d2bc0a749f0..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -public interface Base { - fun test() = "OK" -} - -open class Base2 : Base { - override fun test() = "OK2" -} - -class Delegate : Base - -fun box(): String { - - object : Base2(), Base by Delegate() { - override fun test() = "OK" - } - - return "OK" -} diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.kt index d2bc0a749f0..6540857f975 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/explicitOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public interface Base { fun test() = "OK" } diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.fir.kt deleted file mode 100644 index fb4fa1e4ee9..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -public interface Base { - fun test(p: T) = "Base" -} - -public interface Derived : Base - -class Delegate : Derived - -fun box(): String { - object : Derived by Delegate() { - } - return "OK" -} - diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.kt index fb4fa1e4ee9..d8dddbc2fd5 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/generic.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public interface Base { fun test(p: T) = "Base" } diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.fir.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.fir.kt deleted file mode 100644 index cacaab043f4..00000000000 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -interface Base { - fun test() = "OK" -} - -open class Base2 : Base - -class Delegate : Base - -fun box(): String { - object : Base2(), Base by Delegate() { - - } - - return "OK" -} diff --git a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.kt b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.kt index cacaab043f4..d59c7eb24da 100644 --- a/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.kt +++ b/compiler/testData/diagnostics/tests/delegation/memberHidesSupertypeOverride/simpleNoOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Base { fun test() = "OK" } diff --git a/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.fir.kt b/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.fir.kt deleted file mode 100644 index f5ccb9a914f..00000000000 --- a/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -@Target(AnnotationTarget.EXPRESSION) -@Retention(AnnotationRetention.SOURCE) -annotation class foo - -fun f(s : String?) : Boolean { - return (@foo s?.equals("a"))!! -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.kt b/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.kt index f5ccb9a914f..b0f3345245d 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/annotatedSafeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.EXPRESSION) @Retention(AnnotationRetention.SOURCE) annotation class foo diff --git a/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.fir.kt b/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.fir.kt deleted file mode 100644 index 209ab44d1a1..00000000000 --- a/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun f(s : String?) : Boolean { - return (((s?.equals("a"))))!! -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.kt b/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.kt index 209ab44d1a1..ec183849e26 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/multiParenthesizedSafeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun f(s : String?) : Boolean { return (((s?.equals("a"))))!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.fir.kt b/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.fir.kt deleted file mode 100644 index bab8ed3f1be..00000000000 --- a/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun f(s : String?) : Boolean { - return (s?.equals("a"))!! -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.kt b/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.kt index bab8ed3f1be..5894544a449 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/parenthesizedSafeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun f(s : String?) : Boolean { return (s?.equals("a"))!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.fir.kt b/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.fir.kt deleted file mode 100644 index 4d851d7127a..00000000000 --- a/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -class A { - @Deprecated("deprecated") companion object - - class B -} - -val x1 = A.B() - diff --git a/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.kt b/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.kt index 4d851d7127a..fd12fed2b14 100644 --- a/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.kt +++ b/compiler/testData/diagnostics/tests/deprecated/classWithCompanionObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { @Deprecated("deprecated") companion object diff --git a/compiler/testData/diagnostics/tests/deprecated/thisUsage.fir.kt b/compiler/testData/diagnostics/tests/deprecated/thisUsage.fir.kt deleted file mode 100644 index cc5148216ae..00000000000 --- a/compiler/testData/diagnostics/tests/deprecated/thisUsage.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -@Deprecated("Use A instead") open class MyClass { - fun foo() { - val test = this - } -} diff --git a/compiler/testData/diagnostics/tests/deprecated/thisUsage.kt b/compiler/testData/diagnostics/tests/deprecated/thisUsage.kt index cc5148216ae..a017cd364be 100644 --- a/compiler/testData/diagnostics/tests/deprecated/thisUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/thisUsage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE @Deprecated("Use A instead") open class MyClass { diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.fir.kt deleted file mode 100644 index f6c76cb59ce..00000000000 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -open class B { - private fun getX() = 1 -} - -class C : B() { - val x: Int - get() = 1 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.kt index f6c76cb59ce..3a74eb201bd 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/accidentalOverrides/privateClassFunctionOverriddenByProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class B { private fun getX() = 1 } diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.fir.kt deleted file mode 100644 index 9fcf9ce0da1..00000000000 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: A.java - -public class A { - public String getFoo() { - return "Foo"; - } -} - -// FILE: B.kt - -class B(private val foo: String) : A() { - override fun getFoo(): String = foo -} diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.kt index 9fcf9ce0da1..613b6057300 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/privateClassPropertyNoClash.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.fir.kt deleted file mode 100644 index 568f17314a3..00000000000 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// FILE: a.kt -val x = 1 - -// FILE: b.kt -fun getX() = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.kt index 568f17314a3..837d89a5598 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/functionAndProperty/topLevelDifferentFiles.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt val x = 1 diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.fir.kt deleted file mode 100644 index 9561d68a6c3..00000000000 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: A.java - -public interface A { - public String a = ""; - public static void foo() {} - public static void baz(String s) {} -} - -// FILE: K.kt - -open class K : A { - val a = "" - fun foo() {} - fun foo(i: Int) {} - fun baz(i: Int) {} - - companion object { - fun foo() {} - } -} diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.kt index 9561d68a6c3..2c6cf65f20a 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.fir.kt deleted file mode 100644 index 21ab1027a35..00000000000 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: A.java - -public interface A { - public static void foo() {} - public static void baz(String s) {} -} - -// FILE: B.java - -public interface B extends A { - public static void bar(int i) {} -} - -// FILE: K.kt - -open class K : B { - fun foo() {} - fun foo(a: Any) {} - fun bar(i: Int) {} - fun bar(i: String) {} - fun baz(i: Int) {} - - companion object { - fun foo() {} - fun bar(i: Int) {} - } -} diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.kt index 21ab1027a35..a74cc38e666 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinClassImplementsJavaInterfaceExtendsJavaInteface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt deleted file mode 100644 index 5cde834931a..00000000000 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: foo/A.java - -package foo; - -public class A { - private static void foo(int s) {} - static void bar(double s) {} -} - -// FILE: K.kt -import foo.A - -open class K : A() { - fun foo(i: Int) {} - fun bar(d: Double) {} - fun baz(i: Int) {} - - companion object { - fun foo(i: Int) {} - fun bar(d: Double) {} - } -} diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt index 5cde834931a..ba878edd940 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: foo/A.java diff --git a/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.fir.kt b/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.fir.kt deleted file mode 100644 index bb97e9dce60..00000000000 --- a/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -enum class E : T { - ENTRY { - override fun f() { - } - }; - - abstract override fun f() -} - -interface T { - fun f() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.kt b/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.kt index bb97e9dce60..910669703ff 100644 --- a/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.kt +++ b/compiler/testData/diagnostics/tests/enum/AbstractOverrideInEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E : T { ENTRY { override fun f() { diff --git a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.fir.kt b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.fir.kt deleted file mode 100644 index 303a241d6a0..00000000000 --- a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// KT-7753 false positive: enum constructor can be called from secondary constructor -enum class A(val c: Int) { - ONE(1), - TWO(2), - THREE(3), - FORTY_TWO(); - - constructor(): this(42) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt index 303a241d6a0..90eb1ecd20e 100644 --- a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt +++ b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-7753 false positive: enum constructor can be called from secondary constructor enum class A(val c: Int) { ONE(1), diff --git a/compiler/testData/diagnostics/tests/enum/classObjectInEnum.fir.kt b/compiler/testData/diagnostics/tests/enum/classObjectInEnum.fir.kt deleted file mode 100644 index 2dfdccc2e2c..00000000000 --- a/compiler/testData/diagnostics/tests/enum/classObjectInEnum.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -enum class E { - ENTRY; - - companion object { - fun entry() = ENTRY - } -} - -fun bar() = E.entry() diff --git a/compiler/testData/diagnostics/tests/enum/classObjectInEnum.kt b/compiler/testData/diagnostics/tests/enum/classObjectInEnum.kt index 2dfdccc2e2c..3f633687ee3 100644 --- a/compiler/testData/diagnostics/tests/enum/classObjectInEnum.kt +++ b/compiler/testData/diagnostics/tests/enum/classObjectInEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { ENTRY; diff --git a/compiler/testData/diagnostics/tests/enum/commonSupertype.fir.kt b/compiler/testData/diagnostics/tests/enum/commonSupertype.fir.kt deleted file mode 100644 index 31bda9beea4..00000000000 --- a/compiler/testData/diagnostics/tests/enum/commonSupertype.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// KT-5943 StackOverflowError from commonSupertype of two enums -// NI_EXPECTED_FILE - -enum class A { A } -enum class B { B } - -val x = if (true) A.A else B.B \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/commonSupertype.kt b/compiler/testData/diagnostics/tests/enum/commonSupertype.kt index 31bda9beea4..5d969218d08 100644 --- a/compiler/testData/diagnostics/tests/enum/commonSupertype.kt +++ b/compiler/testData/diagnostics/tests/enum/commonSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-5943 StackOverflowError from commonSupertype of two enums // NI_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/tests/enum/emptyConstructor.fir.kt b/compiler/testData/diagnostics/tests/enum/emptyConstructor.fir.kt deleted file mode 100644 index 97493b36a35..00000000000 --- a/compiler/testData/diagnostics/tests/enum/emptyConstructor.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -enum class E { - A; // no constructor call needed - constructor() -} diff --git a/compiler/testData/diagnostics/tests/enum/emptyConstructor.kt b/compiler/testData/diagnostics/tests/enum/emptyConstructor.kt index 97493b36a35..9df73996205 100644 --- a/compiler/testData/diagnostics/tests/enum/emptyConstructor.kt +++ b/compiler/testData/diagnostics/tests/enum/emptyConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { A; // no constructor call needed constructor() diff --git a/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.fir.kt b/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.fir.kt deleted file mode 100644 index 8b9d867bd49..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -import java.lang.annotation.RetentionPolicy - -enum class E { - ENTRY -} - -// Test resolve from source -val a: Enum = E.ENTRY - -// Test Java resolve -val b: Enum = RetentionPolicy.RUNTIME - -// Test deserialized resolve -val c: Enum = AnnotationTarget.CLASS diff --git a/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.kt b/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.kt index 8b9d867bd49..0a8552093f8 100644 --- a/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.kt +++ b/compiler/testData/diagnostics/tests/enum/enumIsAssignableToBuiltInEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import java.lang.annotation.RetentionPolicy enum class E { diff --git a/compiler/testData/diagnostics/tests/enum/enumMissingName.fir.kt b/compiler/testData/diagnostics/tests/enum/enumMissingName.fir.kt deleted file mode 100644 index 3c643de9647..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumMissingName.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// Error: name should present -enum class(val rgb : Int) { - RED(0xFF000), - GREEN(0x00FF00), - BLUE(0x0000FF) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumMissingName.kt b/compiler/testData/diagnostics/tests/enum/enumMissingName.kt index 3c643de9647..c1f009ea8e7 100644 --- a/compiler/testData/diagnostics/tests/enum/enumMissingName.kt +++ b/compiler/testData/diagnostics/tests/enum/enumMissingName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Error: name should present enum class(val rgb : Int) { RED(0xFF000), diff --git a/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.fir.kt b/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.fir.kt deleted file mode 100644 index 02cc1dbca97..00000000000 --- a/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -enum class { -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.kt b/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.kt index 02cc1dbca97..e3faf0c980c 100644 --- a/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.kt +++ b/compiler/testData/diagnostics/tests/enum/enumWithEmptyName.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL enum class { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.fir.kt b/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.fir.kt deleted file mode 100644 index 7441eca0cfa..00000000000 --- a/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -enum class E { - entry -} - -val Int.entry: Int get() = 42 -val Long.entry: Int get() = 239 - -val e = E.entry diff --git a/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.kt b/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.kt index 7441eca0cfa..b84e1dc1d35 100644 --- a/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.kt +++ b/compiler/testData/diagnostics/tests/enum/extensionNamedAsEnumEntry.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { entry } diff --git a/compiler/testData/diagnostics/tests/enum/importEnumFromJava.fir.kt b/compiler/testData/diagnostics/tests/enum/importEnumFromJava.fir.kt deleted file mode 100644 index 40fc2379b89..00000000000 --- a/compiler/testData/diagnostics/tests/enum/importEnumFromJava.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// FILE: test.kt - -package test - -import java.util.concurrent.TimeUnit.* - -val c = SECONDS diff --git a/compiler/testData/diagnostics/tests/enum/importEnumFromJava.kt b/compiler/testData/diagnostics/tests/enum/importEnumFromJava.kt index 40fc2379b89..031557ad96e 100644 --- a/compiler/testData/diagnostics/tests/enum/importEnumFromJava.kt +++ b/compiler/testData/diagnostics/tests/enum/importEnumFromJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: test.kt package test diff --git a/compiler/testData/diagnostics/tests/enum/inline.fir.kt b/compiler/testData/diagnostics/tests/enum/inline.fir.kt deleted file mode 100644 index 29e488c6785..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inline.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -enum class My { - inline -} diff --git a/compiler/testData/diagnostics/tests/enum/inline.kt b/compiler/testData/diagnostics/tests/enum/inline.kt index 29e488c6785..001cfc42d1e 100644 --- a/compiler/testData/diagnostics/tests/enum/inline.kt +++ b/compiler/testData/diagnostics/tests/enum/inline.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class My { inline } diff --git a/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.fir.kt deleted file mode 100644 index 9bd71186e81..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -class A { - enum class E { - ENTRY - } - - companion object { - } -} - - - -class B { - companion object { - } - - enum class E { - ENTRY - } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.kt b/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.kt index 9bd71186e81..5e8e34fc06a 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/existingClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { enum class E { ENTRY diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideClass.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/insideClass.fir.kt deleted file mode 100644 index 27369f8033f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/insideClass.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -class A { - enum class E { - ENTRY - } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideClass.kt b/compiler/testData/diagnostics/tests/enum/inner/insideClass.kt index 27369f8033f..91feebabd8c 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/insideClass.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/insideClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { enum class E { ENTRY diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.fir.kt deleted file mode 100644 index a95430c721f..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class A { - companion object { - enum class E { - ENTRY - } - } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.kt b/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.kt index a95430c721f..2dba51789c0 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/insideClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { companion object { enum class E { diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideEnum.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/insideEnum.fir.kt deleted file mode 100644 index e85746eb8eb..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/insideEnum.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -enum class E { - ABC; - - enum class F { - DEF - } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideEnum.kt b/compiler/testData/diagnostics/tests/enum/inner/insideEnum.kt index e85746eb8eb..d8ecd56efca 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/insideEnum.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/insideEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { ABC; diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideObject.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/insideObject.fir.kt deleted file mode 100644 index 80f679f8167..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/insideObject.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -object A { - enum class E { - ENTRY - } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideObject.kt b/compiler/testData/diagnostics/tests/enum/inner/insideObject.kt index 80f679f8167..123db405713 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/insideObject.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/insideObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object A { enum class E { ENTRY diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideTrait.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/insideTrait.fir.kt deleted file mode 100644 index 5d04181c73b..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/insideTrait.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -interface A { - enum class E { - ENTRY - } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/insideTrait.kt b/compiler/testData/diagnostics/tests/enum/inner/insideTrait.kt index 5d04181c73b..f32eae79f91 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/insideTrait.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/insideTrait.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { enum class E { ENTRY diff --git a/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.fir.kt deleted file mode 100644 index 5c974e726e1..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class A { - enum class E { - ENTRY - } - - companion object { - enum class E { - ENTRY2 - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.kt b/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.kt index 5c974e726e1..01a6330c381 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/redeclarationInClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { enum class E { ENTRY diff --git a/compiler/testData/diagnostics/tests/enum/inner/twoEnums.fir.kt b/compiler/testData/diagnostics/tests/enum/inner/twoEnums.fir.kt deleted file mode 100644 index fbf22f500c5..00000000000 --- a/compiler/testData/diagnostics/tests/enum/inner/twoEnums.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class A { - enum class E { ABC } - enum class F { DEF } -} diff --git a/compiler/testData/diagnostics/tests/enum/inner/twoEnums.kt b/compiler/testData/diagnostics/tests/enum/inner/twoEnums.kt index fbf22f500c5..40de2c77865 100644 --- a/compiler/testData/diagnostics/tests/enum/inner/twoEnums.kt +++ b/compiler/testData/diagnostics/tests/enum/inner/twoEnums.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { enum class E { ABC } enum class F { DEF } diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.fir.kt b/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.fir.kt deleted file mode 100644 index 971bb3fec1e..00000000000 --- a/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !CHECK_TYPE -// FILE: A.java -public enum A { - ENTRY; -} - -// FILE: test.kt -fun main() { - checkSubtype(A.valueOf("ENTRY")) -} diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.kt b/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.kt index 971bb3fec1e..ab6db7fa424 100644 --- a/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.kt +++ b/compiler/testData/diagnostics/tests/enum/javaEnumValueOfMethod.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java public enum A { diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.fir.kt b/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.fir.kt deleted file mode 100644 index 6089eef7c3c..00000000000 --- a/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !CHECK_TYPE -// FILE: A.java -public enum A { - ENTRY, - ANOTHER; -} - -// FILE: test.kt -fun main() { - checkSubtype>(A.values()) -} diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.kt b/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.kt index 6089eef7c3c..e382d710af0 100644 --- a/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.kt +++ b/compiler/testData/diagnostics/tests/enum/javaEnumValuesMethod.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java public enum A { diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.fir.kt b/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.fir.kt deleted file mode 100644 index d6a3800ebc8..00000000000 --- a/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !CHECK_TYPE -// FILE: A.java -public enum A { - - ENTRY { - public String s() { - return "s"; - } - }; - public abstract String s(); -} - -// FILE: test.kt -fun main() { - checkSubtype(A.ENTRY.s()) -} diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.kt b/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.kt index 1caca2c1e0d..15df5443257 100644 --- a/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.kt +++ b/compiler/testData/diagnostics/tests/enum/javaEnumWithAbstractFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java public enum A { diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.fir.kt b/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.fir.kt deleted file mode 100644 index 7d6399171d5..00000000000 --- a/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: A.java -public enum A { - ENTRY, - ANOTHER; - - public String s() { - return ""; - } -} - -// FILE: test.kt - -fun main() { - val c = A.ENTRY - c.s() -} diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.kt b/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.kt index 7d6399171d5..d6ff8ce674a 100644 --- a/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.kt +++ b/compiler/testData/diagnostics/tests/enum/javaEnumWithFuns.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public enum A { ENTRY, diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.fir.kt b/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.fir.kt deleted file mode 100644 index 5ab0ebf77dc..00000000000 --- a/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: A.java -public enum A { - ENTRY("1"), - ANOTHER("2"); - - public String s; - - private A(String s) { - this.s = s; - } -} - -// FILE: test.kt - -fun main() { - val c = A.ENTRY - c.s - A.ANOTHER.s -} diff --git a/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.kt b/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.kt index 5ab0ebf77dc..0030aa685b2 100644 --- a/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.kt +++ b/compiler/testData/diagnostics/tests/enum/javaEnumWithProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public enum A { ENTRY("1"), diff --git a/compiler/testData/diagnostics/tests/enum/kt2834.fir.kt b/compiler/testData/diagnostics/tests/enum/kt2834.fir.kt deleted file mode 100644 index 8144143dd11..00000000000 --- a/compiler/testData/diagnostics/tests/enum/kt2834.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -private enum class MethodKind { - INSTANCE, - STATIC -} - -private fun MethodKind.hasThis() = this == MethodKind.INSTANCE diff --git a/compiler/testData/diagnostics/tests/enum/kt2834.kt b/compiler/testData/diagnostics/tests/enum/kt2834.kt index 8144143dd11..5fe3aebea8d 100644 --- a/compiler/testData/diagnostics/tests/enum/kt2834.kt +++ b/compiler/testData/diagnostics/tests/enum/kt2834.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL private enum class MethodKind { INSTANCE, STATIC diff --git a/compiler/testData/diagnostics/tests/enum/multipleConstructors.fir.kt b/compiler/testData/diagnostics/tests/enum/multipleConstructors.fir.kt deleted file mode 100644 index 70a2c379ca7..00000000000 --- a/compiler/testData/diagnostics/tests/enum/multipleConstructors.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -enum class E(val x: Int, val y: Int) { - A(1, 2), - B(1), - C; // no constructor call needed even here - - constructor(): this(0, 0) - constructor(x: Int): this(x, 0) -} diff --git a/compiler/testData/diagnostics/tests/enum/multipleConstructors.kt b/compiler/testData/diagnostics/tests/enum/multipleConstructors.kt index 70a2c379ca7..91cc4007a49 100644 --- a/compiler/testData/diagnostics/tests/enum/multipleConstructors.kt +++ b/compiler/testData/diagnostics/tests/enum/multipleConstructors.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E(val x: Int, val y: Int) { A(1, 2), B(1), diff --git a/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.fir.kt b/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.fir.kt deleted file mode 100644 index b2b9ba97aa3..00000000000 --- a/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: E.kt -package foo - -enum class E { - ENTRY, - ANOTHER; - - class Nested { - companion object { - fun foo() = 42 - } - } -} - -// FILE: main.kt -package bar - -import foo.E.* - -fun f1() = ENTRY -fun f2() = ANOTHER -fun f3() = Nested() -fun f4() = Nested.foo() -fun f5() = values() diff --git a/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.kt b/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.kt index b2b9ba97aa3..869a8e2a1b6 100644 --- a/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.kt +++ b/compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: E.kt package foo diff --git a/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.fir.kt b/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.fir.kt deleted file mode 100644 index b3580c5fac2..00000000000 --- a/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -enum class E { - ENTRY; - - companion object { - fun foo(): E = ENTRY - fun bar(): Array = values() - fun baz(): E = valueOf("ENTRY") - val valuez = values() - } - - fun oof(): E = ENTRY - fun rab(): Array = values() - fun zab(): E = valueOf("ENTRY") -} - -fun foo() = E.ENTRY -fun bar() = E.values() -fun baz() = E.valueOf("ENTRY") diff --git a/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.kt b/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.kt index b3580c5fac2..a014556cf66 100644 --- a/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.kt +++ b/compiler/testData/diagnostics/tests/enum/valuesValueOfAndEntriesAccessibility.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { ENTRY; diff --git a/compiler/testData/diagnostics/tests/evaluate/float.fir.kt b/compiler/testData/diagnostics/tests/evaluate/float.fir.kt deleted file mode 100644 index 67f8b0c5692..00000000000 --- a/compiler/testData/diagnostics/tests/evaluate/float.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -val a1: Float = 1F -val a2: Float = 1.0F -val a3: Float = 1e-1F -val a4: Float = 1.0e-1F - -val b5: Float = 1f -val b6: Float = 1.0f -val b7: Float = 1e-1f -val b8: Float = 1.0e-1f - diff --git a/compiler/testData/diagnostics/tests/evaluate/float.kt b/compiler/testData/diagnostics/tests/evaluate/float.kt index 67f8b0c5692..709d6bc9bca 100644 --- a/compiler/testData/diagnostics/tests/evaluate/float.kt +++ b/compiler/testData/diagnostics/tests/evaluate/float.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val a1: Float = 1F val a2: Float = 1.0F val a3: Float = 1e-1F diff --git a/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.fir.kt b/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.fir.kt deleted file mode 100644 index 0e97797cf5e..00000000000 --- a/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -val zero = 0 - -fun test() { - -0 - -0L - -0.0 - -(1 - 1) - -zero - - +0 -} diff --git a/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.kt b/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.kt index 0e97797cf5e..6ac639bb931 100644 --- a/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.kt +++ b/compiler/testData/diagnostics/tests/evaluate/noOverflowWithZero.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val zero = 0 fun test() { diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt deleted file mode 100644 index 3dbdd578b6c..00000000000 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -fun fooInt(p: Int) = p -fun fooLong(p: Long) = p -fun fooByte(p: Byte) = p -fun fooShort(p: Short) = p - -fun test() { - fooInt(1 + 1) - fooByte(1 + 1) - fooLong(1 + 1) - fooShort(1 + 1) - - fooInt(1 * 1) - fooByte(1 * 1) - fooLong(1 * 1) - fooShort(1 * 1) - - fooInt(1 / 1) - fooByte(1 / 1) - fooLong(1 / 1) - fooShort(1 / 1) - - fooInt(1 % 1) - fooByte(1 % 1) - fooLong(1 % 1) - fooShort(1 % 1) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt index 3dbdd578b6c..9ecda100ac5 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun fooInt(p: Int) = p fun fooLong(p: Long) = p fun fooByte(p: Byte) = p diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt deleted file mode 100644 index 04d6003ff41..00000000000 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -fun fooInt(p: Int) = p -fun fooLong(p: Long) = p -fun fooByte(p: Byte) = p -fun fooShort(p: Short) = p - -fun test() { - fooInt(1.plus(1)) - fooByte(1.plus(1)) - fooLong(1.plus(1)) - fooShort(1.plus(1)) - - fooInt(1.times(1)) - fooByte(1.times(1)) - fooLong(1.times(1)) - fooShort(1.times(1)) - - fooInt(1.div(1)) - fooByte(1.div(1)) - fooLong(1.div(1)) - fooShort(1.div(1)) - - fooInt(1.rem(1)) - fooByte(1.rem(1)) - fooLong(1.rem(1)) - fooShort(1.rem(1)) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt index 04d6003ff41..cc87f6049ae 100644 --- a/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt +++ b/compiler/testData/diagnostics/tests/evaluate/numberBinaryOperationsCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun fooInt(p: Int) = p fun fooLong(p: Long) = p fun fooByte(p: Byte) = p diff --git a/compiler/testData/diagnostics/tests/exposed/delegate.fir.kt b/compiler/testData/diagnostics/tests/exposed/delegate.fir.kt deleted file mode 100644 index e2e02550d2f..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/delegate.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -interface My - -internal class Your: My - -// Code is valid, despite of delegate is internal -class His: My by Your() diff --git a/compiler/testData/diagnostics/tests/exposed/delegate.kt b/compiler/testData/diagnostics/tests/exposed/delegate.kt index e2e02550d2f..b8fa855617b 100644 --- a/compiler/testData/diagnostics/tests/exposed/delegate.kt +++ b/compiler/testData/diagnostics/tests/exposed/delegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface My internal class Your: My diff --git a/compiler/testData/diagnostics/tests/exposed/implements.fir.kt b/compiler/testData/diagnostics/tests/exposed/implements.fir.kt deleted file mode 100644 index 8e26914c1fd..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/implements.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -private interface My - -// valid, it's allowed to implement worse-visible interface -class Your: My \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/implements.kt b/compiler/testData/diagnostics/tests/exposed/implements.kt index 8e26914c1fd..84aa1c4e439 100644 --- a/compiler/testData/diagnostics/tests/exposed/implements.kt +++ b/compiler/testData/diagnostics/tests/exposed/implements.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL private interface My // valid, it's allowed to implement worse-visible interface diff --git a/compiler/testData/diagnostics/tests/exposed/internalAndProtected.fir.kt b/compiler/testData/diagnostics/tests/exposed/internalAndProtected.fir.kt deleted file mode 100644 index 69c94fee1d6..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/internalAndProtected.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -public open class A { - protected open class B -} - -public open class C : A() { - protected open class D { - // internal & protected(in C) <= protected(in A): Ok - internal open class E : A.B() - } -} diff --git a/compiler/testData/diagnostics/tests/exposed/internalAndProtected.kt b/compiler/testData/diagnostics/tests/exposed/internalAndProtected.kt index 69c94fee1d6..cde0f4a7fe1 100644 --- a/compiler/testData/diagnostics/tests/exposed/internalAndProtected.kt +++ b/compiler/testData/diagnostics/tests/exposed/internalAndProtected.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public open class A { protected open class B } diff --git a/compiler/testData/diagnostics/tests/exposed/localFromInternal.fir.kt b/compiler/testData/diagnostics/tests/exposed/localFromInternal.fir.kt deleted file mode 100644 index 89521bdd0dc..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/localFromInternal.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class My { - internal open class ThreadLocal - // Private from local: ??? - private val values = - // Local from internal: Ok - object: ThreadLocal() {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/localFromInternal.kt b/compiler/testData/diagnostics/tests/exposed/localFromInternal.kt index 89521bdd0dc..a88cb3907c5 100644 --- a/compiler/testData/diagnostics/tests/exposed/localFromInternal.kt +++ b/compiler/testData/diagnostics/tests/exposed/localFromInternal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class My { internal open class ThreadLocal // Private from local: ??? diff --git a/compiler/testData/diagnostics/tests/exposed/localFromPrivate.fir.kt b/compiler/testData/diagnostics/tests/exposed/localFromPrivate.fir.kt deleted file mode 100644 index 9156292343b..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/localFromPrivate.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -class A { - private open class B - fun f() { - // Local from private: Ok - class C : B() - } -} - -private open class D - -fun f(): Int { - // Local from private: Ok - val x = object : D() { } - return x.hashCode() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/localFromPrivate.kt b/compiler/testData/diagnostics/tests/exposed/localFromPrivate.kt index 9156292343b..628af930082 100644 --- a/compiler/testData/diagnostics/tests/exposed/localFromPrivate.kt +++ b/compiler/testData/diagnostics/tests/exposed/localFromPrivate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { private open class B fun f() { diff --git a/compiler/testData/diagnostics/tests/exposed/nested.fir.kt b/compiler/testData/diagnostics/tests/exposed/nested.fir.kt deleted file mode 100644 index 57e35086ad8..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/nested.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -internal open class My - -internal class Outer { - // Ok, effectively internal from internal - class Your: My() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/nested.kt b/compiler/testData/diagnostics/tests/exposed/nested.kt index 57e35086ad8..692fcf8afdf 100644 --- a/compiler/testData/diagnostics/tests/exposed/nested.kt +++ b/compiler/testData/diagnostics/tests/exposed/nested.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL internal open class My internal class Outer { diff --git a/compiler/testData/diagnostics/tests/exposed/privateFromLocal.fir.kt b/compiler/testData/diagnostics/tests/exposed/privateFromLocal.fir.kt deleted file mode 100644 index 73d344637d5..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/privateFromLocal.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -interface Your - -class My { - // private from local: ??? - private val x = object : Your {} - - // private from local: ??? - private fun foo() = { - class Local - Local() - }() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/privateFromLocal.kt b/compiler/testData/diagnostics/tests/exposed/privateFromLocal.kt index 73d344637d5..411be3256d7 100644 --- a/compiler/testData/diagnostics/tests/exposed/privateFromLocal.kt +++ b/compiler/testData/diagnostics/tests/exposed/privateFromLocal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Your class My { diff --git a/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.fir.kt b/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.fir.kt deleted file mode 100644 index db0bb7a35bd..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -private enum class Foo { A, B } - -class Bar private constructor(private val foo: Foo) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.kt b/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.kt index db0bb7a35bd..e2cf3133966 100644 --- a/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.kt +++ b/compiler/testData/diagnostics/tests/exposed/privatePropertyInPrivateConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL private enum class Foo { A, B } class Bar private constructor(private val foo: Foo) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.fir.kt b/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.fir.kt deleted file mode 100644 index d2b672f3f0e..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -private enum class Foo { A, B } - -private class Bar(val foo: Foo) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.kt b/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.kt index d2b672f3f0e..1e212a19fb0 100644 --- a/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.kt +++ b/compiler/testData/diagnostics/tests/exposed/propertyInConstructorOfPrivateClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL private enum class Foo { A, B } private class Bar(val foo: Foo) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt b/compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt deleted file mode 100644 index 29096cf0d16..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/protectedJava.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: Outer.java - -public abstract class Outer { - protected static class My {} - protected static class Your extends My {} - abstract protected Your foo(My my); -} - -// FILE: OuterDerived.kt - -class OuterDerived: Outer() { - // valid, My has better visibility - protected class His: Outer.My() - // valid, My and Your have better visibility - override fun foo(my: Outer.My) = Outer.Your() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/protectedJava.kt b/compiler/testData/diagnostics/tests/exposed/protectedJava.kt index 29096cf0d16..670a699a786 100644 --- a/compiler/testData/diagnostics/tests/exposed/protectedJava.kt +++ b/compiler/testData/diagnostics/tests/exposed/protectedJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Outer.java public abstract class Outer { diff --git a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt deleted file mode 100644 index 9925008e88c..00000000000 --- a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -abstract class Outer { - protected open class My - // Both valid: same way protected - protected class Your: My() - abstract protected fun foo(my: My): Your -} - -class OuterDerived: Outer() { - // valid, My has better visibility - protected class His: Outer.My() - // valid, My and Your have better visibility - override fun foo(my: Outer.My) = Outer.Your() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt index 9925008e88c..a487d3b0c94 100644 --- a/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt +++ b/compiler/testData/diagnostics/tests/exposed/protectedSameWay.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class Outer { protected open class My // Both valid: same way protected diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator.fir.kt b/compiler/testData/diagnostics/tests/extensions/GenericIterator.fir.kt deleted file mode 100644 index fdb80f439aa..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -import java.util.Enumeration - -fun java.util.Enumeration.iterator() = object: Iterator { - override fun hasNext(): Boolean = hasMoreElements() - - override fun next() = nextElement() -} - -interface MyIterator { - - operator fun hasNext() : Boolean - - operator fun next() : T -} - -operator fun T?.iterator() = object : MyIterator { - var hasNext = this@iterator != null - private set - override fun hasNext() = hasNext - - override fun next() : T { - if (hasNext) { - hasNext = false - return this@iterator!! - } - throw java.util.NoSuchElementException() - } -} - -fun main() { - val i : Int? = 1 - for (x in i) { - System.out.println(x) - } -} - diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt b/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt index fdb80f439aa..63a28f4cdac 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import java.util.Enumeration fun java.util.Enumeration.iterator() = object: Iterator { diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt deleted file mode 100644 index 46f5bc1c2f0..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !WITH_NEW_INFERENCE - -interface JPAEntityClass { - fun T.findByName(s: String): D {null!!} -} - -class Foo { - companion object : JPAEntityClass -} - -fun main() { - with("", { - Foo.findByName("") - }) - with(Foo) { - findByName("") - } -} diff --git a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt index 46f5bc1c2f0..85f107ca35d 100644 --- a/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt +++ b/compiler/testData/diagnostics/tests/extensions/extensionMemberInClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.fir.kt b/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.fir.kt deleted file mode 100644 index 4ae6532be52..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -val Int.foo: Int - get() = this - - -fun test(foo: Int) { - test(4.foo) - test(foo) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.kt b/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.kt index 4ae6532be52..ae435d9192e 100644 --- a/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.kt +++ b/compiler/testData/diagnostics/tests/extensions/extensionPropertyVsParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val Int.foo: Int get() = this diff --git a/compiler/testData/diagnostics/tests/extensions/kt2317.fir.kt b/compiler/testData/diagnostics/tests/extensions/kt2317.fir.kt deleted file mode 100644 index 6bd8ceac485..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/kt2317.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -//KT-2317 Wrong UNNECESSARY_SAFE_CALL - -package kt2317 - -fun Any?.baz() = 1 - -fun foo(l: Long?) = l?.baz() - - -fun Any?.bar(): Unit { } - -fun quux(x: Int?): Unit { - x?.baz() - x?.bar() -} diff --git a/compiler/testData/diagnostics/tests/extensions/kt2317.kt b/compiler/testData/diagnostics/tests/extensions/kt2317.kt index 6bd8ceac485..1ddd6525338 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt2317.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt2317.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2317 Wrong UNNECESSARY_SAFE_CALL package kt2317 diff --git a/compiler/testData/diagnostics/tests/extensions/kt3470.fir.kt b/compiler/testData/diagnostics/tests/extensions/kt3470.fir.kt deleted file mode 100644 index 60704abda29..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/kt3470.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class A { - companion object { - fun foo() = toString() - } -} - -val a = A.toString() diff --git a/compiler/testData/diagnostics/tests/extensions/kt3470.kt b/compiler/testData/diagnostics/tests/extensions/kt3470.kt index 60704abda29..7c363f652ce 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt3470.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt3470.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { companion object { fun foo() = toString() diff --git a/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.fir.kt b/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.fir.kt deleted file mode 100644 index 619baea05d3..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// FILE: A.java -public class A { - public static void foo() {} - public static class Nested {} -} - -// FILE: B.kt -fun Any?.bar() = 42 - -fun f1() = A.bar() -fun f2() = A.Nested.bar() diff --git a/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.kt b/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.kt index 619baea05d3..2acbc4a6aad 100644 --- a/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.kt +++ b/compiler/testData/diagnostics/tests/extensions/noClassObjectsInJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { public static void foo() {} diff --git a/compiler/testData/diagnostics/tests/extensions/object.fir.kt b/compiler/testData/diagnostics/tests/extensions/object.fir.kt deleted file mode 100644 index 359316e1b95..00000000000 --- a/compiler/testData/diagnostics/tests/extensions/object.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -object O - -fun Any.foo() = 42 -val Any?.bar: Int get() = 239 - -val x = O.foo() + O.bar diff --git a/compiler/testData/diagnostics/tests/extensions/object.kt b/compiler/testData/diagnostics/tests/extensions/object.kt index 359316e1b95..65f50efd034 100644 --- a/compiler/testData/diagnostics/tests/extensions/object.kt +++ b/compiler/testData/diagnostics/tests/extensions/object.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object O fun Any.foo() = 42 diff --git a/compiler/testData/diagnostics/tests/fileDependencyRecursion.fir.kt b/compiler/testData/diagnostics/tests/fileDependencyRecursion.fir.kt deleted file mode 100644 index d4302a476a5..00000000000 --- a/compiler/testData/diagnostics/tests/fileDependencyRecursion.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: fileDependencyRecursion.kt -package test - -import testOther.some - -val normal: Int = 1 -val fromImported: Int = some - -// FILE: fileDependencyRecursionOther.kt -package testOther - -import test.normal - -val some: Int = 1 -val fromImported: Int = normal \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/fileDependencyRecursion.kt b/compiler/testData/diagnostics/tests/fileDependencyRecursion.kt index d4302a476a5..ac2e7be13e9 100644 --- a/compiler/testData/diagnostics/tests/fileDependencyRecursion.kt +++ b/compiler/testData/diagnostics/tests/fileDependencyRecursion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: fileDependencyRecursion.kt package test diff --git a/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.fir.kt b/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.fir.kt deleted file mode 100644 index 5f0dcc62da6..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: +FunctionalInterfaceConversion - -fun interface Foo { - fun invoke() -} diff --git a/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.kt b/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.kt index 5f0dcc62da6..f6ef3e2efa4 100644 --- a/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.kt +++ b/compiler/testData/diagnostics/tests/funInterface/basicFunInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +FunctionalInterfaceConversion fun interface Foo { diff --git a/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.fir.kt b/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.fir.kt deleted file mode 100644 index 928b723255e..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun interface Foo { - fun invoke() -} - -fun foo(f: Foo) {} - -fun test() { - foo {} -} diff --git a/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.kt b/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.kt index 928b723255e..cf2be4adc3a 100644 --- a/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.kt +++ b/compiler/testData/diagnostics/tests/funInterface/basicFunInterfaceConversion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +FunctionalInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.fir.kt b/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.fir.kt deleted file mode 100644 index 61997ceb8c4..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun interface KRunnable { - fun invoke() -} - -typealias KRunnableAlias = KRunnable - -fun foo(f: KRunnable) {} - -fun test() { - foo(KRunnable {}) - foo(KRunnableAlias {}) -} diff --git a/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt b/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt index 61997ceb8c4..b465994e13e 100644 --- a/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt +++ b/compiler/testData/diagnostics/tests/funInterface/funInterfaceSyntheticConstructors.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.fir.kt b/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.fir.kt deleted file mode 100644 index d056939e048..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion -// !CHECK_TYPE - -fun interface F { - fun apply(s: S) -} - -interface PR {} - -interface K { - fun f_t(f1: F, f2: F) - fun f_r(f1: F, f2: F) - fun f_pr(f1: F>, f2: F>) -} - -fun test( - k: K, - f_string: F, - f_int: F, - f_pr: F> -) { - k.f_t(f_string) { it checkType { _() } } - k.f_r(f_int) { it checkType { _() } } - k.f_pr(f_pr) { it checkType { _>() } } -} diff --git a/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt b/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt index d056939e048..b208c6ed58a 100644 --- a/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt +++ b/compiler/testData/diagnostics/tests/funInterface/genericSubstitutionForFunInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.fir.kt b/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.fir.kt deleted file mode 100644 index b7f10e7887f..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.fir.kt +++ /dev/null @@ -1,33 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion - -interface J { - fun foo1(r: KRunnable) - - fun foo2(r1: KRunnable, r2: KRunnable) - - fun foo3(r1: KRunnable, r2: KRunnable, r3: KRunnable) -} - -fun interface KRunnable { - fun run() -} - -// FILE: 1.kt -fun test(j: J, r: KRunnable) { - j.foo1(r) - j.foo1({}) - - j.foo2(r, r) - j.foo2({}, {}) - j.foo2(r, {}) - j.foo2({}, r) - - j.foo3(r, r, r) - j.foo3(r, r, {}) - j.foo3(r, {}, r) - j.foo3(r, {}, {}) - j.foo3({}, r, r) - j.foo3({}, r, {}) - j.foo3({}, {}, r) - j.foo3({}, {}, {}) -} diff --git a/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.kt b/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.kt index b7f10e7887f..715897425be 100644 --- a/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.kt +++ b/compiler/testData/diagnostics/tests/funInterface/severalConversionsForFunInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion interface J { diff --git a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt deleted file mode 100644 index 8c60a7b0cfd..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion -// !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE - -fun interface SuspendRunnable { - suspend fun invoke() -} - -fun run(r: SuspendRunnable) {} - -suspend fun bar() {} - -fun test() { - run(::bar) -} diff --git a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt index 8c60a7b0cfd..0e82d898a1f 100644 --- a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt +++ b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Common.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Common.fir.kt deleted file mode 100644 index ce39b853d92..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Common.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_PARAMETER - -annotation class ann(val name: String) -const val ok = "OK" - -class A - -val withoutName = fun () {} -val extensionWithoutName = fun A.() {} - -fun withAnnotation() = @ann(ok) fun () {} -val withReturn = fun (): Int { return 5} -val withExpression = fun() = 5 -val funfun = fun() = fun() = 5 - -val parentesized = (fun () {}) -val parentesizedWithType = checkSubtype<() -> Unit>((fun () {})) -val withType = checkSubtype<() -> Unit>((fun () {})) diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt index ce39b853d92..41f128a0211 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/Common.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.fir.kt deleted file mode 100644 index 1c940b44ac6..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - -fun foo(f : (T) -> T) : T = throw Exception() - -fun test() { - val a : Int = foo(fun (x) = x) -} diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.kt b/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.kt index 1c940b44ac6..da66c47b509 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/DifficultInferenceForParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER fun foo(f : (T) -> T) : T = throw Exception() diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.fir.kt deleted file mode 100644 index 13610785b58..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -val bar = fun() {} -val bas = fun() {} - -fun gar(p: Any?) = fun() {} -fun gas(p: Any?) = fun() {} - -fun outer() { - val bar = fun() {} - val bas = fun() {} - - fun gar(p: Any?) = fun() {} - fun gas(p: Any?) = fun() {} - - gar(fun() {}) - gar(fun() {}) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.kt b/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.kt index 13610785b58..1129f550fec 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/NoOverloadError.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE val bar = fun() {} diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.fir.kt deleted file mode 100644 index 519b889788a..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -val label_fun = label@ fun () { - return@label -} - -val parenthesized_label_fun = (label@ fun () { - return@label -}) diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt index 519b889788a..ac120fd3550 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ReturnAndLabels.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE val label_fun = label@ fun () { diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.fir.kt deleted file mode 100644 index c7976fa07ac..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -interface B { - fun b_fun() {} -} - -fun test(param: String) { - - val local_val = 4 - val bar = fun B.(fun_param: Int) { - param.length - b_fun() - val inner_bar = local_val + fun_param - - bar - } - - inner_bar - fun_param -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.kt b/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.kt index c7976fa07ac..459e1229130 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/ScopeCheck.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE interface B { diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.fir.kt deleted file mode 100644 index ae58e457603..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -fun parameter() = fun (t: T) = t -fun receiver() = fun T.() = this -fun returnType() = fun (): T = null!! - -val T.fromVal: () -> T get() = fun (): T = this@fromVal - -fun devNull(a: Any?){} - -fun outer() { - fun parameter() = fun (t: T) = t - fun receiver() = fun T.() = this - fun returnType() = fun (): T = null!! - - devNull(fun (t: O) = t) - devNull(fun O.() = this) - devNull(fun (): O = null!!) -} - -class Outer { - fun parameter() = fun (t: T) = t - fun receiver() = fun T.() = this - fun returnType() = fun (): T = null!! - - init { - devNull(fun (t: O) = t) - devNull(fun O.() = this) - devNull(fun (): O = null!!) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.kt b/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.kt index ae58e457603..ba697918aab 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/WithOuterGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE fun parameter() = fun (t: T) = t diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.fir.kt deleted file mode 100644 index de80476b1b5..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !CHECK_TYPE - -fun test(bal: Array) { - var bar = 4 - - val a = { bar += 4 } - checkSubtype<() -> Unit>(a) - - val b = { bar = 4 } - checkSubtype<() -> Unit>(b) - - val c = { bal[2] = 3 } - checkSubtype<() -> Unit>(c) - - val d = run { bar += 4 } - checkSubtype(d) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt index de80476b1b5..8d4042dddd3 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/assignmentOperationInLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test(bal: Array) { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.fir.kt deleted file mode 100644 index 4eed101c9a8..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.fir.kt +++ /dev/null @@ -1,53 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_PARAMETER -class A - -operator fun A.component1() = 1 -operator fun A.component2() = "" - -class B - -class D { - operator fun A.component1() = 1.0 - operator fun A.component2() = ' ' - - operator fun B.component1() = 1.0 - operator fun B.component2() = ' ' -} - -fun foo(block: (A) -> Unit) { } -fun foobaz(block: D.(B) -> Unit) { } -fun foobar(block: D.(A) -> Unit) { } - -fun bar() { - foo { (a, b) -> - a checkType { _() } - b checkType { _() } - } - - foo { (a: Int, b: String) -> - a checkType { _() } - b checkType { _() } - } - - // From KEEP: Component-functions are resolved in the same scope as the first statement of the lambda - foobaz { (a, b) -> - a checkType { _() } - b checkType { _() } - } - - // From KEEP: Component-functions are resolved in the same scope as the first statement of the lambda - // So `component1`/`component2` for lambda parameters were resolved to member extensions - foobar { (a, b) -> - a checkType { _() } - b checkType { _() } - } - - // the following code fails with exception, see KT-13873 -// foobarbaz { -// component1: B.() -> Int, -// component2: B.() -> String, -// (a, b): B -> -// -// } -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.kt index 4eed101c9a8..b762599e80a 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/extensionComponents.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_PARAMETER class A diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.fir.kt deleted file mode 100644 index 5554968db9f..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -data class A(val x: Int, val y: String) - -fun foo(block: (A) -> Unit) { } - -fun bar(a: Double) { - val b = 1.toShort() - // Do not report NAME_SHADOWING on lambda destructured parameter, the same way as for common parameters - foo { (a, b) -> - a checkType { _() } - b checkType { _() } - } - - foo { (c, d) -> - c checkType { _() } - d checkType { _() } - - foo { (a, c) -> - a checkType { _() } - c checkType { _() } - d checkType { _() } - } - } -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.kt index 5554968db9f..3145542ffad 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/shadowing.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE data class A(val x: Int, val y: String) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.fir.kt deleted file mode 100644 index 61f1611b10e..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_EXPRESSION - -import java.util.HashSet - -fun test123() { - val g: (Int) -> Unit = if (true) { - val set = HashSet() - fun (i: Int) { - set.add(i) - } - } - else { - { it -> it } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.kt index 61f1611b10e..669ee304e7b 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/functionExpressionAsLastExpressionInBlock.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_EXPRESSION import java.util.HashSet diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.fir.kt deleted file mode 100644 index b007414c1bd..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_EXPRESSION - -import java.util.HashSet - -fun test123() { - val g: (Int) -> Unit = if (true) { - val set = HashSet(); - { i -> - set.add(i) - } - } - else { - { it -> it } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt index b007414c1bd..e73b959abae 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/functionLiteralInIf.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_EXPRESSION import java.util.HashSet diff --git a/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.fir.kt deleted file mode 100644 index 6d60bef632b..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun Iterable.filter(predicate: (T) -> Boolean): List = TODO() -operator fun Collection.plus(elements: Iterable): List = TODO() - -fun stringCollection(): Collection = TODO() - -fun test(c: Collection) { - var variants = stringCollection() - variants += variants.filter { true } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.kt b/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.kt index 6d60bef632b..1348ac33293 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/genericFunctionalTypeOnRHSOfPlusAssign.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun Iterable.filter(predicate: (T) -> Boolean): List = TODO() diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.fir.kt deleted file mode 100644 index 63c81f0c12d..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -//KT-2906 If function parameter/variable is invoked in closure using parenthesis syntax, in IDEA it is not highlighted as captured in closure - -package bug - -public fun foo1(bar: () -> Unit) { - run { - bar() // ERROR: not highlighted as "captured in closure" - } -} - -public fun foo2(bar: () -> Unit) { - run { - bar.invoke() // CORRECT: highlighted as "captured in closure" - } -} - -fun main() { - foo1 { println ("foo1")} // prints "foo1" - foo2 { println ("foo2")} // prints "foo2" -} - -fun println(s: String) = s diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt index 63c81f0c12d..b2c39a4d1b4 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt2906.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2906 If function parameter/variable is invoked in closure using parenthesis syntax, in IDEA it is not highlighted as captured in closure package bug diff --git a/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.fir.kt deleted file mode 100644 index 092ff35c70c..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !LANGUAGE: +NewInference -// SKIP_TXT -// Issue: KT-35168 - -class Inv - -// Before the fix, here we had an exception while fixing a type variable for Inv due to prematurely analyzing a lambda -// The exception was: "UninitializedPropertyAccessException: lateinit property subResolvedAtoms has not been initialized" -class Foo(x: (T) -> T, y: Inv) - -fun bar() { - Foo({}, Inv()) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.kt b/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.kt index 092ff35c70c..2fdf928a61b 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/prematurelyAnalyzingLambdaWhileFixingTypeVariableForAnotherArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !LANGUAGE: +NewInference // SKIP_TXT diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.fir.kt deleted file mode 100644 index 05cd4632d05..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -val flag = true - -interface I -class A(): I -class B(): I - -val a = l@ { - return@l if (flag) A() else B() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt index 05cd4632d05..d89de0a0151 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/IfInReturnedExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val flag = true interface I diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.fir.kt deleted file mode 100644 index 777ef9e8a48..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -val flag = true - -val a /*: (Int) -> String */ = l@ { - i: Int -> - if (i == 0) return@l i.toString() - - "Ok" -} - -fun foo(f: (Int) -> T): T = f(0) - -val b /*:String */ = foo { - i -> - if (i == 0) return@foo i.toString() - - "Ok" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt index 777ef9e8a48..27b6c87573f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LambdaWithParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val flag = true val a /*: (Int) -> String */ = l@ { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.fir.kt deleted file mode 100644 index a0417a8fcca..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// !CHECK_TYPE - -fun test2() { - val x = run f@{return@f 1} - checkSubtype(x) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt index a0417a8fcca..3a5f50961b7 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelNoParens.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test2() { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.fir.kt deleted file mode 100644 index 4e10c2dba99..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE - -fun test() { - val x = run(f@{return@f 1}) - checkSubtype(x) -} - - -fun test1() { - val x = run(l@{return@l 1}) - checkSubtype(x) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt index 4e10c2dba99..e6e0488a096 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnExplicitLabelParens.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test() { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.fir.kt deleted file mode 100644 index 0aad15f653f..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE - -fun test() { - val x = run f@{ - fun local(a: Int): String { - if (a > 0) return "2" - return@local "3" - } - return@f 1 - } - checkSubtype(x) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt index 0aad15f653f..b021027ad7d 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test() { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.fir.kt deleted file mode 100644 index db53a69beab..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !CHECK_TYPE - -fun test() { - val x = run f@{ - run ff@ { - return@ff "2" - } - return@f 1 - } - checkSubtype(x) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt index db53a69beab..5f8968985b0 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnInNestedLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test() { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.fir.kt deleted file mode 100644 index 2e9d8675ca3..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -class A -val flag = true - -val a /*: () -> A?*/ = l@ { - if (flag) return@l null - - A() -} - -val b /*: () -> A?*/ = l@ { - if (flag) return@l null - - return@l A() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt index 2e9d8675ca3..4d652d4bc74 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A val flag = true diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.fir.kt deleted file mode 100644 index 5d19e6ac54c..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !CHECK_TYPE - -fun test(a: Int) { - val x = run f@{ - if (a > 0) return@f - else return@f Unit - } - checkSubtype(x) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt index 5d19e6ac54c..f931dcf8d31 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun test(a: Int) { diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.fir.kt deleted file mode 100644 index 1c12596f99a..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -val flag = true - -// type of lambda was checked by txt -val a = l@ { // () -> Any - if (flag) return@l 4 - return@l Unit -} - -val b = l@ { // () -> Any - if (flag) return@l Unit - 5 -} - -val c = l@ { // () -> Unit - if (flag) return@l Unit -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt index 1c12596f99a..ac3603bc3a4 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnWithExplicitUnit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val flag = true // type of lambda was checked by txt diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.fir.kt deleted file mode 100644 index 1ee85944f8b..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE - -interface A -interface B: A -interface C: A - - -fun test(a: C, b: B) { - val x = run f@{ - if (a != b) return@f a - b - } - checkSubtype(x) -} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt index 1ee85944f8b..d3a167e1d65 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/MixedReturnsFromLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface A diff --git a/compiler/testData/diagnostics/tests/functionLiterals/returnNull.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/returnNull.fir.kt deleted file mode 100644 index a8d7942f421..00000000000 --- a/compiler/testData/diagnostics/tests/functionLiterals/returnNull.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -package m - -interface Element - -fun test(handlers: MapUnit>) { - - handlers.getOrElse("name", { null }) -} - -fun Map.getOrElse(key: K, defaultValue: ()-> V) : V = throw Exception("$key $defaultValue") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/returnNull.kt b/compiler/testData/diagnostics/tests/functionLiterals/returnNull.kt index a8d7942f421..7633409ab2f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/returnNull.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/returnNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package m interface Element diff --git a/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.fir.kt b/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.fir.kt deleted file mode 100644 index f4fee390b7f..00000000000 --- a/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: java/util/Collection.java -package java.util; - -public class Collection { - public void foo() {} -} - -// FILE: test/Usage.java -package test; - -import java.util.*; - -public class Usage { - void foo(Collection c) { - c.foo(); - } -} - -// FILE: Kotlin.kt -package test - -fun foo(u: Usage) { - u.foo(null) -} diff --git a/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.kt b/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.kt index f4fee390b7f..8d61d539e29 100644 --- a/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.kt +++ b/compiler/testData/diagnostics/tests/generics/PseudoRawTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // FILE: java/util/Collection.java package java.util; diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.fir.kt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.fir.kt deleted file mode 100644 index 4108d6dc3e6..00000000000 --- a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// NI_EXPECTED_FILE - -interface In - -class En : In -class A : In -fun select(x: T, y: T): T = x ?: y - -// Return type should be In<*> nor In -fun foobar(e: En<*>) = select(A(), e) diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt index 4108d6dc3e6..6f355140652 100644 --- a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt +++ b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // NI_EXPECTED_FILE interface In diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.fir.kt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.fir.kt deleted file mode 100644 index 89a3999ae58..00000000000 --- a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// NI_EXPECTED_FILE - -interface In -class A : In -class B : In -fun select(x: T, y: T) = x ?: y - -// Return type should be In<*> nor In -fun foobar(a: A, b: B) = select(a, b) diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt index 89a3999ae58..3955a1ca307 100644 --- a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt +++ b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // NI_EXPECTED_FILE interface In diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt deleted file mode 100644 index 22600b275a6..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -class A { - fun foo() { - val q = object { - open inner class B - inner class C : B() - - // No WRONG_NUMBER_OF_TYPE_ARGUMENTS should be reported on these types - val x: B = B() - val y: C = C() - } - - q.x - q.y - } -} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt index 22600b275a6..470b1d33a08 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromOuterClassInObjectLiteral.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { fun foo() { val q = object { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.fir.kt deleted file mode 100644 index 64d4139d014..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -open class Super { - inner open class Inner { - } -} - -class Sub : Super() { - // TODO: it would be nice to have a possibility to omit explicit type argument in supertype - inner class SubInner : Super.Inner() {} -} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt index 64d4139d014..392e4585a0b 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Super { inner open class Inner { } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.fir.kt deleted file mode 100644 index 9d96d736e46..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -open class Super { - inner open class Inner { - } -} - -class Sub : Super() { - inner class SubInner : Super.Inner { - constructor() - constructor(x: Int) : super() {} - } -} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt index 9d96d736e46..96d9191c54b 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerSuperCallSecondary.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER open class Super { inner open class Inner { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.fir.kt deleted file mode 100644 index 795e8235a6c..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -open class Super { - inner open class Inner { - open fun getOuter(): Super = throw UnsupportedOperationException() - } -} - -class Sub(): Super() { - inner class SubInner : Super.Inner() { // 'Inner' is unresolved - // Also, T1 is not resolved to anything, and not marked as resolved - init { - val x: Super.Inner = this // T1 is not resolved to anything - } - - override fun getOuter(): Sub = throw UnsupportedOperationException() - } -} diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt index 795e8235a6c..e7ec070e349 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/kt3357.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE open class Super { diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.fir.kt deleted file mode 100644 index 02585cbc7cd..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -interface T { - fun f() : E = null!! -} -open class A() { - inner class B() : T {} -} - -fun test() { - val a = A() - val b : A.B = a.B() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.kt index 02585cbc7cd..e42ed031d4a 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/kt408.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE interface T { fun f() : E = null!! diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.fir.kt deleted file mode 100644 index e155df657c2..00000000000 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER - -class Outer { - inner class Inner { - fun foo() = this - fun baz(): Inner = this - } - - fun bar() = Inner() - - // Should be unsafe variance error here - fun set(inner: Inner) {} -} - -fun factoryString(): Outer.Inner = null!! - -fun infer(x: T): Outer.Inner = null!! -val inferred = infer("") - -fun main() { - val outer = Outer() - - checkSubtype.Inner>(outer.bar()) - checkSubtype.Inner>(outer.Inner()) - checkSubtype.Inner>(outer.bar()) - checkSubtype.Inner>(outer.Inner()) - - checkSubtype.Inner>(outer.bar()) - checkSubtype.Inner>(outer.Inner()) - - outer.set(outer.bar()) - outer.set(outer.Inner()) - - val x: Outer.Inner = factoryString() - outer.set(x) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt index e155df657c2..7f1c07a4743 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/generics/kt1575-Class.fir.kt b/compiler/testData/diagnostics/tests/generics/kt1575-Class.fir.kt deleted file mode 100644 index 87a3d632526..00000000000 --- a/compiler/testData/diagnostics/tests/generics/kt1575-Class.fir.kt +++ /dev/null @@ -1 +0,0 @@ -class C> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/kt1575-Class.kt b/compiler/testData/diagnostics/tests/generics/kt1575-Class.kt index 87a3d632526..df69c6d766a 100644 --- a/compiler/testData/diagnostics/tests/generics/kt1575-Class.kt +++ b/compiler/testData/diagnostics/tests/generics/kt1575-Class.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL class C> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/kt1575-Function.fir.kt b/compiler/testData/diagnostics/tests/generics/kt1575-Function.fir.kt deleted file mode 100644 index 58a6f6bc1fa..00000000000 --- a/compiler/testData/diagnostics/tests/generics/kt1575-Function.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -class C -fun > foo() {} diff --git a/compiler/testData/diagnostics/tests/generics/kt1575-Function.kt b/compiler/testData/diagnostics/tests/generics/kt1575-Function.kt index 58a6f6bc1fa..634ecd5f267 100644 --- a/compiler/testData/diagnostics/tests/generics/kt1575-Function.kt +++ b/compiler/testData/diagnostics/tests/generics/kt1575-Function.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL class C fun > foo() {} diff --git a/compiler/testData/diagnostics/tests/generics/kt9203_1.fir.kt b/compiler/testData/diagnostics/tests/generics/kt9203_1.fir.kt deleted file mode 100644 index 369d4f017d6..00000000000 --- a/compiler/testData/diagnostics/tests/generics/kt9203_1.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -public interface Collector - -class A { - fun foo(): T = null!! -} - -public fun toList(): Collector> = null!! - -interface Stream { - public fun collect(collector: Collector): R -} -fun stream(): Stream = null!! - -fun main() { - val stream: Stream = stream() - val xs = stream.collect(toList()) - xs.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/kt9203_1.kt b/compiler/testData/diagnostics/tests/generics/kt9203_1.kt index 369d4f017d6..765392e3d7e 100644 --- a/compiler/testData/diagnostics/tests/generics/kt9203_1.kt +++ b/compiler/testData/diagnostics/tests/generics/kt9203_1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public interface Collector class A { diff --git a/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.fir.kt deleted file mode 100644 index fe61ad8e7a8..00000000000 --- a/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: First.java - -public class First { - public static void bind(First first) {} -} - -// FILE: SubFirst.java - -public class SubFirst extends First {} - -// FILE: test.kt - -interface Sample - -fun test(s: SubFirst<*>) { - First.bind(s) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.kt b/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.kt index fe61ad8e7a8..5123105f54c 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/capturedTypeWithPlatformSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: First.java public class First { diff --git a/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.fir.kt deleted file mode 100644 index c2f2f51f2ac..00000000000 --- a/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: JClass.java - -public class JClass { - public void foo(Key key, K value) {} -} - -// FILE: test.kt - -class Key - -fun select(x: S, y: S): S = x - -fun setValue(key: Key, value: T, j: JClass) { - j.foo(key, select(value, null)) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.kt b/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.kt index c2f2f51f2ac..96cfd0b531a 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/correctSubstitutionForIncorporationConstraint.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: JClass.java diff --git a/compiler/testData/diagnostics/tests/generics/nullability/kt25182.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.fir.kt deleted file mode 100644 index 3ed6a5ebf86..00000000000 --- a/compiler/testData/diagnostics/tests/generics/nullability/kt25182.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -abstract class Expr - -class Sum(val e: Expr) : Expr() - -private fun times(e: Expr, element: V): Expr = TODO() - -private fun foo(e: Expr) {} - -fun test(intExpression: Expr) { - foo(Sum(times(intExpression, 42))) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt index 3ed6a5ebf86..337c99428ff 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/kt25182.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.fir.kt deleted file mode 100644 index a200e8f6eee..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class A { - fun foo() = 1 -} - -interface B - -public fun E.bar() : A = null!! - -fun baz(x: B) { - x.bar().foo() -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.kt index a200e8f6eee..2df8ecd9581 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/extensionResultSubstitution.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class A { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.fir.kt deleted file mode 100644 index 75900129d50..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -// !CHECK_TYPE - -// FILE: Clazz.java -public class Clazz { - public java.util.Collection foo() { return null; } -} - -// FILE: main.kt - -public fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean) {} - -fun test(clazz: Clazz) { - val result = java.util.ArrayList() - clazz.foo().filterTo(result) { x -> true } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.kt index 75900129d50..8039a679418 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/flexibleProjectedScope.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.fir.kt deleted file mode 100644 index 28aa35be026..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class A -fun A.foo(): Collection = null!! - -fun main(a: A<*>, a1: A) { - // see KT-9571 - for (i in a.foo()) { } - for (i: Any? in a.foo()) { } - - for (i in a1.foo()) { } - for (i: CharSequence in a1.foo()) { } -} diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.kt index 28aa35be026..ce72d3dca97 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/iterateOnExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A fun A.foo(): Collection = null!! diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.fir.kt deleted file mode 100644 index 0873de21fd3..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -interface Subscriber - -interface Observable { - fun subscribe(s: Subscriber) -} - -fun foo(o: Observable, y: Subscriber) = o.subscribe(y) // type safe - diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.kt index 0873de21fd3..bb0373b17e0 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/kt8647.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Subscriber interface Observable { diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.fir.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.fir.kt deleted file mode 100644 index 80c221107c3..00000000000 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// See KT-7296 -interface Out -interface B : Out> - -fun foo(x : B<*>) { - bar1(x) - bar2(x) -} - -fun bar1(x : Out>) { } -fun bar2(x : Out<*>) { } diff --git a/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.kt b/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.kt index 80c221107c3..fb81ba62ef6 100644 --- a/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.kt +++ b/compiler/testData/diagnostics/tests/generics/projectionsScope/recursiveUpperBoundStarOut.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // See KT-7296 interface Out diff --git a/compiler/testData/diagnostics/tests/generics/recursive.fir.kt b/compiler/testData/diagnostics/tests/generics/recursive.fir.kt deleted file mode 100644 index 690c18b7f65..00000000000 --- a/compiler/testData/diagnostics/tests/generics/recursive.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE - -interface Rec -class A : Rec -class B : Rec - -fun test(a: A, b: B, c: Boolean) { - var ab = if (c) a else b - ab = a - ab = b -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/recursive.kt b/compiler/testData/diagnostics/tests/generics/recursive.kt index 690c18b7f65..f128ee41f33 100644 --- a/compiler/testData/diagnostics/tests/generics/recursive.kt +++ b/compiler/testData/diagnostics/tests/generics/recursive.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE interface Rec diff --git a/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.fir.kt b/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.fir.kt deleted file mode 100644 index 543e3f9646b..00000000000 --- a/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// Tests that generic bounds in the object supertype are resolved prior to the supertype itself - -object O : Tr> - -interface Tr - -class V diff --git a/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.kt b/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.kt index 543e3f9646b..5e781275fbc 100644 --- a/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.kt +++ b/compiler/testData/diagnostics/tests/generics/resolveGenericBoundsBeforeSupertypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Tests that generic bounds in the object supertype are resolved prior to the supertype itself object O : Tr> diff --git a/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.fir.kt b/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.fir.kt deleted file mode 100644 index 319b5bc8737..00000000000 --- a/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -fun foo(x: R, y: String) {} -fun foo(x: R, y: R) { - foo(x, "") // ok, resolved foo(x: R, y: String) - foo(x, "") // ok, foo(x: R, y: String) - foo(x, x) // ok, resolved foo(x: R, y: R) - foo(x, x) // ok, resolved foo(x: R, y: R) -} - -class Q(x: R) { - fun foo() { - Q("") - } -} -fun Q(x: String) {} diff --git a/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.kt b/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.kt index 319b5bc8737..88106c2e2f9 100644 --- a/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.kt +++ b/compiler/testData/diagnostics/tests/generics/sameTypeParameterUse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo(x: R, y: String) {} fun foo(x: R, y: R) { diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.fir.kt b/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.fir.kt deleted file mode 100644 index 17f1e033cf6..00000000000 --- a/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class A> -fun > foo() {} -class B> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.kt b/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.kt index 17f1e033cf6..256f6c49b96 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/checkBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A> fun > foo() {} class B> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.fir.kt b/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.fir.kt deleted file mode 100644 index 5e09012121d..00000000000 --- a/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: p/Base.java - -package p; - -import java.util.*; - -public class Base { - void coll(Collection r) {} -} - -// FILE: k.kt -package p - -class Derived: p.Base() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.kt b/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.kt index 5e09012121d..fdc78b0bd26 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/collectionInheritedFromJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/Base.java package p; diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.fir.kt b/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.fir.kt deleted file mode 100644 index caf29f2990a..00000000000 --- a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: p/Base.java - -package p; - -public class Base { - void foo(R r) {} -} - -// FILE: k.kt -package p - -class R> - -class Derived: p.Base() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.kt b/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.kt index caf29f2990a..360f08bc5a3 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/Base.java package p; diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.fir.kt b/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.fir.kt deleted file mode 100644 index bcf02a0e721..00000000000 --- a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class R> - -open class Base { - fun foo(r: R<*>) {} -} - -class Derived: Base() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.kt b/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.kt index bcf02a0e721..ad003dd76ab 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.kt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/inheritedFromKotlin.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class R> diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.fir.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.fir.kt deleted file mode 100644 index b201042e828..00000000000 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -inline fun foo() {} - -inline fun bar() { - foo>() - foo>() -} - -inline fun baz(x: E) {} - -fun test(x: Array, y: Array<*>) { - foo>() - foo>() - foo>() - foo>() - - foo>() - foo>() - - baz(x) - baz(y) -} - diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt index b201042e828..429d4448263 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/GenericAsReifiedArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER inline fun foo() {} diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.fir.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.fir.kt deleted file mode 100644 index d8c35c93cd3..00000000000 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -inline fun bar(x: T1, y: T2): T2 = y -inline fun foo(z: R): R = bar(1, z) - -fun box() { - foo("abc") -} diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.kt index d8c35c93cd3..3d7f1f799c6 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InlineableReified.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER inline fun bar(x: T1, y: T2): T2 = y diff --git a/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.fir.kt b/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.fir.kt deleted file mode 100644 index 8b2c0dd0003..00000000000 --- a/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: a.kt -package a - -open class X - -// FILE: b.kt -package b - -class X - -// FILE: c.kt -package c - -import a.X -import b.* - -class Y : X() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.kt b/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.kt index 8b2c0dd0003..698cd49cce8 100644 --- a/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.kt +++ b/compiler/testData/diagnostics/tests/imports/AllUnderImportsLessPriority.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.fir.kt b/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.fir.kt deleted file mode 100644 index 065aaebd11e..00000000000 --- a/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: a.kt -package a - -var X: Int = 1 - -// FILE: b.kt -package b - -var X: String = "" - -// FILE: c.kt -package c - -import a.X -import b.* - -fun foo() { - X = 1 -} diff --git a/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt b/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt index 065aaebd11e..92bc4db5eaa 100644 --- a/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt +++ b/compiler/testData/diagnostics/tests/imports/AllUnderImportsSamePriorityForProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/ClassClash.fir.kt b/compiler/testData/diagnostics/tests/imports/ClassClash.fir.kt deleted file mode 100644 index 810aea57d1b..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ClassClash.fir.kt +++ /dev/null @@ -1,81 +0,0 @@ -// MODULE: m1 -// FILE: a.kt -package a - -class B { - fun m1() {} -} - -// MODULE: m2 -// FILE: b.kt -package a - -class B { - fun m2() {} -} - -// MODULE: m3(m1, m2) -// FILE: c.kt -import a.B - -fun test(b: B) { - b.m1() - b.m2() - - val b_: B = B() - b_.m1() - - val b_1: a.B = B() - b_1.m1() - - val b_2: B = a.B() - b_2.m1() - - val b_3: B = B() - b_3.m1() - - val b_4: B = a.B() - b_4.m1() -} - - -//----------------------------TOP LEVEL--------------------- -// MODULE: top_m1 -// FILE: top_a.kt -class B { - fun m1() {} -} - -// MODULE: top_m2 -// FILE: top_b.kt -class B { - fun m2() {} -} - -// MODULE: top_m3(top_m1, top_m2) -// FILE: top_c.kt -import B - -fun test(b: B) { - b.m1() - b.m2() - - val b_: B = B() - b_.m1() - - val b_2 = B() - b_2.m1() -} - -// FILE: top_d.kt - -fun test2(b: B) { - b.m1() - b.m2() - - val b_: B = B() - b_.m1() - - val b_2 = B() - b_2.m1() -} diff --git a/compiler/testData/diagnostics/tests/imports/ClassClash.kt b/compiler/testData/diagnostics/tests/imports/ClassClash.kt index 810aea57d1b..10085abcb72 100644 --- a/compiler/testData/diagnostics/tests/imports/ClassClash.kt +++ b/compiler/testData/diagnostics/tests/imports/ClassClash.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.fir.kt b/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.fir.kt deleted file mode 100644 index a9fe67145a4..00000000000 --- a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: a.kt -package a - -class X - -// FILE: b.kt -package b - -open class X - -// FILE: b1.kt -package b - -import a.* - -class Y : X() // class from the current package should take priority diff --git a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.kt b/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.kt index a9fe67145a4..3eed7579d96 100644 --- a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.kt +++ b/compiler/testData/diagnostics/tests/imports/CurrentPackageAndAllUnderImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.fir.kt b/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.fir.kt deleted file mode 100644 index 75a66d31fdb..00000000000 --- a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: a.kt -package a - -open class Y - -// FILE: b.kt -package b - -class X - -// FILE: b1.kt -package b - -import a.Y as X - -class Y : X() // class from explicit import should take priority diff --git a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.kt b/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.kt index 75a66d31fdb..87d8a10785a 100644 --- a/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.kt +++ b/compiler/testData/diagnostics/tests/imports/CurrentPackageAndExplicitImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.fir.kt deleted file mode 100644 index 3f3a6226ebc..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// ResolveSession.resolveToDescriptor used to crash on such code, so we just check that it's ok now -import kotlin.Double -import kotlin.collections.List -import kotlin.arrayOfNulls - -class List {} - -fun arrayOfNulls(){} -val arrayOfNulls: Int = 0 diff --git a/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt b/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt index 3f3a6226ebc..b762916232b 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportHidingDefinitionInTheSameFile.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // ResolveSession.resolveToDescriptor used to crash on such code, so we just check that it's ok now import kotlin.Double import kotlin.collections.List diff --git a/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.fir.kt deleted file mode 100644 index f5d156292aa..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -package a - -import a.A.Nested as X - -interface A { - class Nested - - val a: Nested - val b: X -} diff --git a/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.kt b/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.kt index f5d156292aa..a097366bbb4 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportNestedWithDifferentName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package a import a.A.Nested as X diff --git a/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.fir.kt deleted file mode 100644 index 677f6f9f383..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -//FILE:a.kt -package a - -// no error is reported -import b.a - -fun foo() = a - -//FILE:b.kt -package b - -object a {} diff --git a/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.kt b/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.kt index 677f6f9f383..7248a15f1a3 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportObjectHidesCurrentPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.fir.kt deleted file mode 100644 index d93874eb976..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// FILE: b.kt -// KT-355 Resolve imports after all symbols are built - -package a - import b.* - val x : X = X() - -// FILE: b.kt -package b - class X() { - - } - -// FILE: b.kt -package c - import d.X - val x : X = X() - -// FILE: b.kt -package d - class X() { - - } diff --git a/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.kt b/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.kt index d93874eb976..ea887baae85 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportResolutionOrder.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: b.kt // KT-355 Resolve imports after all symbols are built diff --git a/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.fir.kt deleted file mode 100644 index 75aba1ca39c..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: a.kt - -package weatherForecast - -fun weatherToday() = "snow" - -// FILE: b.kt - -package myApp - -import weatherForecast.weatherToday -import weatherForecast.weatherToday - -fun needUmbrella() = weatherToday() == "rain" diff --git a/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.kt b/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.kt index 75aba1ca39c..b2ea94fe131 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportTwoTimes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package weatherForecast diff --git a/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.fir.kt deleted file mode 100644 index 83e6d3f3e28..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: a.kt - -package weatherForecast - -fun weatherToday() = "snow" - -// FILE: b.kt - -package myApp - -import weatherForecast.* -import weatherForecast.* - -fun needUmbrella() = weatherToday() == "rain" diff --git a/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.kt b/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.kt index 83e6d3f3e28..42fb9472da5 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportTwoTimesStar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package weatherForecast diff --git a/compiler/testData/diagnostics/tests/imports/ImportsConflicting.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportsConflicting.fir.kt deleted file mode 100644 index 32368bda9c8..00000000000 --- a/compiler/testData/diagnostics/tests/imports/ImportsConflicting.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -//FILE:a.kt -package a - -import b.foo -import c.foo // TODO: need warning here - -//FILE:b.kt -package b - -fun foo() = 2 - -//FILE:c.kt -package c - -fun foo() = 1 diff --git a/compiler/testData/diagnostics/tests/imports/ImportsConflicting.kt b/compiler/testData/diagnostics/tests/imports/ImportsConflicting.kt index 32368bda9c8..2963f547c3a 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportsConflicting.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportsConflicting.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/PackageVsClass.fir.kt b/compiler/testData/diagnostics/tests/imports/PackageVsClass.fir.kt deleted file mode 100644 index a333f14b679..00000000000 --- a/compiler/testData/diagnostics/tests/imports/PackageVsClass.fir.kt +++ /dev/null @@ -1,152 +0,0 @@ -// MODULE: m1 -// FILE: a.kt -package a.b - -fun ab_fun() {} - -class c { - fun ab_c() {} - - class d { - fun ab_cd() {} - } -} - -// MODULE: m2 -// FILE: b.kt -package a - -fun a_fun() {} - -class b { - fun a_b() {} - - class c { - fun a_bc() {} - } -} - -// MODULE: m3(m1, m2) -// FILE: c.kt -import a.a_fun -import a.b - -import a.b.ab_fun -import a.b.c - -fun test(a_b: b) { - a_b.a_b() - - val a_bc: b.c = b.c() - a_bc.a_bc() - - val a_bc2 = b.c() - a_bc2.a_bc() - - a_fun() -} - -fun test2(ab_c: c) { - ab_c.ab_c() - - val ab_cd: c.d = c.d() - ab_cd.ab_cd() - - val ab_cd2 = c.d() - ab_cd2.ab_cd() - - ab_fun() -} - -// FILE: d.kt -package a - -import a.b.ab_fun -import a.b.c - -fun test(a_b: b) { - a_b.a_b() - - val a_bc: b.c = b.c() - a_bc.a_bc() - - val a_bc2 = b.c() - a_bc2.a_bc() - - a_fun() -} - -fun test2(ab_c: c) { - ab_c.ab_c() - - val ab_cd: c.d = c.d() - ab_cd.ab_cd() - - val ab_cd2 = c.d() - ab_cd2.ab_cd() - - ab_fun() -} - -//---- Changed dependence order -// MODULE: m4(m2, m1) -// FILE: c.kt -import a.a_fun -import a.b - -import a.b.ab_fun -import a.b.c - -fun test(a_b: b) { - a_b.a_b() - - val a_bc: b.c = b.c() - a_bc.a_bc() - - val a_bc2 = b.c() - a_bc2.a_bc() - - a_fun() -} - -fun test2(ab_c: c) { - ab_c.ab_c() - - val ab_cd: c.d = c.d() - ab_cd.ab_cd() - - val ab_cd2 = c.d() - ab_cd2.ab_cd() - - ab_fun() -} - -// FILE: d.kt -package a - -import a.b.ab_fun -import a.b.c - -fun test(a_b: b) { - a_b.a_b() - - val a_bc: b.c = b.c() - a_bc.a_bc() - - val a_bc2 = b.c() - a_bc2.a_bc() - - a_fun() -} - -fun test2(ab_c: c) { - ab_c.ab_c() - - val ab_cd: c.d = c.d() - ab_cd.ab_cd() - - val ab_cd2 = c.d() - ab_cd2.ab_cd() - - ab_fun() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/PackageVsClass.kt b/compiler/testData/diagnostics/tests/imports/PackageVsClass.kt index a333f14b679..29d26e2bf97 100644 --- a/compiler/testData/diagnostics/tests/imports/PackageVsClass.kt +++ b/compiler/testData/diagnostics/tests/imports/PackageVsClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt package a.b diff --git a/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.fir.kt b/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.fir.kt deleted file mode 100644 index 4317d323edc..00000000000 --- a/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.fir.kt +++ /dev/null @@ -1,68 +0,0 @@ -// MODULE: m1 -// FILE: a.kt -package a - -fun a_fun() {} - -class b { - fun a_b() {} - - class c { - fun a_bc() {} - } -} - -// MODULE: m2 -// FILE: b.kt -fun _fun() {} - -class a { - fun _a() {} - - class b { - fun _ab() {} - } -} - -// MODULE: m3(m1, m2) -// FILE: c.kt -import a.a_fun -import a.b - -fun test(a_b: b) { - a_b.a_b() - - val a_bc: b.c = b.c() - a_bc.a_bc() - - a_fun() -} - -// FILE: d.kt -fun test2(_a: a) { - _a._a() - - val _ab: a.b = a.b() - _ab._ab() - - val _ab2 = a.b() - _ab2._ab() - - _fun() -} - -// FILE: e.kt -import a -import _fun - -fun test3(_a: a) { - _a._a() - - val _ab: a.b = a.b() - _ab._ab() - - val _ab2 = a.b() - _ab2._ab() - - _fun() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.kt b/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.kt index 4317d323edc..da899367f8f 100644 --- a/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.kt +++ b/compiler/testData/diagnostics/tests/imports/TopLevelClassVsPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.fir.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.fir.kt deleted file mode 100644 index 3fd65fd6d42..00000000000 --- a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: importFunctionWithAllUnderImport.kt -package test - -import testOther.* - -class B: A() -val inferTypeFromImportedFun = testFun() - -// FILE: importFunctionWithAllUnderImportOther.kt -package testOther - -open class A -fun testFun() = 1 diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt index 3fd65fd6d42..63dfa97da2d 100644 --- a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: importFunctionWithAllUnderImport.kt package test diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.fir.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.fir.kt deleted file mode 100644 index d5f7005f3bf..00000000000 --- a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -//FILE:mainFile.kt -//---------------------------------------------------------------------------------- -package test - -import testing.other.* -import testing.TestFun - -// Resolve shouldn't be ambiguous -val a = TestFun() - - -//FILE:testing.kt -//---------------------------------------------------------------------------------- -package testing - -class TestFun - -//FILE:testingOther.kt -//---------------------------------------------------------------------------------- -package testing.other - -fun TestFun() = 12 diff --git a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt index d5f7005f3bf..7fe90338231 100644 --- a/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt +++ b/compiler/testData/diagnostics/tests/imports/importFunctionWithAllUnderImportAfterNamedImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:mainFile.kt //---------------------------------------------------------------------------------- package test diff --git a/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.fir.kt deleted file mode 100644 index 28f07365aa7..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -package b - -fun main() { - var ints : Array = arrayOfNulls(31) - - ints[0] = 4; ints[11] = 5; ints[2] =7 - for(i in 0..ints.size) - ints[i -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.kt b/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.kt index 28f07365aa7..1a9b4205664 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/arrayBracketsRange.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package b fun main() { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.fir.kt deleted file mode 100644 index 1ddc5f31308..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -fun foo(x: Any?) { - x ?: - val foo = 1 - - x ?: - fun bar() = 2 - - val res: String.() -> Int = null ?: - fun String.() = 3 -} - -class A { - val z = null ?: - val x = 4 - - val y = null ?: - fun baz() = 5 - - val q = null ?: - fun String.() = 6 -} diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.kt index 1ddc5f31308..af9a01a6cdd 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/declarationAfterIncompleteElvis.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE fun foo(x: Any?) { x ?: diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.fir.kt deleted file mode 100644 index b397ef72dc6..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.fir.kt +++ /dev/null @@ -1 +0,0 @@ -fun foo() = diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.kt index b397ef72dc6..fcc54aefa2e 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funEquals.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun foo() = diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.fir.kt deleted file mode 100644 index f773d983a7d..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.fir.kt +++ /dev/null @@ -1 +0,0 @@ -fun \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.kt index f773d983a7d..14d88f66c20 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/funKeyword.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.fir.kt deleted file mode 100644 index ef56e1ca39a..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -enum class E { - A, - B, - C -} - -fun foo() { - val e = E. -} - - diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.kt index ef56e1ca39a..e135faf9ec4 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteEnumReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { A, B, diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.fir.kt deleted file mode 100644 index f64b8ae0cff..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -package c - -val i = diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.kt index f64b8ae0cff..7fddb9de145 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteVal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package c val i = diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.fir.kt deleted file mode 100644 index 400320515ef..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -package c - -val i : String get() = \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.kt index 400320515ef..23ab57ef451 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/incompleteValWithAccessor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package c val i : String get() = \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.fir.kt deleted file mode 100644 index 054ff973a76..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -// VAL -class A( - val - val x: Int, - val - private val z: Int, - val -) - -val -fun foo() {} - -class B { - val - fun foo() {} - - fun bar() { - val - fun foo() {} - } -} - -// VAR -class C( - var - val x: Int, - var - private val z: Int, - var -) - -var -fun baz() {} - -class D { - var - fun foo() {} - - fun bar() { - var - fun foo() {} - } -} diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.kt index 054ff973a76..f8e10278258 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valNoName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // VAL class A( val diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.fir.kt deleted file mode 100644 index 0b315e01230..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -abstract class A { - private val - // private is parsed as val's identifier - private fun foo1() { - } - - private val - protected abstract fun foo2() - - private val - fun foo3() { - } - - private val private fun foo() {} -} diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.kt index 0b315e01230..98450d4bb40 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/valWithNoNameBeforeNextDeclarationWithModifiers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class A { private val // private is parsed as val's identifier diff --git a/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.fir.kt deleted file mode 100644 index 6c51937918d..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: A.java - -public class A { - public A getSuperA() { return null; } -} - -// FILE: main.kt - -fun foo(x: T?, func: (T) -> T?) {} - -fun test(a: A<*>) { - foo(a) { it.superA } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.kt b/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.kt index 6c51937918d..10133ec4e08 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.fir.kt deleted file mode 100644 index f5a9613e048..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference - -import kotlin.reflect.KClass - -typealias MyString = String - -fun test(k: KClass) { - k::class.java -} - -@Suppress("UPPER_BOUND_VIOLATED") -public val KClass.java: Class get() = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.kt index f5a9613e048..06e76c5b256 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithInnerTypealias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference import kotlin.reflect.KClass diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.fir.kt deleted file mode 100644 index bd4e8035bb6..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun takeCovArray(a: Array) {} -fun takeInArray(a: Array) {} - -fun foo(): Array = TODO() -fun bar(): Array = TODO() - -fun id(x: X): X = x -fun arrayInId(z: Array): Array = z -fun arrayOutId(z: Array): Array = z - -fun test() { - takeCovArray(foo()) - takeInArray(bar()) - - takeCovArray(id(foo())) - takeInArray(id(bar())) - - takeCovArray(arrayOutId(foo())) - takeInArray(arrayInId(bar())) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.kt index bd4e8035bb6..45f46f694d1 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/capturedTypeWithTypeVariableSubtyping.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun takeCovArray(a: Array) {} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.fir.kt deleted file mode 100644 index 7d205289439..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Inv1 - -operator fun Inv1.invoke(action: T.() -> Unit) {} - -fun test(inv: Inv1) { - inv { } - inv.invoke { } -} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.kt index 7d205289439..5c07bc7b295 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/invokeCallWithCapturedReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Inv1 diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.fir.kt deleted file mode 100644 index 3096c1eefca..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface CollectorMock - -interface StreamMock { - fun collect(collector: CollectorMock): R -} - -fun accept(s: T) {} -fun ofK(t: String): StreamMock = TODO() -fun toSetK(): CollectorMock<*, T> = TODO() - -class KotlinCollectionUser1 { - fun use() { - accept(ofK("").collect(toSetK())) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.kt index 3096c1eefca..5b6f0c61a5c 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt25302.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.fir.kt deleted file mode 100644 index 7b4046ca94a..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class Bar - -fun Bar.foo() = 42 - -object MyObject { - fun foo(bar: Bar) = bar.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.kt index 7b4046ca94a..f3b57003071 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/notApproximateWhenCopyDescriptors.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Bar fun Bar.foo() = 42 diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.fir.kt deleted file mode 100644 index bfee91bf948..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// See KT-14453 -val KClass1.primaryConstructor: KFunction1? get() = null!! - -interface KClass1 -interface KFunction1 -fun f(type: KClass1<*>): KFunction1? = - // What happens here: - // 1. Create captured type for type argument T (it's built upon star-projection from `KClass<*>` that's argument is <: Any) - // 2. Approximate resulting descriptor, now it 'KClass1<*>.primaryConstructor: KFunction1<*>' - // Note that star-projection in 'KFunction1<*>' is obtained from KClass and its `projectionType` is Any (not-nullable). - // Of course that situation is already strange - // 3. When checking subtyping after call completion we get that 'KFunction1<*>' is not a subtype of 'KFunction1' in new type checker. - // The answer is correct, but this old type checker used `projectionType` for this and it was resulting in KFunction1<*> <: KFunction1 - // - // So to fix the issue we use 'out starProjectionType' instead of star-projection itself in approximation - // Note that in new inference there should be no approximation for IN-position types (they must remain captured) - type.primaryConstructor diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.kt index bfee91bf948..88705b96c15 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/starProjectionRegression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-14453 val KClass1.primaryConstructor: KFunction1? get() = null!! diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.fir.kt deleted file mode 100644 index 215df989c84..00000000000 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Inv2 - -fun createInv(): Inv2<*, K> = TODO() - -fun foo(i: Inv2) {} - -fun foo() { - foo(createInv()) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.kt index 215df989c84..0e5be6e7bec 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/topLevelCapturingInsideReturnType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Inv2 diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.fir.kt deleted file mode 100644 index 07288febcce..00000000000 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun coerceToUnit(f: () -> Unit) {} - -class Inv - -fun builder(block: Inv.() -> Unit): K = TODO() - -fun test() { - coerceToUnit { - builder {} - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.kt index 07288febcce..ec23f929322 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionToUnitForLastLambdaInLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun coerceToUnit(f: () -> Unit) {} diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.fir.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.fir.kt deleted file mode 100644 index d676c39e012..00000000000 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_VARIABLE - -fun foo() { - val f = myRun { - 123 - } -} - -fun myRun(block: () -> R): R = block() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.kt b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.kt index d676c39e012..e2ccf82b620 100644 --- a/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.kt +++ b/compiler/testData/diagnostics/tests/inference/coercionToUnit/coercionWithExplicitTypeArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.fir.kt deleted file mode 100644 index 72afc526eaf..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun test(f: (T) -> T?) { - doFun(f.ext()) -} - -fun Function1.ext(): Function0 = throw Exception() -fun doFun(f: () -> R?) = f diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.kt index 72afc526eaf..e6ca513bfb5 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/boundOnNullableVariable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test(f: (T) -> T?) { doFun(f.ext()) } diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.fir.kt deleted file mode 100644 index 56b7f5657a7..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import java.util.* - -fun test(list: ArrayList, comparatorFun: (Int, Int) -> Int) { - sort(list, Comparator(comparatorFun)) -} - - -public fun sort(list: List, c: Comparator) { -} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.kt index 56b7f5657a7..7741d8fa047 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/dontCaptureTypeVariable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import java.util.* diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.fir.kt deleted file mode 100644 index 1e3724fee47..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class GenericClass - -public fun GenericClass>.foo() {} - -public fun bar(t: T, ext: GenericClass.() -> Unit) {} - -fun test() { - bar(mapOf(2 to 3)) { foo() } -} - -// from library -class Pair -fun mapOf(keyValuePair: Pair): Map = throw Exception() -infix fun A.to(that: B): Pair = throw Exception() - diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.kt index 1e3724fee47..dc4498d5766 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/fixVariablesInRightOrder.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class GenericClass diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.fir.kt deleted file mode 100644 index dc882ec4d8d..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class GenericClass(val value: T) { - public fun

foo(extension: T.() -> P) {} -} - -public fun GenericClass>.bar() { - foo( { listIterator() }) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.kt index dc882ec4d8d..132bb4421c2 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/genericCandidateInGenericClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class GenericClass(val value: T) { diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.fir.kt deleted file mode 100644 index 7ab48bdff17..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import java.util.* - -interface Foo -class Bar(val list: MutableList) {} - -fun test(map: MutableMap>) { - - map.getOrPut1("", { Bar(ArrayList()) }) -} - -fun MutableMap.getOrPut1(key: K, defaultValue: () -> V): V = throw Exception() diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt index 7ab48bdff17..cf0cc526f04 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import java.util.* diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.fir.kt deleted file mode 100644 index 6477411e023..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// !WITH_NEW_INFERENCE - -open class View - -fun test() { - val target = foo() ?: foo() ?: run {} -} - -fun foo(): T? { - return null -} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt index 6477411e023..599c9042acf 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/kt31969.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.fir.kt deleted file mode 100644 index ad37f1b3559..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.fir.kt +++ /dev/null @@ -1,178 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -val prop = mapOf( - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b"), - to("a", "b") -) - -fun to(a: A, b: B): Pair = TODO() -fun mapOf(vararg pairs: Pair): Map = TODO() - -class Pair \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.kt index ad37f1b3559..1700cd296df 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/manyArgumentsForVararg.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.fir.kt deleted file mode 100644 index fdc80f2c532..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - -class Inv - -fun select(x: K, y: K): K = x - -fun outToOut(x: Inv): Inv = TODO() - -fun test(invOutAny: Inv, invAny: Inv) { - val a: Inv = select(invAny, outToOut(invOutAny)) -} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.kt index fdc80f2c532..facf5eb7746 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/outProjectedTypeToOutProjected.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.fir.kt deleted file mode 100644 index 5dfa6d056e8..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class In -class Out - -class A -class B - -fun select(x: K, y: K): K = x -fun genericIn(x: In) {} -fun genericOut(x: Out) {} - -fun test1(a: In, b: In) { - genericIn(select(a, b)) -} - -fun test2(a: Out, b: Out) { - genericOut(select(a, b)) -} diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt index 5dfa6d056e8..9d313f973af 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/selectFromCovariantAndContravariantTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.fir.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.fir.kt deleted file mode 100644 index c213e5b51a2..00000000000 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun takeLong(i: Long) {} - -fun test() { - takeLong(if (true) 1 else 0) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.kt index c213e5b51a2..c29f64c1151 100644 --- a/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.kt +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/selectIntegerValueTypeFromIf.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt deleted file mode 100644 index 2bf0ecb995a..00000000000 --- a/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun take(fn: () -> List) {} -fun inferFromLambda(fn: () -> L): L = TODO() - -fun materialize(): T = TODO() -fun id(arg: I) = arg - -fun testFunctions() { - take { materialize() } - take(fun() = materialize()) - take(fun(): List = materialize()) - take(fun(): List { - return materialize() - }) -} - -fun testNestedCalls() { - id(inferFromLambda { materialize() }) - id(inferFromLambda(fun() = materialize())) -} diff --git a/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.kt b/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.kt index 2bf0ecb995a..5fc14bebbe2 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/anonymousFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.fir.kt deleted file mode 100644 index 38eb20aa215..00000000000 --- a/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class In(arg: I) -class Out(val prop: O) -class Inv(val prop: T) - -interface Upper -class Lower : Upper - -fun id(arg: K): K = arg - -fun test(lower: Lower) { - id>(Inv(lower)) - id>(In(lower)) - id>(Out(lower)) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.kt b/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.kt index 38eb20aa215..541021b7d45 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/equalityConstraintUpstairs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/completion/kt36233.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/kt36233.fir.kt deleted file mode 100644 index a0c83c074d7..00000000000 --- a/compiler/testData/diagnostics/tests/inference/completion/kt36233.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -USELESS_CAST - -class Inv -class Out - -fun foo(y: K?) = Inv>() -fun test(x: Inv>) {} - -fun main() { - test(foo(null)) // type mismatch - test(foo(1 as Int)) // type mismatch -} diff --git a/compiler/testData/diagnostics/tests/inference/completion/kt36233.kt b/compiler/testData/diagnostics/tests/inference/completion/kt36233.kt index a0c83c074d7..40f0f8741e5 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/kt36233.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/kt36233.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -USELESS_CAST diff --git a/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.fir.kt deleted file mode 100644 index d9f159a0129..00000000000 --- a/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -interface Bound -interface Upper : Bound -class Lower : Upper - -class Inv - -fun makeInv(v: U): Inv = TODO() -fun id(arg: K): K = arg - -fun test(lower: Lower) { - id>(makeInv(lower)) -} diff --git a/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.kt b/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.kt index d9f159a0129..d6f643f55e8 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/transitiveConstraint.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.fir.kt deleted file mode 100644 index 5213966e75c..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface Parent -interface Inv - -object Child : Parent - -fun wrapper(): Inv = TODO() -fun consume(wrapper: Inv) {} - -fun select(x: S, y: S): S = x - -fun error(f: Inv, w: Inv) { - consume(select(f, wrapper())) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.kt b/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.kt index 5213966e75c..755234905d2 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/earlyCompletionForCalls.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface Parent diff --git a/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.fir.kt deleted file mode 100644 index 5daaf882c68..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -interface Box -fun List>.choose(): Box? = TODO() -fun list(): List> = TODO() - -fun f() = list().choose() diff --git a/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.kt b/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.kt index 5daaf882c68..a0ee1ec5711 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/inferTypeFromCapturedStarProjection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Box fun List>.choose(): Box? = TODO() fun list(): List> = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.fir.kt deleted file mode 100644 index d49d4c3a0bc..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -package kt7351 - -interface Node - -interface Source { - fun f() : T -} -fun > S.woo() : T = this.f() - -fun Node.append(block : Source.() -> Unit) { -} - -fun crashMe(node : Node) { - node.append { - woo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.kt index d49d4c3a0bc..37389436fd3 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt7351ConstraintFromUnitExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER package kt7351 diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt7433.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt7433.fir.kt deleted file mode 100644 index 1c9ad2d2e1d..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt7433.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -public inline fun Iterable.reduce1(operation: (S, T) -> S): S = throw Exception() - -fun test(ints: List) { - val f: () -> Unit = { - ints.reduce1 { a, b -> a + b } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/kt7433.kt b/compiler/testData/diagnostics/tests/inference/constraints/kt7433.kt index 1c9ad2d2e1d..0e65319c1cd 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/kt7433.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/kt7433.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE public inline fun Iterable.reduce1(operation: (S, T) -> S): S = throw Exception() diff --git a/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.fir.kt deleted file mode 100644 index de4197dadcf..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun test() { - generateException(Data(1), { Data(it.x + 2) }) -} - -fun generateException(a: T, next: (T) -> T) {} - -class Data(val x: K) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.kt b/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.kt index de4197dadcf..38ccfd75be0 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/operationsOnIntegerValueTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun test() { diff --git a/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.fir.kt deleted file mode 100644 index 730fdd640d8..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// !LANGUAGE: +NewInference - -// FILE: MenuItemBase.java - -public class MenuItemBase, I extends MenuItemBase, S extends SubMenuBase> { - public String getText() { return null; } -} - -// FILE: ContextMenuBase.java - -public class ContextMenuBase, I extends MenuItemBase, S extends SubMenuBase> {} - -// FILE: SubMenuBase.java - -public class SubMenuBase, I extends MenuItemBase, S extends SubMenuBase> {} - -// FILE: test.kt - -fun test(m: MenuItemBase<*, *, *>) { - m.text -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.kt b/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.kt index 730fdd640d8..48bbfd720a7 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/recursiveJavaTypeWithStarProjection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // !LANGUAGE: +NewInference diff --git a/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.fir.kt deleted file mode 100644 index c3add8bad9e..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS -// SKIP_TXT - -// FILE: Test.java -import java.util.Collection; - -public class Test { - static Inv> bar() { - return null; - } -} - -// FILE: main.kt -class Inv - -fun foo(x: R, y: Inv) {} - -fun main() { - val values: List = null as List - /* - * Before the fix, there was type mismatch during checking `Test.bar()` to pass to `foo`: - * Required: Inv> - * Found: Inv<(MutableCollection..Collection?)> - * Constraint `(MutableCollection..Collection?)` from 'Found' (for TypeVariable(R)) has been removed - * during fixation TypeVariable(T) due to the constraint for R contained TypeVariable(T). - * The problem was that TypeVariable(T) wan't substituted due to `containsConstrainingTypeWithoutProjection` optimization. - */ - foo(values, Test.bar()) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.kt b/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.kt index c3add8bad9e..bfba4375374 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/remainConstraintContainingTypeWithoutProjection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS // SKIP_TXT diff --git a/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.fir.kt deleted file mode 100644 index e64a8ec1c4c..00000000000 --- a/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class Foo { - var test: String by refreshOnUpdate("str") - - fun refreshOnUpdate(initialValue: T) = RefreshDelegate(initialValue) - - class RefreshDelegate(initialValue: T?) { - operator fun getValue(thisRef: Foo, property: KProperty<*>): T = TODO() - - operator fun setValue(thisRef: Foo, property: KProperty<*>, value: T) {} - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.kt b/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.kt index e64a8ec1c4c..c083e76aecc 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/wrongApproximationWithDefNotNullTypesAndDelegates.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.fir.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.fir.kt deleted file mode 100644 index ce51ae98727..00000000000 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +ExpectedTypeFromCast - -package pp - -class A { - fun foo(): T = TODO() - - companion object { - fun foo2(): T = TODO() - } -} - -val x = A().foo() as String -val y = A.foo2() as String -val z = pp.A.foo2() as String - diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.kt index ce51ae98727..97d7d6566ae 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastComplexExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ExpectedTypeFromCast package pp diff --git a/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.fir.kt b/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.fir.kt deleted file mode 100644 index dc0f951ef84..00000000000 --- a/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: 1.kt -fun Array.plus(): Array { - val result = Arrays.copyOf(this, 3) - // result type is Array<(out) (S&Any)!>! - return result -} - -// FILE: Arrays.java -public class Arrays { - public static T[] copyOf(T[] original, int newLength) { - return (T[]) null; - } -} diff --git a/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.kt b/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.kt index dc0f951ef84..9593451411e 100644 --- a/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.kt +++ b/compiler/testData/diagnostics/tests/inference/flexibleTypesAsUpperBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: 1.kt fun Array.plus(): Array { val result = Arrays.copyOf(this, 3) diff --git a/compiler/testData/diagnostics/tests/inference/immutableArrayList.fir.kt b/compiler/testData/diagnostics/tests/inference/immutableArrayList.fir.kt deleted file mode 100644 index 6b8be3fbbdb..00000000000 --- a/compiler/testData/diagnostics/tests/inference/immutableArrayList.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: p/J.java -package p; - -public interface J { - public interface Super {} - public interface Sub extends Super {} -} - -// FILE: k.kt - -import p.J.* - -class Foo: Sub { - fun foo(): Super { - return Foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/immutableArrayList.kt b/compiler/testData/diagnostics/tests/inference/immutableArrayList.kt index 6b8be3fbbdb..8f323f154a9 100644 --- a/compiler/testData/diagnostics/tests/inference/immutableArrayList.kt +++ b/compiler/testData/diagnostics/tests/inference/immutableArrayList.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.fir.kt b/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.fir.kt deleted file mode 100644 index 8c58629b05c..00000000000 --- a/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -interface Foo -interface Bar - -class Baz : Foo, Bar - -fun S.bip(): String where S : Foo, S: Bar { - return "OK" -} - -fun box(): String { - val baz = Baz() - return baz.bip() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.kt b/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.kt index 8c58629b05c..20eb5caa806 100644 --- a/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.kt +++ b/compiler/testData/diagnostics/tests/inference/intersectionTypeMultipleBoundsAsReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Foo interface Bar diff --git a/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.fir.kt b/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.fir.kt deleted file mode 100644 index e186708d0f2..00000000000 --- a/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// NI_EXPECTED_FILE - -// ISSUE: KT-32383 - -class Inv -class Out -class In - -fun invOf(vararg t: T): Inv = null!! -fun outOf(vararg t: T): Out = null!! -fun inOf(vararg t: T): In = null!! - -interface Foo -abstract class Bar - -enum class AFoo : Foo -object A : Bar() - -enum class BFoo : Foo -object B : Bar() - -val invs = invOf(A, B) -val outs = outOf(A, B) -val ins = inOf(A, B) diff --git a/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.kt b/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.kt index e186708d0f2..cee9711f80c 100644 --- a/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.kt +++ b/compiler/testData/diagnostics/tests/inference/intersectionWithEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // NI_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/tests/inference/kt32434.fir.kt b/compiler/testData/diagnostics/tests/inference/kt32434.fir.kt deleted file mode 100644 index 72c785a37e6..00000000000 --- a/compiler/testData/diagnostics/tests/inference/kt32434.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// FULL_JDK -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// Issue: KT-32434 - -// FILE: CacheMonoJava.java - -public class CacheMonoJava { - public static Mono lookup(java.util.Map> map, K key) { - throw new UnsupportedOperationException(); - } -} - -// FILE: main.kt - -interface Cache { - fun asMap(): MutableMap -} - -interface Mono -interface Signal : Mono - -interface AttributeDefinition - -val cache: Cache> = TODO() - -object CacheMonoKotlin { - fun lookup(map: MutableMap>, key: K): Mono = TODO() -} - -fun findByName_java(name: String): Mono = CacheMonoJava.lookup(cache.asMap(), name) -fun findByName_kotlin(name: String): Mono = CacheMonoKotlin.lookup(cache.asMap(), name) diff --git a/compiler/testData/diagnostics/tests/inference/kt32434.kt b/compiler/testData/diagnostics/tests/inference/kt32434.kt index 72c785a37e6..1dbb488c980 100644 --- a/compiler/testData/diagnostics/tests/inference/kt32434.kt +++ b/compiler/testData/diagnostics/tests/inference/kt32434.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/kt35702.fir.kt b/compiler/testData/diagnostics/tests/inference/kt35702.fir.kt deleted file mode 100644 index 62717970106..00000000000 --- a/compiler/testData/diagnostics/tests/inference/kt35702.fir.kt +++ /dev/null @@ -1,41 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNCHECKED_CAST -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER -UNUSED_PARAMETER -// !WITH_NEW_INFERENCE -// ISSUE: KT-35702 - -interface A - -fun uncheckedCast(value: Any?): T = value as T - -fun select(x: K, y: K): K = x - -fun test_1(b: Boolean, s: String) { - val result: (A) -> T = if (b) { - { a: A -> uncheckedCast(s) } - } else { - { a: A -> uncheckedCast(s) } - } -} - -fun test_2(b: Boolean, s: String) { - val result: (A) -> T = if (b) { - { a: A -> uncheckedCast(s) } - } else { - { a -> uncheckedCast(s) } - } -} - -fun test_3(b: Boolean, s: String) { - val result: (A) -> T = if (b) { - { a -> uncheckedCast(s) } - } else { - { a -> uncheckedCast(s) } - } -} - -fun test_4(s: String) { - val result: (A) -> T = select( - { a: A -> uncheckedCast(s) }, - { a: A -> uncheckedCast(s) } - ) -} diff --git a/compiler/testData/diagnostics/tests/inference/kt35702.kt b/compiler/testData/diagnostics/tests/inference/kt35702.kt index 62717970106..3298921cbed 100644 --- a/compiler/testData/diagnostics/tests/inference/kt35702.kt +++ b/compiler/testData/diagnostics/tests/inference/kt35702.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNCHECKED_CAST -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER -UNUSED_PARAMETER // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/tests/inference/kt619.fir.kt b/compiler/testData/diagnostics/tests/inference/kt619.fir.kt deleted file mode 100644 index 34abe88e155..00000000000 --- a/compiler/testData/diagnostics/tests/inference/kt619.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class A(t : Int) : Comparable { - var i = t - override fun compareTo(other : A) = (this.i - other.i) -} diff --git a/compiler/testData/diagnostics/tests/inference/kt619.kt b/compiler/testData/diagnostics/tests/inference/kt619.kt index 34abe88e155..81f78254947 100644 --- a/compiler/testData/diagnostics/tests/inference/kt619.kt +++ b/compiler/testData/diagnostics/tests/inference/kt619.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A(t : Int) : Comparable { var i = t override fun compareTo(other : A) = (this.i - other.i) diff --git a/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.fir.kt b/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.fir.kt deleted file mode 100644 index 09a3f783818..00000000000 --- a/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -val x1: (String) -> Unit = run { - lambda@{ foo -> - bar(foo) - } -} - -val x2: (String) -> Unit = run { - ({ foo -> - bar(foo) - }) -} - -val x3: (String) -> Unit = run { - (lambda@{ foo -> - bar(foo) - }) -} - -val x4: (String) -> Unit = run { - return@run (lambda@{ foo -> - bar(foo) - }) -} - -fun bar(s: String) {} -fun run(block: () -> R): R = block() diff --git a/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.kt b/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.kt index 09a3f783818..6629fa2cfea 100644 --- a/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.kt +++ b/compiler/testData/diagnostics/tests/inference/lambdaArgumentWithLabel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.fir.kt b/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.fir.kt deleted file mode 100644 index a713982a29e..00000000000 --- a/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +NewInference - -fun bar() { - if (true) { - fun local() { - } - } else { - - } -} diff --git a/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.kt b/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.kt index a713982a29e..2e5c0a83540 100644 --- a/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.kt +++ b/compiler/testData/diagnostics/tests/inference/localFunctionInsideIfBlock.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference fun bar() { diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.fir.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.fir.kt deleted file mode 100644 index 2657debff59..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -package b - -class A { - operator fun get(i: Int): List = throw Exception("$i") -} - -fun bar(l: List) = l - -fun test(a: A) { - bar(a[12]) -} diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt index 2657debff59..e7bf41b6e0c 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package b class A { diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.fir.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.fir.kt deleted file mode 100644 index 583ec9f7104..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -fun foo(t: T) = t - -fun test(map: MutableMap, t: Int) { - map [t] = foo(t) // t was marked with black square -} - -//from library -operator fun MutableMap.set(key : K, value : V) : V? = this.put(key, value) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt index 583ec9f7104..97ae4a22417 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(t: T) = t fun test(map: MutableMap, t: Int) { diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.fir.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.fir.kt deleted file mode 100644 index eea79c7bf82..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -package a - -import java.util.ArrayList - -public fun Iterable.withIndices(): List> { - val answer = ArrayList>() - var nextIndex = 1 - for (e in this) { - answer.add(Pair(nextIndex, e)) - nextIndex++ - } - return answer -} - -//from standard library -public class Pair( - public val first: A, - public val second: B -) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.kt index eea79c7bf82..ec717bdcd81 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsInference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package a import java.util.ArrayList diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.fir.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.fir.kt deleted file mode 100644 index df887b2f1c3..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE - -package aaa - -infix fun T.foo(t: T) = t - -fun id(t: T) = t - -fun a() { - val i = id(2 foo 3) - checkSubtype(i) // i shouldn't be resolved to error element -} diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.kt index df887b2f1c3..afe3f7f76dc 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/inferenceForNestedBinaryCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE package aaa diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.fir.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.fir.kt deleted file mode 100644 index 6e2fd6f3d6f..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -open class Cls - -abstract class In -class SubIn : In() - -inline fun materialize(): T? = TODO() - -fun transform(transformer: In, data: D): Unit = TODO() - -fun test(subIn: SubIn) { - transform(subIn, materialize()) // D should be inferred to Cls?, not Nothing? -} diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.kt index 6e2fd6f3d6f..0900a74086b 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/preferArgumentToNullability.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.fir.kt deleted file mode 100644 index 6e5b1719e8f..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// Validation test. -// Check that type variable is fixed to Data as it's used in input types for lambda - -class Data(val x: T) { - fun dataMethod() {} -} - -fun bar(x: K, y: (K) -> Unit) {} - -fun test() { - bar(Data(null)) { it.dataMethod() } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.kt b/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.kt index 6e5b1719e8f..639979c2b30 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/complexDependancyOnVariableWithTrivialConstraint.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.fir.kt deleted file mode 100644 index 61fdb79ced5..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun expanded(maxCapacity: Int, newCapacity: Int, buffer: Array) { - select(buffer.copyOf(newCapacity), toArray(arrayOfNulls(newCapacity))) -} - -fun select(x: K, y: K): K = x - -fun Array.copyOf(newSize: Int): Array = TODO() -inline fun arrayOfNulls(size: Int): Array = TODO() -fun toArray(array: Array): Array = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.kt b/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.kt index 61fdb79ced5..9eccd5e978d 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/discriminatedNothingInsideComplexNestedCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.fir.kt deleted file mode 100644 index e387e3f09bb..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Out(val o: T) - -interface Base -class Inv : Base - -fun select(x: S, y: S): S = x - -fun test(a1: Inv, a2: Inv): Out { - return select(Out(a1), Out(a2)) -} diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.kt b/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.kt index e387e3f09bb..fbec8762b5b 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/generateConstraintWithInnerNothingType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.fir.kt deleted file mode 100644 index 35389378196..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Simple - -fun test(s: Simple?): Simple? { - myRun { - s?.let { return it } - } - - return s -} - -inline fun myRun(block: () -> R): R = TODO() -inline fun K.let(block: (K) -> V): V = TODO() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.kt b/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.kt index 35389378196..b4f9d308366 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/implicitNothingConstraintFromReturn.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.fir.kt deleted file mode 100644 index e51d9a63070..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE - -fun bar(i: T): T = i -fun foo(i: Int) = i - -fun dontRun(body: () -> Unit) = Unit - -class Case1 { - fun test() { - dontRun { val x = bar(bar { -> bar { -> 2} }) } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.kt index e51d9a63070..9a85359b669 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/kt24490.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.fir.kt deleted file mode 100644 index 005db4646cb..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun select(x: T, y: T): T = x - -fun foo(x: Int, stringNothing: Out2): Out2 = - select(x.right(), stringNothing) - -fun R.right(): Out2 = TODO() - -class Out2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.kt index 005db4646cb..6e5518d5702 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/kt32081.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun select(x: T, y: T): T = x diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.fir.kt deleted file mode 100644 index aff2fa3512d..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -class Test { - fun hereIdeaFail(values : List, others : List): List> { - return values.map { left(it) }.plus(others.map { right(it) }) - } - - companion object { - fun left(left: L): Test = TODO() - fun right(right: R): Test = TODO() - } -} - -fun Iterable.map(transform: (T) -> R): List = TODO() -operator fun Collection.plus(elements: Iterable): List = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.kt b/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.kt index aff2fa3512d..40af4a6e229 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/kt32207.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Test { diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.fir.kt deleted file mode 100644 index f784b2bae38..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference - -fun id1(k: K): K = k -fun id2(v: V): V = v - -fun test() { - id1 { - id2 { - 3 - } - } -} diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt b/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt index f784b2bae38..b97d40f3bd8 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/nestedLambdaInferenceWithIncorporationOfVariables.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference fun id1(k: K): K = k diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.fir.kt b/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.fir.kt deleted file mode 100644 index 5f2cd7c5e9a..00000000000 --- a/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun select2(x: K, y: K): K = TODO() -fun select3(x: K, y: K, z: K): K = TODO() - -fun dependantSelect2(x: K, y: S) {} -fun dependantSelect3(x: K, y: K, z: S) {} - -fun foo() {} -fun cloneFoo() {} -fun bar(x: Int) {} - -fun test(f1: (Int) -> Unit, f2: kotlin.Function1) { - select2(null, ::foo) - select3(null, f1, ::bar) - select3(null, f2, ::bar) - - select3(null, f1, ::foo) - select3(null, f2, ::foo) - - dependantSelect2(null, ::foo) - dependantSelect3(null, ::foo, ::cloneFoo) - dependantSelect3(null, f1, ::bar) - dependantSelect3(null, ::bar, f1) - - dependantSelect3(null, ::foo, ::bar) - dependantSelect3(null, ::bar, ::foo) - dependantSelect3(null, f1, ::foo) - dependantSelect3(null, ::foo, f1) -} diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt b/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt index 5f2cd7c5e9a..ba22299a9ed 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/nothingWithCallableReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/inference/opposite.fir.kt b/compiler/testData/diagnostics/tests/inference/opposite.fir.kt deleted file mode 100644 index 842dfeb34d4..00000000000 --- a/compiler/testData/diagnostics/tests/inference/opposite.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -package a - -interface Persistent -interface PersistentFactory - -class Relation( - val sources: PersistentFactory, - val targets: PersistentFactory -) { - fun opposite() = Relation(targets, sources) -} diff --git a/compiler/testData/diagnostics/tests/inference/opposite.kt b/compiler/testData/diagnostics/tests/inference/opposite.kt index 842dfeb34d4..391b7d08fb6 100644 --- a/compiler/testData/diagnostics/tests/inference/opposite.kt +++ b/compiler/testData/diagnostics/tests/inference/opposite.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package a interface Persistent diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1358.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1358.fir.kt deleted file mode 100644 index 47f48ec856f..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1358.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -//KT-1358 Overload resolution ambiguity with smartcast and generic function -package d - -fun bar(a: Any?) { - if (a != null) { - a.foo() //overload resolution ambiguity - a.sure() //overload resolution ambiguity - } -} - -fun T?.foo() {} -fun T?.sure() : T = this!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1358.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1358.kt index 47f48ec856f..3cbd1ceb521 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1358.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1358.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1358 Overload resolution ambiguity with smartcast and generic function package d diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.fir.kt deleted file mode 100644 index 518a6096516..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE - -//KT-1944 Inference fails on run() -package j - -class P { - var x : Int = 0 - private set - - fun foo() { - val r = run {x = 5} // ERROR - checkSubtype(r) - } -} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt index 518a6096516..2d4ec214c35 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1944.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE //KT-1944 Inference fails on run() diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2294.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2294.fir.kt deleted file mode 100644 index c5e4fa5eb02..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2294.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !CHECK_TYPE - -//KT-2294 Type inference infers DONT_CARE instead of correct type -package a - -public fun foo(array: Array): Array = array - -public fun test() -{ - val x = foo(array(1, 2, 3, 4, 5)) // Should infer type 'Int' - // ^--- public final fun array(vararg t : DONT_CARE) : kotlin.Array defined in Kotlin - // ^--- public final fun foo(items t : kotlin.Array) : kotlin.Array defined in root package - checkSubtype>(x) -} - -//-------------------- -@Suppress("UNCHECKED_CAST") -fun array(vararg t : T) : Array = t as Array diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2294.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2294.kt index c5e4fa5eb02..12c8a18d952 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2294.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2294.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE //KT-2294 Type inference infers DONT_CARE instead of correct type diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2484.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2484.fir.kt deleted file mode 100644 index 6071cfac1b9..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2484.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -//KT-2484 Type inferred for function literal is (...) -> Int instead of (...) -> Unit, when function literal parameter is explicit - -package a -//+JDK - -fun Array.forEach(operation: (T) -> Unit) : Unit { for (element in this) operation(element) } - -fun bar(operation: (String) -> Unit) = operation("") - -fun main(args: Array) { - args.forEach { a : String -> a.length } // Type mismatch: (String) -> Unit required, (String) -> Int found - args.forEach { a -> a.length } // Type mismatch: (String) -> Unit required, (String) -> Int found - args.forEach { it.length } // This works! - - bar { a: String -> a.length } - bar { a -> a.length } - bar { it.length } -} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt index 6071cfac1b9..2a53655b71f 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2484.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2484 Type inferred for function literal is (...) -> Int instead of (...) -> Unit, when function literal parameter is explicit package a diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2505.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2505.fir.kt deleted file mode 100644 index 510d55c6d3b..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2505.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !CHECK_TYPE - -//KT-2505 Type mismatch: inferred type is T but T was expected - -package a - -interface MyType {} -class MyClass : MyType {} - -public open class HttpResponse() { - public open fun parseAs(dataClass : MyClass) : T { - throw Exception() - } - public open fun parseAs(dataType : MyType) : Any? { - return null - } -} - -fun test (httpResponse: HttpResponse, rtype: MyClass) { - val res = httpResponse.parseAs( rtype ) - checkSubtype(res) //type mismatch: required R, found T -} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2505.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2505.kt index 510d55c6d3b..b8497562454 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2505.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2505.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE //KT-2505 Type mismatch: inferred type is T but T was expected diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2514.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2514.fir.kt deleted file mode 100644 index 090534551cd..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2514.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -//KT-2514 Type inference fails when using extension function literal -package kt2514 - -//+JDK -import java.io.Closeable - -fun Thread.use(block: Thread.() -> T): T = block() - -fun T.use(block: (T)-> R) : R = block(this) - -fun main() { - Thread().use { } // compilation error: Type inference failed - Thread().use { 5 + 5 } // compilation error: Type inference failed - Thread().use { } // compiles okay - Thread().use { 5 + 5 } // compiles okay -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2514.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2514.kt index 090534551cd..84bc0648eb9 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2514.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2514.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2514 Type inference fails when using extension function literal package kt2514 diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2588.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2588.fir.kt deleted file mode 100644 index bfe802621b4..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2588.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -//T-2588 Allow to specify exact super type (expected) in inference if many - -import java.util.HashSet - -class MyClass() - -interface A -interface D -class B : A, D -class C : A, D - -fun hashSetOf(vararg values: T): HashSet = throw Exception("$values") - -fun foo(b: MyClass, c: MyClass) { - val set1 : Set> = hashSetOf(b, c) //type inference expected type mismatch - val set2 = hashSetOf(b, c) //Set> is inferred -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2588.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2588.kt index bfe802621b4..f176dac4f8a 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2588.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2588.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE //T-2588 Allow to specify exact super type (expected) in inference if many diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt deleted file mode 100644 index 1e406e58d0d..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !WITH_NEW_INFERENCE - -package a - -interface Closeable { - fun close() {} -} - -class C : Closeable - -public inline fun T.use(block: (t: T)-> R) : R { - return block(this) -} - -fun test() { - C().use { - it.close() - x - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt index 1e406e58d0d..9932f696ec0 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt deleted file mode 100644 index 6c635f87ad7..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !WITH_NEW_INFERENCE - -package a - -interface Closeable { - fun close() {} -} - -class C : Closeable - -public inline fun use(t: T, block: T.(T)-> R) : R { - return t.block(t) -} - -fun test() { - use(C()) { - this.close() - it.close() - xx - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt index 6c635f87ad7..83cf07ad502 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_it_this.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt deleted file mode 100644 index 116a2269643..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !WITH_NEW_INFERENCE - -package a - -interface Closeable { - fun close() {} -} - -class C : Closeable - -public inline fun T.use(block: T.()-> R) : R { - return this.block() -} - -fun test() { - C().use { - this.close() - x - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt index 116a2269643..3081338e9e5 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2841_this.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE package a diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3174.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3174.fir.kt deleted file mode 100644 index 48bb892a997..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3174.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -//KT-3174 Call resolver doesn't understand type is not-nullable after ?. safe call -package a - -fun T.test(): T = this -fun foo(a: Any?) = a?.test() // Error - -fun T.fff(l: MutableList) = l.add(this) - -fun test(s: String?, l: MutableList) { - s?.fff(l) - -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3174.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3174.kt index 48bb892a997..28474a50e5b 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3174.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3174.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-3174 Call resolver doesn't understand type is not-nullable after ?. safe call package a diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt32106.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt32106.fir.kt deleted file mode 100644 index e6d5fe87ff3..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt32106.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -class Query private constructor( - private val result: T?, - private val error: Throwable?, - val inProgress: Boolean -) { - companion object { - val inProgress = Query(null, null, true) - fun forError(e: Throwable) = Query(null, e, false) - fun forResult(result: T) = Query(result, null, false) - } -} - -class MutableLiveData { - var value: Query = null!! -} - -fun main() { - val liveData = MutableLiveData>() - liveData.value = Query.inProgress // Type mismatch: inferred type is Query but Query was expected -} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt32106.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt32106.kt index e6d5fe87ff3..516af157f24 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt32106.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt32106.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Query private constructor( private val result: T?, private val error: Throwable?, diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3344.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3344.fir.kt deleted file mode 100644 index 5202a4dcf65..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3344.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -//KT-3344 InternalError in compiler when type arguments are not specified - -package i - -import java.util.HashMap -import java.util.ArrayList - -class Foo(val attributes: Map) - -class Bar { - val foos = ArrayList() - - fun bar11(foo: Foo) { - foos.add(Foo(HashMap(foo.attributes))) // foo.attributes is unresolved but not marked - } -} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3344.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3344.kt index 5202a4dcf65..25a19a6c4d9 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3344.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3344.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-3344 InternalError in compiler when type arguments are not specified package i diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt37043.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt37043.fir.kt deleted file mode 100644 index cda9701b1f8..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt37043.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS -UNUSED_VARIABLE -// FILE: Test.java - -class Test { - static Number[] flexibleNumbers() { - return null; - } -} - -// FILE: main.kt - -fun foo(x: Array): T = x[0] - -inline fun materializeArray(): Array = null as Array - -fun main() { - val y = foo(Test.flexibleNumbers() ?: materializeArray()) // Any? in NI, Number! in OI (T of `materializeArray` is inferred to Any?) -} diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt37043.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt37043.kt index cda9701b1f8..c9576bddc49 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt37043.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt37043.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -CAST_NEVER_SUCCEEDS -UNUSED_VARIABLE // FILE: Test.java diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt8132.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt8132.fir.kt deleted file mode 100644 index 6304e603450..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt8132.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -// KT-8132 Can't omit lambda parameter types - -fun test(foo: List): T { - return if (true) - throw IllegalStateException() - else - foo.reduce { left, right -> left } // error: inferred type T is not subtype Nothing -} - -fun Iterable.reduce(operation: (S, T) -> S): S = throw Exception() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt8132.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt8132.kt index 6304e603450..68a9e3d812b 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt8132.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt8132.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER // KT-8132 Can't omit lambda parameter types diff --git a/compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt deleted file mode 100644 index 829f9f6f893..00000000000 --- a/compiler/testData/diagnostics/tests/inference/starApproximation.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference - -interface Self> { - val x: E -} -fun bar(): Self<*> = TODO() - -interface OutSelf> { - val x: E -} -fun outBar(): OutSelf<*> = TODO() - -fun id(x: X): X = x - -fun main() { - bar().x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x - id(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x - - outBar().x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x - id(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x -} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximation.kt b/compiler/testData/diagnostics/tests/inference/starApproximation.kt index 829f9f6f893..1012076df88 100644 --- a/compiler/testData/diagnostics/tests/inference/starApproximation.kt +++ b/compiler/testData/diagnostics/tests/inference/starApproximation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt deleted file mode 100644 index a3d19c16767..00000000000 --- a/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference - -interface Self> { - val x: E -} -fun bar(): Self<*> = TODO() -fun foo(): Self<*>? = TODO() - -interface OutSelf> { - val x: E -} -fun outBar(): OutSelf<*> = TODO() -fun outFoo(): OutSelf<*>? = TODO() - -fun main() { - bar().x.x.x.x.x.x.x.x.x.x.x.x.x // OK - foo()!!.x.x.x.x.x.x // OK - foo()!!.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x // unresolved x in NI - - outBar().x.x.x.x.x.x.x.x.x.x.x.x.x // OK - outFoo()!!.x.x.x.x.x.x // OK - outFoo()!!.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x // unresolved x in NI -} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt index a3d19c16767..f7dd72beff1 100644 --- a/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt +++ b/compiler/testData/diagnostics/tests/inference/starApproximationBangBang.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt deleted file mode 100644 index d55771f96b1..00000000000 --- a/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference - -// FILE: JavaClass.java -public class JavaClass { - public static > Self id1Inv(T t) { return null; } - public static > T id2Inv(T t) { return null; } - public static > OutSelf id1Out(T t) { return null; } - public static > T id2Out(T t) { return null; } -} - -// FILE: main.kt -interface Self> { - val x: E -} -fun bar(): Self<*> = TODO() - -interface OutSelf> { - val x: E -} -fun outBar(): OutSelf<*> = TODO() - -fun main() { - JavaClass.id1Inv(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x - JavaClass.id2Inv(bar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x - - JavaClass.id1Out(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x - JavaClass.id2Out(outBar()).x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x -} diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt index d55771f96b1..f0ee315d5af 100644 --- a/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt +++ b/compiler/testData/diagnostics/tests/inference/starApproximationFlexible.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.fir.kt b/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.fir.kt deleted file mode 100644 index 9c8c4f1d4be..00000000000 --- a/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference - -// See KT-14453 and KT-35703 -val KClass1.primaryConstructor: KFunction1? get() = null!! - -interface KClass1 -interface KFunction1 -fun f(type: KClass1<*>): KFunction1? = - // What happens here: - // 1. Create captured type for type argument T (it's built upon star-projection from `KClass<*>` that's argument is <: Any) - // 2. Approximate resulting descriptor, now it 'KClass1<*>.primaryConstructor: KFunction1<*>' - // Note that star-projection in 'KFunction1<*>' is obtained from KClass and its `projectionType` is Any (not-nullable). - // Of course that situation is already strange - // 3. When checking subtyping after call completion we get that 'KFunction1<*>' is not a subtype of 'KFunction1' in new type checker. - // The answer is correct, but this old type checker used `projectionType` for this and it was resulting in KFunction1<*> <: KFunction1 - // - // So to fix the issue we use 'out starProjectionType' instead of star-projection itself in approximation - // Note that in new inference there should be no approximation for IN-position types (they must remain captured) - type.primaryConstructor diff --git a/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.kt b/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.kt index 9c8c4f1d4be..dc3b7853321 100644 --- a/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/inference/starApproximationFromDifferentTypeParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.fir.kt b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.fir.kt deleted file mode 100644 index bac19086767..00000000000 --- a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty - -class A(val map: MutableMap) { - - var a: String by map.withDefault1 { "foo" } -} - -operator fun MutableMap.getValue(thisRef: Any?, property: KProperty<*>): G = throw Exception() - -operator fun MutableMap.setValue(thisRef: Any?, property: KProperty<*>, value: S) {} - -fun MutableMap.withDefault1(default: (key: K) -> V): MutableMap = this diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt index bac19086767..b045e9809e0 100644 --- a/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt +++ b/compiler/testData/diagnostics/tests/inference/substitutions/delegationAndInference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.fir.kt b/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.fir.kt deleted file mode 100644 index e8976cb2bbd..00000000000 --- a/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -//KT-6081 Chained generic method calls: wrong type inference - -class Bar - -fun bar(): Bar = null!! - -class Foo { - fun add(bar: Bar): Foo {return this} -} - -fun doesNotWork(bi: Bar, bs: Bar) { - Foo().add(bi).add(bs) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.kt b/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.kt index e8976cb2bbd..a111e151f11 100644 --- a/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.kt +++ b/compiler/testData/diagnostics/tests/inference/substitutions/kt6081SubstituteIntoClassCorrectly.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER //KT-6081 Chained generic method calls: wrong type inference diff --git a/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.fir.kt b/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.fir.kt deleted file mode 100644 index 0254636798a..00000000000 --- a/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -public fun iterate(initialValue: T, nextFunction: (T) -> T?): Iterator = - throw Exception("$initialValue $nextFunction") - -fun foo() { - iterate(3) { n -> if (n > 0) n - 1 else null } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt b/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt index 0254636798a..0e0e893a2fc 100644 --- a/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt +++ b/compiler/testData/diagnostics/tests/inference/tryNumberLowerBoundsBeforeUpperBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public fun iterate(initialValue: T, nextFunction: (T) -> T?): Iterator = throw Exception("$initialValue $nextFunction") diff --git a/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.fir.kt b/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.fir.kt deleted file mode 100644 index d6aa122b339..00000000000 --- a/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: +NewInference - -class B(val obj: O) { - val v = B(obj) -} diff --git a/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.kt b/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.kt index d6aa122b339..b789f748daa 100644 --- a/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.kt +++ b/compiler/testData/diagnostics/tests/inference/typeParameterInConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference class B(val obj: O) { diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.fir.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.fir.kt deleted file mode 100644 index 21379475c41..00000000000 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -fun unescape(value: Any): R? = throw Exception("$value") - -fun foo(v: Any): T? = unescape(v) - -//-------------- - -interface A - -fun unescapeA(value: Any): R? = throw Exception("$value") - - -fun fooA(v: Any): T? = unescapeA(v) - diff --git a/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.kt b/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.kt index 21379475c41..fa3be13efdf 100644 --- a/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.kt +++ b/compiler/testData/diagnostics/tests/inference/upperBounds/nonNullUpperBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun unescape(value: Any): R? = throw Exception("$value") fun foo(v: Any): T? = unescape(v) diff --git a/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.fir.kt b/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.fir.kt deleted file mode 100644 index 9a8a8632d35..00000000000 --- a/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -package m - -import java.util.HashSet - -// ---------------------------------- -fun testGetOrPut(result : MutableMap>, key: K) { - result.getOrPut(key) { HashSet() } -} - -fun MutableMap.getOrPut(key: K, defaultValue: ()-> V) : V = throw Exception("$key $defaultValue") - -// ---------------------------------- -class Property>(val name: String, val default: () -> T) {} - -fun testProperty() = Property("", { -1.toLong() }) -fun testProperty1() = Property("", { "" }) diff --git a/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.kt b/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.kt index 9a8a8632d35..bf29031ba2a 100644 --- a/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.kt +++ b/compiler/testData/diagnostics/tests/inference/useFunctionLiteralsToInferType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package m import java.util.HashSet diff --git a/compiler/testData/diagnostics/tests/inline/anonymousObjects.fir.kt b/compiler/testData/diagnostics/tests/inline/anonymousObjects.fir.kt deleted file mode 100644 index af6c62677c6..00000000000 --- a/compiler/testData/diagnostics/tests/inline/anonymousObjects.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -NON_LOCAL_RETURN_NOT_ALLOWED - -inline fun inlineFun(p: () -> R) { - val s = object { - - val z = p() - - fun a() { - p() - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/anonymousObjects.kt b/compiler/testData/diagnostics/tests/inline/anonymousObjects.kt index af6c62677c6..8461433664e 100644 --- a/compiler/testData/diagnostics/tests/inline/anonymousObjects.kt +++ b/compiler/testData/diagnostics/tests/inline/anonymousObjects.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -NON_LOCAL_RETURN_NOT_ALLOWED inline fun inlineFun(p: () -> R) { diff --git a/compiler/testData/diagnostics/tests/inline/default.fir.kt b/compiler/testData/diagnostics/tests/inline/default.fir.kt deleted file mode 100644 index 6a0b5067607..00000000000 --- a/compiler/testData/diagnostics/tests/inline/default.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE - -inline fun default(s : Int = 10) { - -} - -inline fun default2(p: Int, s : String = "OK") { - -} - -open class Base { - inline final fun foo(a: Int = 1) {} - - inline final fun foo2(a: Int = 1, s: String = "OK") {} -} diff --git a/compiler/testData/diagnostics/tests/inline/default.kt b/compiler/testData/diagnostics/tests/inline/default.kt index 6a0b5067607..03b4a0d1dd0 100644 --- a/compiler/testData/diagnostics/tests/inline/default.kt +++ b/compiler/testData/diagnostics/tests/inline/default.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE inline fun default(s : Int = 10) { diff --git a/compiler/testData/diagnostics/tests/inline/inlineReified.fir.kt b/compiler/testData/diagnostics/tests/inline/inlineReified.fir.kt deleted file mode 100644 index c6a4332e529..00000000000 --- a/compiler/testData/diagnostics/tests/inline/inlineReified.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -inline fun foo(): T3 = null!! - diff --git a/compiler/testData/diagnostics/tests/inline/inlineReified.kt b/compiler/testData/diagnostics/tests/inline/inlineReified.kt index c6a4332e529..676da85709f 100644 --- a/compiler/testData/diagnostics/tests/inline/inlineReified.kt +++ b/compiler/testData/diagnostics/tests/inline/inlineReified.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL inline fun foo(): T3 = null!! diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.fir.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.fir.kt deleted file mode 100644 index e11a8fc6dcb..00000000000 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.fir.kt +++ /dev/null @@ -1,41 +0,0 @@ -fun inlineCallExplicitError(): String { - inlineFun lamba@ { - if (true) { - return@lamba 2 - } - 1 - } - - return "x" -} - -fun inlineCall(): String { - inlineFun lamba@ { - if (true) { - return@lamba 2 - } - 1 - } - - return "x" -} - -inline fun inlineFun(s: () -> Int) { - s() -} - - -fun noInlineCall(): String { - noInline lambda@ { - if (true) { - return@lambda 2 - } - 1 - } - return "x" -} - - -fun noInline(s: () -> Int) { - s() -} diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt index e11a8fc6dcb..82500a5d954 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/explicitReturnType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun inlineCallExplicitError(): String { inlineFun lamba@ { if (true) { diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.fir.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.fir.kt deleted file mode 100644 index d6c0ad89ff2..00000000000 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ - -inline fun onlyLocal(crossinline p: () -> R) { - inlineAll(p) -} - -inline fun inlineAll(p: () -> R) { - p() -} diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt index d6c0ad89ff2..6ebf06ce7ad 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/fromOnlyLocal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL inline fun onlyLocal(crossinline p: () -> R) { inlineAll(p) diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.fir.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.fir.kt deleted file mode 100644 index 094bfabab41..00000000000 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ - -inline fun inlineFunWithAnnotation(crossinline p: () -> R) { - inlineFun { - p() - } -} - -inline fun inlineFun2(p: () -> R) { - inlineFun { - p() - } -} - -inline fun inlineFun(p: () -> R) { - p() -} diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt index 094bfabab41..85374b7f65e 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/inlineLambda.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL inline fun inlineFunWithAnnotation(crossinline p: () -> R) { inlineFun { diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.fir.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.fir.kt deleted file mode 100644 index 023306d08b8..00000000000 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.fir.kt +++ /dev/null @@ -1,41 +0,0 @@ -import Kind.EXT_RETURN -import Kind.GLOBAL_RETURN - -enum class Kind { - LOCAL, - EXT_RETURN, - GLOBAL_RETURN -} - -class Internal(val value: String) - -class External(val value: String) - -class Global(val value: String) - -fun test1(intKind: Kind, extKind: Kind): Global { - - var externalResult = doCall ext@ { - - val internalResult = doCall int@ { - if (intKind == Kind.LOCAL) { - return@test1 Global("internal to global") - } else if (intKind == EXT_RETURN) { - return@ext External("internal to external") - } - return@int Internal("internal to local") - } - - if (extKind == GLOBAL_RETURN || extKind == EXT_RETURN) { - return Global("external to global") - } - - External(internalResult.value + " to local"); - } - - return Global(externalResult.value + " to exit") -} - -public inline fun doCall(block: ()-> R) : R { - return block() -} diff --git a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt index 023306d08b8..ecee5826471 100644 --- a/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt +++ b/compiler/testData/diagnostics/tests/inline/nonLocalReturns/nestedNonLocals.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import Kind.EXT_RETURN import Kind.GLOBAL_RETURN diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.fir.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.fir.kt deleted file mode 100644 index 78f956bd84c..00000000000 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -internal class Z2 { - private val privateProperty = 11; - - public val publicProperty:Int = 12 - - private fun privateFun() {} - - public fun publicFun() {} - - internal inner class ZInner { - public inline fun test() { - privateProperty - privateFun() - publicFun() - publicProperty - - Z2().publicProperty - Z2().publicFun() - Z2().privateProperty - Z2().privateFun() - } - - internal inline fun testInternal() { - privateProperty - privateFun() - publicFun() - publicProperty - - Z2().publicProperty - Z2().publicFun() - Z2().privateProperty - Z2().privateFun() - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.kt index 78f956bd84c..9a018befb85 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/inNonPublicInnerClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE internal class Z2 { private val privateProperty = 11; diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.fir.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.fir.kt deleted file mode 100644 index bb947595277..00000000000 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -NOTHING_TO_INLINE - -public class Z { - private val privateProperty = 11; - - public fun privateFun() { - - class Local { - public inline fun a() { - privateProperty - } - } - - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.kt b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.kt index bb947595277..fd87772fe12 100644 --- a/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.kt +++ b/compiler/testData/diagnostics/tests/inline/nonPublicMember/localClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -NOTHING_TO_INLINE public class Z { diff --git a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.fir.kt b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.fir.kt deleted file mode 100644 index 2a9f4cda4f6..00000000000 --- a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -public inline fun test(predicate: (Char) -> Boolean) { - !predicate('c') -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.kt b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.kt index 2a9f4cda4f6..359b8771751 100644 --- a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.kt +++ b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOnCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public inline fun test(predicate: (Char) -> Boolean) { !predicate('c') } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.fir.kt b/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.fir.kt deleted file mode 100644 index 4d71d826e72..00000000000 --- a/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +InlineClasses - -inline class Name(val name: String) -inline class Password(val password: String) - -interface NameVerifier { - fun verify(name: Name) -} - -interface PasswordVerifier { - fun verify(password: Password) -} - -interface NameAndPasswordVerifier : NameVerifier, PasswordVerifier diff --git a/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.kt b/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.kt index 4d71d826e72..7433d266115 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.kt +++ b/compiler/testData/diagnostics/tests/inlineClasses/functionsJvmSignaturesConflictOnInheritance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +InlineClasses inline class Name(val name: String) diff --git a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.fir.kt b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.fir.kt deleted file mode 100644 index 14efbfee879..00000000000 --- a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// !LANGUAGE: +InlineClasses - -inline class Test(val x: Int = 42) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.kt b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.kt index 14efbfee879..015b386cf21 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.kt +++ b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassConstructorParameterWithDefaultValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +InlineClasses inline class Test(val x: Int = 42) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.fir.kt b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.fir.kt deleted file mode 100644 index b665afb1e14..00000000000 --- a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +InlineClasses - -inline class UInt(val x: Int) - -inline class UIntArray(private val storage: IntArray) : Collection { - public override val size: Int get() = storage.size - - override operator fun iterator() = TODO() - override fun contains(element: UInt): Boolean = TODO() - override fun containsAll(elements: Collection): Boolean = TODO() - override fun isEmpty(): Boolean = TODO() -} diff --git a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.kt b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.kt index b665afb1e14..213ddf10ec1 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.kt +++ b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassImplementsCollection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +InlineClasses inline class UInt(val x: Int) diff --git a/compiler/testData/diagnostics/tests/inner/enumEntries.fir.kt b/compiler/testData/diagnostics/tests/inner/enumEntries.fir.kt deleted file mode 100644 index 713d8c9af1d..00000000000 --- a/compiler/testData/diagnostics/tests/inner/enumEntries.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -enum class E { - E1 { - override fun foo() = outerFun() + super.outerFun() - }, - E2 { - override fun foo() = E1.foo() - }; - - abstract fun foo(): Int - - fun outerFun() = 42 -} diff --git a/compiler/testData/diagnostics/tests/inner/enumEntries.kt b/compiler/testData/diagnostics/tests/inner/enumEntries.kt index 713d8c9af1d..ceb08877a1b 100644 --- a/compiler/testData/diagnostics/tests/inner/enumEntries.kt +++ b/compiler/testData/diagnostics/tests/inner/enumEntries.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { E1 { override fun foo() = outerFun() + super.outerFun() diff --git a/compiler/testData/diagnostics/tests/inner/extensionFun.fir.kt b/compiler/testData/diagnostics/tests/inner/extensionFun.fir.kt deleted file mode 100644 index 6515d9c486c..00000000000 --- a/compiler/testData/diagnostics/tests/inner/extensionFun.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -class Outer { - class Nested - inner class Inner - - fun Inner.foo() { - Outer() - Nested() - Inner() - } - - fun Nested.bar() { - Outer() - Nested() - Inner() - } - - fun Outer.baz() { - Outer() - Nested() - Inner() - } -} - -fun Outer.foo() { - Outer() - Nested() - Inner() -} diff --git a/compiler/testData/diagnostics/tests/inner/extensionFun.kt b/compiler/testData/diagnostics/tests/inner/extensionFun.kt index 6515d9c486c..ab0c2c058d8 100644 --- a/compiler/testData/diagnostics/tests/inner/extensionFun.kt +++ b/compiler/testData/diagnostics/tests/inner/extensionFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { class Nested inner class Inner diff --git a/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.fir.kt b/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.fir.kt deleted file mode 100644 index 36aca591b84..00000000000 --- a/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !LANGUAGE: +InnerClassInEnumEntryClass - -enum class A { - X { - val x = 1 - fun foo() {} - - inner class Inner { - val y = x - fun bar() = foo() - } - } -} diff --git a/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.kt b/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.kt index 36aca591b84..442220fdbd9 100644 --- a/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.kt +++ b/compiler/testData/diagnostics/tests/inner/innerClassInEnumEntryClassMemberResolve.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +InnerClassInEnumEntryClass enum class A { diff --git a/compiler/testData/diagnostics/tests/inner/localClass.fir.kt b/compiler/testData/diagnostics/tests/inner/localClass.fir.kt deleted file mode 100644 index 2cf0bdc644e..00000000000 --- a/compiler/testData/diagnostics/tests/inner/localClass.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -class Outer { - fun foo(): Int { - if (outerState > 0) return outerState - - class Local { - val localState = outerState - - inner class LocalInner { - val o = outerState - val l = localState - } - } - - return Local().localState - } - - val outerState = 42 -} diff --git a/compiler/testData/diagnostics/tests/inner/localClass.kt b/compiler/testData/diagnostics/tests/inner/localClass.kt index 2cf0bdc644e..63b306505d0 100644 --- a/compiler/testData/diagnostics/tests/inner/localClass.kt +++ b/compiler/testData/diagnostics/tests/inner/localClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { fun foo(): Int { if (outerState > 0) return outerState diff --git a/compiler/testData/diagnostics/tests/inner/localClassInsideNested.fir.kt b/compiler/testData/diagnostics/tests/inner/localClassInsideNested.fir.kt deleted file mode 100644 index a7eefec3262..00000000000 --- a/compiler/testData/diagnostics/tests/inner/localClassInsideNested.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class Outer { - class Nested { - fun foo() { - class Local { - val state = outerState - } - } - } - - val outerState = 42 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/localClassInsideNested.kt b/compiler/testData/diagnostics/tests/inner/localClassInsideNested.kt index a7eefec3262..cd4620738b1 100644 --- a/compiler/testData/diagnostics/tests/inner/localClassInsideNested.kt +++ b/compiler/testData/diagnostics/tests/inner/localClassInsideNested.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { class Nested { fun foo() { diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.fir.kt b/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.fir.kt deleted file mode 100644 index 991b4ffb543..00000000000 --- a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -open class Outer { - class Nested : Outer() { - fun bar() = foo() - fun baz() = super.foo() - } - - fun foo() = 42 -} diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.kt b/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.kt index 991b4ffb543..8e451cfed14 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Outer { class Nested : Outer() { fun bar() = foo() diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.fir.kt b/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.fir.kt deleted file mode 100644 index 11e0d3b9340..00000000000 --- a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -open class Outer { - class Nested : Outer() { - fun bar(): U = foo() - fun baz(): U = super.foo() - } - class Nested2 : Outer() { - fun bar(): String = foo() - fun baz(): String = super.foo() - } - - fun foo(): T = null!! -} diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.kt b/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.kt index 11e0d3b9340..86b51921aa2 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassExtendsOuterGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Outer { class Nested : Outer() { fun bar(): U = foo() diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassInObject.fir.kt b/compiler/testData/diagnostics/tests/inner/nestedClassInObject.fir.kt deleted file mode 100644 index 1eba5b37b5f..00000000000 --- a/compiler/testData/diagnostics/tests/inner/nestedClassInObject.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -object Object { - class NestedClass { - fun test() { - outerFun() - outerVal - OuterObject - OuterClass() - } - } - - fun outerFun() {} - val outerVal = 4 - - object OuterObject - class OuterClass -} diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassInObject.kt b/compiler/testData/diagnostics/tests/inner/nestedClassInObject.kt index 1eba5b37b5f..6352b33014a 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassInObject.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassInObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object Object { class NestedClass { fun test() { diff --git a/compiler/testData/diagnostics/tests/inner/outerProtectedMember.fir.kt b/compiler/testData/diagnostics/tests/inner/outerProtectedMember.fir.kt deleted file mode 100644 index 5f0064e9227..00000000000 --- a/compiler/testData/diagnostics/tests/inner/outerProtectedMember.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// KT-2100 - -interface I { - val x : String -} - -class Foo { - protected val x : String = "" - - inner class Inner : I { - override val x : String = this@Foo.x - } -} diff --git a/compiler/testData/diagnostics/tests/inner/outerProtectedMember.kt b/compiler/testData/diagnostics/tests/inner/outerProtectedMember.kt index 5f0064e9227..bd40da3da5b 100644 --- a/compiler/testData/diagnostics/tests/inner/outerProtectedMember.kt +++ b/compiler/testData/diagnostics/tests/inner/outerProtectedMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-2100 interface I { diff --git a/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.fir.kt b/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.fir.kt deleted file mode 100644 index dae32f58c4f..00000000000 --- a/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -open class Base { - fun foo() {} -} - -class Derived : Base() { - class Nested { - fun bar() = foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.kt b/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.kt index dae32f58c4f..1b28c60379f 100644 --- a/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.kt +++ b/compiler/testData/diagnostics/tests/inner/outerSuperClassMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Base { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.fir.kt deleted file mode 100644 index fb452a3238a..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -class Outer { - class Nested { - companion object { - fun foo() = 42 - } - } - - companion object { - fun bar() = 239 - } -} - -fun foo() = Outer.Nested.foo() -fun bar() = Outer.bar() diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.kt index fb452a3238a..925d5c0b51e 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/classObjectOfNestedClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { class Nested { companion object { diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.fir.kt deleted file mode 100644 index 07b6d50f09c..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun bar(b: Boolean) = b - -fun foo(data: List) { - bar(data.contains("")) -} diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.kt index 07b6d50f09c..1ba46e358a0 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/dataLocalVariable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(b: Boolean) = b fun foo(data: List) { diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.fir.kt deleted file mode 100644 index 431424518a0..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -enum class E { - E1, - E2 { }; -} - -fun foo() = E.E1 -fun bar() = E.E2 diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.kt index 431424518a0..3f0c0173494 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/enumConstant.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class E { E1, E2 { }; diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.fir.kt deleted file mode 100644 index 128bdafcc08..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: a.kt -class A { - class B { - class C - } -} - -// FILE: b.kt -import A.B -import A.B.C - -val a = A() -val b = B() -val ab = A.B() -val c = C() -val bc = B.C() -val abc = A.B.C() diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.kt index 128bdafcc08..3f1718ae487 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/importNestedClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt class A { class B { diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.fir.kt deleted file mode 100644 index 07623cb8350..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -package A - -class B { - class C { - } -} - -val a = A.B.C() diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.kt index 07623cb8350..df7bea5311a 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedClassInPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package A class B { diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.fir.kt deleted file mode 100644 index a4f370e65ae..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class A { - enum class E { - E1, - E2 { }; - } -} - -fun foo() = A.E.E1 -fun bar() = A.E.E2 diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.kt index a4f370e65ae..1c768d992db 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedEnumConstant.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { enum class E { E1, diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.fir.kt deleted file mode 100644 index c764ad234e1..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -object A { - object B { - object C - } -} - -val a = A.B.C diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.kt index c764ad234e1..5c7471c8108 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/nestedObjects.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object A { object B { object C diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.fir.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.fir.kt deleted file mode 100644 index 067bc4df710..00000000000 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -abstract class Outer { - class Nested { - class NestedNested - } - - abstract val prop1: Nested - abstract val prop2: Nested.NestedNested -} - -fun foo(): Outer.Nested = null!! -val bar: Outer.Nested.NestedNested = null!! diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.kt index 067bc4df710..1bf0b2abb20 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/typePosition.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class Outer { class Nested { class NestedNested diff --git a/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.fir.kt b/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.fir.kt deleted file mode 100644 index 6bc832b5785..00000000000 --- a/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -open class PackageTest - -class MoreTest() { - companion object: PackageTest() { - - } - - object Some: PackageTest() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.kt b/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.kt index 6bc832b5785..9c7f913e5f9 100644 --- a/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.kt +++ b/compiler/testData/diagnostics/tests/inner/resolvePackageClassInObjects.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class PackageTest class MoreTest() { diff --git a/compiler/testData/diagnostics/tests/inner/traits.fir.kt b/compiler/testData/diagnostics/tests/inner/traits.fir.kt deleted file mode 100644 index 7135bf91889..00000000000 --- a/compiler/testData/diagnostics/tests/inner/traits.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// KT-1188 - -interface Foo { - val b : Bar - val b1 : Foo.Bar - interface Bar {} -} - -interface Foo2 : Foo { - val bb1 : Foo.Bar -} diff --git a/compiler/testData/diagnostics/tests/inner/traits.kt b/compiler/testData/diagnostics/tests/inner/traits.kt index 7135bf91889..f4c830f149c 100644 --- a/compiler/testData/diagnostics/tests/inner/traits.kt +++ b/compiler/testData/diagnostics/tests/inner/traits.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-1188 interface Foo { diff --git a/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.fir.kt b/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.fir.kt deleted file mode 100644 index 08fb60a0a99..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.fir.kt +++ /dev/null @@ -1,49 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: p/G.java - -package p; - -public interface G { -} - -// FILE: p/A.kt - -package p; - -public interface A { - fun foo(p: A) -} - -// FILE: p/B.java - -package p; - -public class B implements A { - void foo(A p) {} -} - -// FILE: p/C.java - -package p; - -public class C extends B implements A { -} - -// FILE: p/P.java - -package p; - -public class P { -} - -// FILE: k.kt - -import p.* - -abstract class K: C

() { - -} - -abstract class AL: java.util.ArrayList

() { - -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.kt b/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.kt index 08fb60a0a99..1b72f78593c 100644 --- a/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.kt +++ b/compiler/testData/diagnostics/tests/j+k/GenericsInSupertypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // FILE: p/G.java diff --git a/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.fir.kt b/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.fir.kt deleted file mode 100644 index de2cd55d562..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// FILE: p/A.java - -package p; - -public interface A { - void foo(TA p); -} - -// FILE: p/B.java - -package p; - -public class B implements A { - void foo(TB p) {} -} - -// FILE: p/C.java - -package p; - -public class C extends B implements A { -} - -// FILE: k.kt - -import p.* - -abstract class K: C() { - -} diff --git a/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.kt b/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.kt index de2cd55d562..2080c92eb95 100644 --- a/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.kt +++ b/compiler/testData/diagnostics/tests/j+k/InheritedGenericFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/A.java package p; diff --git a/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.fir.kt b/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.fir.kt deleted file mode 100644 index cb9f85d3466..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: Bar.java -public class Bar implements Foo { -public interface I extends Boo { -} -} - -// FILE: Baz.kt -public interface Foo { - companion object { - public val EMPTY: Foo = object : Foo{} - } -} - -interface Boo - -public class Baz : Bar.I \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.kt b/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.kt index cb9f85d3466..24a1b0e6f10 100644 --- a/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.kt +++ b/compiler/testData/diagnostics/tests/j+k/InnerClassFromJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Bar.java public class Bar implements Foo { public interface I extends Boo { diff --git a/compiler/testData/diagnostics/tests/j+k/KJKInheritance.fir.kt b/compiler/testData/diagnostics/tests/j+k/KJKInheritance.fir.kt deleted file mode 100644 index dc8ab1f5d86..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/KJKInheritance.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: K1.kt -open class KFirst() { - fun foo() { - } -} - -// FILE: J1.java -public class J1 extends KFirst { - void baz() {} -} - -// FILE: K2.kt -class K2: J1() { - fun bar() { - foo() - baz() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/KJKInheritance.kt b/compiler/testData/diagnostics/tests/j+k/KJKInheritance.kt index dc8ab1f5d86..a2e9cd1bf1f 100644 --- a/compiler/testData/diagnostics/tests/j+k/KJKInheritance.kt +++ b/compiler/testData/diagnostics/tests/j+k/KJKInheritance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: K1.kt open class KFirst() { fun foo() { diff --git a/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.fir.kt b/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.fir.kt deleted file mode 100644 index 2c184f5e70d..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: K1.kt -open class KFirst() { - fun foo(t: T): T = t -} - -// FILE: J1.java -public class J1 extends KFirst { - void baz() {} -} - -// FILE: K2.kt -class K2: J1() { - fun bar() { - foo(1) - baz() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.kt b/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.kt index 2c184f5e70d..d706ffe949f 100644 --- a/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.kt +++ b/compiler/testData/diagnostics/tests/j+k/KJKInheritanceGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: K1.kt open class KFirst() { fun foo(t: T): T = t diff --git a/compiler/testData/diagnostics/tests/j+k/OverrideVararg.fir.kt b/compiler/testData/diagnostics/tests/j+k/OverrideVararg.fir.kt deleted file mode 100644 index 2d26101c4ee..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/OverrideVararg.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: Aaa.java -// http://youtrack.jetbrains.com/issue/KT-1694 - -public abstract class Aaa { - public abstract void foo(String... args); -} - -// FILE: bbb.kt - -class Bbb() : Aaa() { - override fun foo(vararg args: String?) = Unit -} diff --git a/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt b/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt index 2d26101c4ee..105ca31d127 100644 --- a/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt +++ b/compiler/testData/diagnostics/tests/j+k/OverrideVararg.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Aaa.java // http://youtrack.jetbrains.com/issue/KT-1694 diff --git a/compiler/testData/diagnostics/tests/j+k/Simple.fir.kt b/compiler/testData/diagnostics/tests/j+k/Simple.fir.kt deleted file mode 100644 index c82f272c811..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/Simple.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// FILE: aa/A.java -package aa; - -public class A { - public void f() { } -} - -// FILE: B.kt -import aa.A - -fun foo(a: A) = a.f() diff --git a/compiler/testData/diagnostics/tests/j+k/Simple.kt b/compiler/testData/diagnostics/tests/j+k/Simple.kt index c82f272c811..3b9280cd6a6 100644 --- a/compiler/testData/diagnostics/tests/j+k/Simple.kt +++ b/compiler/testData/diagnostics/tests/j+k/Simple.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: aa/A.java package aa; diff --git a/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.fir.kt b/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.fir.kt deleted file mode 100644 index 0f3bd459335..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: Aaa.java -// http://youtrack.jetbrains.com/issue/KT-1880 - -public class Aaa { - public static final int i = 1; -} - -// FILE: Bbb.java - -public class Bbb extends Aaa { - public static final String i = "s"; -} - -// FILE: b.kt - -fun foo() = Bbb.i diff --git a/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.kt b/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.kt index 0f3bd459335..ae506c9ebd2 100644 --- a/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.kt +++ b/compiler/testData/diagnostics/tests/j+k/StaticMembersFromSuperclasses.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Aaa.java // http://youtrack.jetbrains.com/issue/KT-1880 diff --git a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.fir.kt b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.fir.kt deleted file mode 100644 index 1823253b9b3..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: A.java -public class A {} - -// FILE: X.java -public class X { - T foo() {return null;} - void bar(T a) {} -} - -// FILE: Y.java -public class Y extends X { - -} - -// FILE: test.kt - -fun main() { - Y().foo().length - Y().bar(null) -} diff --git a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.kt b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.kt index 1823253b9b3..2bbacbf8a1b 100644 --- a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.kt +++ b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-SpecialTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A {} diff --git a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.fir.kt b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.fir.kt deleted file mode 100644 index cc28efdcaa2..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: A.java -public class A {} - -// FILE: X.java -public class X { - T foo() {return null;} - void bar(T a) {} -} - -// FILE: Y.java -public class Y extends X { - -} - -// FILE: test.kt - -fun main() { - Y().foo().hashCode() - Y().bar(null) -} diff --git a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.kt b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.kt index cc28efdcaa2..74297027fbc 100644 --- a/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.kt +++ b/compiler/testData/diagnostics/tests/j+k/SupertypeArgumentsNullability-UserTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A {} diff --git a/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.fir.kt b/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.fir.kt deleted file mode 100644 index f988db2b0e2..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: a/Test.java -package a; - -public class Test { - T t() {return null;} -} -// FILE: b.kt -package a - -fun foo() { - // If this fails, it means that we have broken the rule that Java returns are always nullable - a.Test().t() + 1 -} diff --git a/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.kt b/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.kt index f988db2b0e2..d7ca84be22a 100644 --- a/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.kt +++ b/compiler/testData/diagnostics/tests/j+k/UnboxingNulls.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a/Test.java package a; diff --git a/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.fir.kt b/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.fir.kt deleted file mode 100644 index 90f3fc6ea16..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: A.java -@missing.Ann(x = "") -public class A { - @missing.Ann(1) - public String foo() {} -} - -// FILE: main.kt - -fun main() { - A().foo().length -} diff --git a/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.kt b/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.kt index 90f3fc6ea16..b4917cc832c 100644 --- a/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.kt +++ b/compiler/testData/diagnostics/tests/j+k/annotationWithArgumentsMissingDependencies.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java @missing.Ann(x = "") public class A { diff --git a/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.fir.kt b/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.fir.kt deleted file mode 100644 index 1764b09b343..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: MyAnnotation.java -public @interface MyAnnotation { -} -// FILE: MyAnnoClass.java -public class MyAnnoClass implements MyAnnotation { -//... -} - -// FILE: main.kt - -val ann: MyAnnotation = MyAnnoClass() - -fun foo(x: MyAnnoClass) { - bar(x) -} - -fun bar(y: MyAnnotation) { - y.hashCode() -} diff --git a/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.kt b/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.kt index 1764b09b343..b53d1256c39 100644 --- a/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.kt +++ b/compiler/testData/diagnostics/tests/j+k/annotationsInheritance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: MyAnnotation.java public @interface MyAnnotation { } diff --git a/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.fir.kt b/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.fir.kt deleted file mode 100644 index 928b78be8ea..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: Hello.kt -private class Hello() -{ - val a = 4 -} - -fun test() { - // no exception is thrown (see KT-3897) - Hello().a -} - -// FILE: Hello.java -public class Hello {} diff --git a/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.kt b/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.kt index 928b78be8ea..0626e104442 100644 --- a/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.kt +++ b/compiler/testData/diagnostics/tests/j+k/brokenCode/classDuplicates.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Hello.kt private class Hello() { diff --git a/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.fir.kt b/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.fir.kt deleted file mode 100644 index 86149c53609..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// FILE: A.java -public class A { - public static void foo() {} - public static void foo(String x) {} - - private void foo(int y) {} -} - -// FILE: main.kt - -fun baz(x: (String) -> Unit) {} - -fun bar() { - baz(A::foo) -} diff --git a/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.kt b/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.kt index 86149c53609..c39807429f1 100644 --- a/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.kt +++ b/compiler/testData/diagnostics/tests/j+k/callableReferencesStaticMemberClash.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.fir.kt deleted file mode 100644 index 1b32d392513..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: CharBuffer.java - -public class CharBuffer implements CharSequence { - public final int length() { - return 0; - } - - public final char charAt(int index) { - return get(position() + checkIndex(index, 1)); - } - - // The key problem here is that `get` has the same signature as kotlin.CharSequence.get but completely different semantics - public abstract char get(int index); - public abstract CharBuffer subSequence(int start, int end); -} - -// FILE: main.kt - -fun test(cb: CharBuffer) { - cb.get(0) - (cb as CharSequence).get(0) -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.kt index 1b32d392513..88eba76bc2d 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/charBuffer.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: CharBuffer.java public class CharBuffer implements CharSequence { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt deleted file mode 100644 index 08b86b53d45..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt +++ /dev/null @@ -1,85 +0,0 @@ -// FILE: CollectionStringImpl.java - -import java.util.Collection; -import java.util.Iterator; - -public class CollectionStringImpl implements Collection { - @Override - public int size() { - return 0; - } - - @Override - public boolean isEmpty() { - return false; - } - - @Override - public boolean contains(Object o) { - return false; - } - - - @Override - public Iterator iterator() { - return null; - } - - - @Override - public Object[] toArray() { - return new Object[0]; - } - - - @Override - public T[] toArray(T[] a) { - return null; - } - - @Override - public boolean add(String s) { - return false; - } - - @Override - public boolean remove(Object o) { - return false; - } - - @Override - public boolean containsAll(Collection c) { - return false; - } - - @Override - public boolean addAll(Collection c) { - return false; - } - - @Override - public boolean removeAll(Collection c) { - return false; - } - - @Override - public boolean retainAll(Collection c) { - return false; - } - - @Override - public void clear() { - - } - - public boolean contains(String o) { - return true; - } -} - -// FILE: main.kt - -fun test(x: CollectionStringImpl) { - x.contains("") - (x as Collection).contains("") -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.kt index 08b86b53d45..13e04293af0 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: CollectionStringImpl.java import java.util.Collection; diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.fir.kt deleted file mode 100644 index 40c49d09a1a..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// FILE: A.java -abstract public class A implements CharSequence { - public char charAt(int x) { } - public int length() { return 1; } -} - -// FILE: C.java -abstract public class C implements CharSequence { - public char get(int x) { } - public int length() { return 1; } -} - -// FILE: main.kt - -abstract class B : A(), CharSequence { - override operator fun get(index: Int) = '1' - override val length: Int get() = 1 -} - -fun main(a: A, b: B, c: C) { - a[0] - b[0] - c[0] - - a.get(0) - b.get(0) - c.get(0) - - a.length + b.length + c.length -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt index 40c49d09a1a..39b9b5ecaf2 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/getCharSequence.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java abstract public class A implements CharSequence { public char charAt(int x) { } diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.fir.kt deleted file mode 100644 index 8462a985da9..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: A.java - -public abstract class A { - abstract public char charAt(int i); -} - -// FILE: B.java - -abstract public class B extends A implements CharSequence { - public char charAt(int i) { return '1'; } -} - -// FILE: main.kt - -abstract class C1 : B() - -abstract class C2 : B() { - override fun get(index: Int) = '1' -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt index 8462a985da9..29c0f640c3b 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantCharAtAbstract.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public abstract class A { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.fir.kt deleted file mode 100644 index e544b2be1c8..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// FILE: AImpl.java - -abstract public class AImpl { - public char charAt(int index) { - return '1'; - } - - public final int length() { return 1; } -} - -// FILE: A.java -public class A extends AImpl implements CharSequence { - public CharSequence subSequence(int start, int end) { - return null; - } -} - -// FILE: X.kt -class X : A() - -fun main() { - val x = X() - x[0] - x.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.kt index e544b2be1c8..1bafe6c0180 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequence.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: AImpl.java abstract public class AImpl { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.fir.kt deleted file mode 100644 index 65a03831ee2..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// FILE: AImpl.kt - -abstract class AImpl { - fun charAt(index: Int): Char { - return '1' - } - - fun length(): Int { - return 1 - } -} - -// FILE: A.java -public class A extends AImpl implements CharSequence { - public CharSequence subSequence(int start, int end) { - return null; - } -} - -// FILE: X.kt -class X : A() - -fun main() { - val x = X() - x[0] - x.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.kt index 65a03831ee2..7110f89949b 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantImplCharSequenceKotlin.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: AImpl.kt diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.fir.kt deleted file mode 100644 index 409e6ed8c49..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: Dict.java - -public abstract class Dict { - abstract public V get(Object key); -} - -// FILE: MHashtable.java - -abstract public class MHashtable extends Dict implements java.util.Map { - public V get(Object key) { return null; } -} - -// FILE: main.kt - -abstract class C1 : MHashtable() - -abstract class C2 : MHashtable() { - override fun get(key: String) = 1 -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt index 409e6ed8c49..586d232e4f4 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/irrelevantMapGetAbstract.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Dict.java public abstract class Dict { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.fir.kt deleted file mode 100644 index c357b29c46a..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -// JAVAC_EXPECTED_FILE -// FILE: MyMap.java - -abstract public class MyMap extends java.util.AbstractMap { - String get(Object q) { } -} - -// FILE: main.kt - -fun foo(m: MyMap) { - var x: String? = m.get(1.0) - x = m[2.0] -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.kt index c357b29c46a..7cbe786b110 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE // JAVAC_EXPECTED_FILE // FILE: MyMap.java diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.fir.kt deleted file mode 100644 index bf5a5332a11..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: A.java -abstract public class A extends B { - public F remove(int x) { } - public boolean remove(Object x) { } -} - -// FILE: main.kt -import java.util.*; - -abstract class B : MutableList, AbstractList() { - override fun removeAt(index: Int): T = null!! - override fun remove(element: T): Boolean = null!! -} - -fun main(a: A, b: B, c: ArrayList) { - a.remove("") - a.removeAt(0) - b.remove("") - b.removeAt(0) - c.remove("") - c.removeAt(0) -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.kt index bf5a5332a11..25c02d03d9b 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // FILE: A.java abstract public class A extends B { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt deleted file mode 100644 index 90ecc2b0a35..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: A.java -abstract public class A extends B { - public Integer removeAt(int x) { } - public boolean remove(Integer x) { } -} - -// FILE: main.kt -import java.util.*; - -abstract class B : MutableList, AbstractList() { - override fun removeAt(index: Int): Int = null!! - override fun remove(element: Int): Boolean = null!! -} - -fun main(a: A, b: B, c: ArrayList) { - a.remove(1) - a.removeAt(0) - b.remove(1) - b.removeAt(0) - c.remove(1) - c.removeAt(0) -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.kt index 90ecc2b0a35..10fb23dd26d 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // FILE: A.java abstract public class A extends B { diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.fir.kt deleted file mode 100644 index bd214138ce0..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: A.java - -abstract public class A extends MyList { - int getSize() { return 0; } -} - -// FILE: main.kt - -abstract class MyList : Collection {} - -fun main(a: A) { - a.size -} diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.kt index bd214138ce0..c59b130a454 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/sizeFromKotlinOverriddenInJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java abstract public class A extends MyList { diff --git a/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.fir.kt b/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.fir.kt deleted file mode 100644 index abd047b6ccd..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: MyFunc.java -public interface MyFunc { - V apply(K String); -} - -// FILE: ConcMap.java -public interface ConcMap { - V computeIfAbsent(K key, MyFunc mappingFunction); -} - -// FILE: ConcHashMap.java -public class ConcHashMap implements ConcMap { - @Override - V computeIfAbsent(K key, MyFunc mappingFunction) { } -} - -// FILE: main.kt - -public fun concurrentMap() { - val map = ConcHashMap() - map.computeIfAbsent("") { "" } // here -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.kt b/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.kt index abd047b6ccd..d4297708378 100644 --- a/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.kt +++ b/compiler/testData/diagnostics/tests/j+k/computeIfAbsentConcurrent.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: MyFunc.java public interface MyFunc { V apply(K String); diff --git a/compiler/testData/diagnostics/tests/j+k/contravariantIterable.fir.kt b/compiler/testData/diagnostics/tests/j+k/contravariantIterable.fir.kt deleted file mode 100644 index 6a78efd5e2e..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/contravariantIterable.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: A.java -import java.util.*; -public class A { - public static void foo(Iterable x) {} - public static void bar(Iterator x) {} -} - -// FILE: main.kt - -fun test(x: List, y: List<*>, z: MutableList<*>, w: MutableList) { - A.foo(x) - A.foo(y) - A.foo(z) - A.foo(w) - - A.bar(x.iterator()) - A.bar(y.iterator()) - A.bar(z.iterator()) - A.bar(w.iterator()) -} diff --git a/compiler/testData/diagnostics/tests/j+k/contravariantIterable.kt b/compiler/testData/diagnostics/tests/j+k/contravariantIterable.kt index 6a78efd5e2e..1796fbd6736 100644 --- a/compiler/testData/diagnostics/tests/j+k/contravariantIterable.kt +++ b/compiler/testData/diagnostics/tests/j+k/contravariantIterable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java import java.util.*; public class A { diff --git a/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.fir.kt b/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.fir.kt deleted file mode 100644 index e5f13b1d851..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: MyEnum.java - -public enum MyEnum { - A; - public int getOrdinal() {return "";} -} - -// FILE: main.kt - -fun foo() { - MyEnum.A.getOrdinal() -} diff --git a/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.kt b/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.kt index e5f13b1d851..3ba7005d306 100644 --- a/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.kt +++ b/compiler/testData/diagnostics/tests/j+k/enumGetOrdinal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: MyEnum.java public enum MyEnum { diff --git a/compiler/testData/diagnostics/tests/j+k/exceptionMessage.fir.kt b/compiler/testData/diagnostics/tests/j+k/exceptionMessage.fir.kt deleted file mode 100644 index cbc8640a180..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/exceptionMessage.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// JAVAC_EXPECTED_FILE -// FILE: VcsException.java -import org.jetbrains.annotations.NotNull; - -public class VcsException extends Exception { - @Override - @NotNull - public String getMessage() { - return ""; - } -} - -// FILE: main.kt -fun foo(e: VcsException) { - e.message.contains("") - "" in e.message -} - -public operator fun CharSequence.contains(other: CharSequence): Boolean = true diff --git a/compiler/testData/diagnostics/tests/j+k/exceptionMessage.kt b/compiler/testData/diagnostics/tests/j+k/exceptionMessage.kt index cbc8640a180..720e91bf712 100644 --- a/compiler/testData/diagnostics/tests/j+k/exceptionMessage.kt +++ b/compiler/testData/diagnostics/tests/j+k/exceptionMessage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // JAVAC_EXPECTED_FILE // FILE: VcsException.java diff --git a/compiler/testData/diagnostics/tests/j+k/flexibleNothing.fir.kt b/compiler/testData/diagnostics/tests/j+k/flexibleNothing.fir.kt deleted file mode 100644 index 942b41dd65c..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/flexibleNothing.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !WITH_NEW_INFERENCE - -// FILE: TestClass.java -import org.jetbrains.annotations.Nullable; -public class TestClass { - public T set(@Nullable String key, @Nullable T t) { - return t; - } -} - -// FILE: main.kt -fun run() { - val testClass = TestClass() - // inferred as `set()`, return type is Nothing! - testClass.set("test", null) - - // Should not be unreachable - run() -} diff --git a/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt b/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt index 942b41dd65c..6e2e7b234a1 100644 --- a/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt +++ b/compiler/testData/diagnostics/tests/j+k/flexibleNothing.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // FILE: TestClass.java diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.fir.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.fir.kt deleted file mode 100644 index b63283686ce..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: R.java -public class R> { - public > R(F x) { - } -} - -// FILE: RImpl.java -public class RImpl extends R { - public RImpl() { - super(null); - } -} - -// FILE: main.kt -fun test() { - val x: R = R(RImpl()) - R(RImpl()) -} diff --git a/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.kt b/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.kt index b63283686ce..3b6736f0236 100644 --- a/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.kt +++ b/compiler/testData/diagnostics/tests/j+k/genericConstructor/selfTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: R.java public class R> { diff --git a/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.fir.kt b/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.fir.kt deleted file mode 100644 index 7ddceb7a976..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: A.java -public interface A { - void foo(Runnable r); -} - -// FILE: B.java -public interface B extends A { - public void bar(Runnable r); -} - -// FILE: test.kt -class C: B { - override fun foo(r: Runnable?) { - } - - override fun bar(r: Runnable?) { - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.kt b/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.kt index 7ddceb7a976..f9b648ecac7 100644 --- a/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.kt +++ b/compiler/testData/diagnostics/tests/j+k/inheritAbstractSamAdapter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A { void foo(Runnable r); diff --git a/compiler/testData/diagnostics/tests/j+k/javaStaticImport.fir.kt b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.fir.kt deleted file mode 100644 index 72f4f0629bd..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/javaStaticImport.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: backend/asmutil/AsmUtil.java -package backend.asmutil; - -import org.jetbrains.annotations.NotNull; -import static frontend.JvmDeclarationOrigin.NO_ORIGIN; - -public class AsmUtil { - - @NotNull - public static String doSmth(String s) { - Object or = NO_ORIGIN; - return "OK"; - } -} - -// FILE: First.kt -package frontend -public class JvmDeclarationOrigin { - companion object { - public val NO_ORIGIN: JvmDeclarationOrigin = JvmDeclarationOrigin() - } -} - -// FILE: Second.kt -package backend - -import backend.asmutil.AsmUtil.doSmth - -open public class ECallable { - fun test() { - doSmth("") - } -} - -/* KT-5848 */ - diff --git a/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt index 72f4f0629bd..3f259d76734 100644 --- a/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt +++ b/compiler/testData/diagnostics/tests/j+k/javaStaticImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // FILE: backend/asmutil/AsmUtil.java package backend.asmutil; diff --git a/compiler/testData/diagnostics/tests/j+k/kt1402.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt1402.fir.kt deleted file mode 100644 index 40e71ec651e..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt1402.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// FILE: a/M.java -package a; - -public class M { - public static class Inner { - private int i; - public Inner(int i) { - this.i = i; - } - - public int getI() { - return i; - } - } -} - -// FILE: b.kt -package b - -import a.M.Inner - -fun foo() { - doSmth(Inner(87)) -} - -fun doSmth(b: Inner) = b diff --git a/compiler/testData/diagnostics/tests/j+k/kt1402.kt b/compiler/testData/diagnostics/tests/j+k/kt1402.kt index 40e71ec651e..63d71209d05 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt1402.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt1402.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a/M.java package a; diff --git a/compiler/testData/diagnostics/tests/j+k/kt1431.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt1431.fir.kt deleted file mode 100644 index 971257ededc..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt1431.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -//FILE: a/C.java -// KT-1431 StackOverflowException in IDE when using JavaFX builders -package a; - -public class C> { - public static C create() { return null; } - public C foo() {return null;} -} - -//FILE: d.kt -package d - -import a.C - -fun test() { - C.create().foo() -} diff --git a/compiler/testData/diagnostics/tests/j+k/kt1431.kt b/compiler/testData/diagnostics/tests/j+k/kt1431.kt index 971257ededc..2f0d88523f0 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt1431.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt1431.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE: a/C.java // KT-1431 StackOverflowException in IDE when using JavaFX builders package a; diff --git a/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.fir.kt deleted file mode 100644 index 7efe604a0e4..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// KT-1730 Method which has been implemented by Java is recognized to be abstract. - -// FILE: C.java -public class C implements java.lang.CharSequence { - @Override - public int length() { - return 3; - } - @Override - public char charAt(int index) { - return 48; - } - @Override - public CharSequence subSequence(int start, int end) { - return "ab"; - } - @Override - public String toString() { - return "abc"; - } -} - -// FILE: T.kt -class T : C() diff --git a/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.kt b/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.kt index 7efe604a0e4..5ff49bd9058 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt1730_implementCharSequence.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-1730 Method which has been implemented by Java is recognized to be abstract. // FILE: C.java diff --git a/compiler/testData/diagnostics/tests/j+k/kt2152.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt2152.fir.kt deleted file mode 100644 index 113ca5b4bb7..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt2152.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -//FILE: Bbb.kt -open class Bbb - -//FILE: Ccc.java -public class Ccc extends Bbb { -} - -//FILE: Ddd.kt -import Ccc - diff --git a/compiler/testData/diagnostics/tests/j+k/kt2152.kt b/compiler/testData/diagnostics/tests/j+k/kt2152.kt index 113ca5b4bb7..aba17588c08 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2152.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2152.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE: Bbb.kt open class Bbb diff --git a/compiler/testData/diagnostics/tests/j+k/kt2394.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt2394.fir.kt deleted file mode 100644 index 877f140f272..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt2394.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !CHECK_TYPE - -//KT-2394 java.lang.Iterable should be visible as kotlin.Iterable -package d - -fun foo(iterable: Iterable, iterator: Iterator, comparable: Comparable) { - checkSubtype>(iterable) - checkSubtype>(iterator) - checkSubtype>(comparable) -} - -fun bar(c: Collection) { - checkSubtype>(c) - checkSubtype>(c.iterator()) -} diff --git a/compiler/testData/diagnostics/tests/j+k/kt2394.kt b/compiler/testData/diagnostics/tests/j+k/kt2394.kt index 877f140f272..26365f9af3b 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt2394.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt2394.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE //KT-2394 java.lang.Iterable should be visible as kotlin.Iterable diff --git a/compiler/testData/diagnostics/tests/j+k/kt3307.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt3307.fir.kt deleted file mode 100644 index 340842481bc..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt3307.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// FILE: Bug.java - -public interface Bug { - RET save(); -} - -// FILE: SubBug.java - -public class SubBug implements Bug { - public SubBug save() { - return this; - } -} - -// FILE: Bug.kt - -fun TestBug() { - SubBug().save() // can resolve on subtype - val bug: Bug = SubBug() - bug.save() // can resolve on supertype -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/kt3307.kt b/compiler/testData/diagnostics/tests/j+k/kt3307.kt index 340842481bc..8f7f8c5cb39 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt3307.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt3307.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Bug.java public interface Bug { diff --git a/compiler/testData/diagnostics/tests/j+k/kt3311.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt3311.fir.kt deleted file mode 100644 index 080e29b9e9b..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt3311.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: Super.java -public class Super { - public boolean foo; - public boolean bar; - - public void setFoo(boolean foo) { - this.foo = foo; - } -} - -// FILE: b.kt -public class Sub: Super() { -} - -fun main() { - val x = Sub() - x.foo = true - x.bar = true -} diff --git a/compiler/testData/diagnostics/tests/j+k/kt3311.kt b/compiler/testData/diagnostics/tests/j+k/kt3311.kt index 080e29b9e9b..0fcb8766243 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt3311.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt3311.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Super.java public class Super { public boolean foo; diff --git a/compiler/testData/diagnostics/tests/j+k/kt7523.fir.kt b/compiler/testData/diagnostics/tests/j+k/kt7523.fir.kt deleted file mode 100644 index 64e8ab34bc1..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/kt7523.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: A.java -public interface A, S extends A> {} - -// FILE: C.java -public class C -{ - public , S extends A> void f(A x){} -} - -// FILE: main.kt -fun foo() { - // TODO: uncomment when KT-9597 is fixed - // C().f(object : A<*, *> {}) -} diff --git a/compiler/testData/diagnostics/tests/j+k/kt7523.kt b/compiler/testData/diagnostics/tests/j+k/kt7523.kt index 64e8ab34bc1..7c5778b6ecf 100644 --- a/compiler/testData/diagnostics/tests/j+k/kt7523.kt +++ b/compiler/testData/diagnostics/tests/j+k/kt7523.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A, S extends A> {} diff --git a/compiler/testData/diagnostics/tests/j+k/matchers.fir.kt b/compiler/testData/diagnostics/tests/j+k/matchers.fir.kt deleted file mode 100644 index 6d65c7863e9..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/matchers.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: Assert.java - -public class Assert { - public static void assertThat(T actual, Matcher matcher) { - } -} - -// FILE: Matcher.java -public class Matcher { - public static Matcher> hasItem(T item) { - return null; - } -} - -// FILE: main.kt -fun test(x: List) { - Assert.assertThat(x, Matcher.hasItem("abc")) -} diff --git a/compiler/testData/diagnostics/tests/j+k/matchers.kt b/compiler/testData/diagnostics/tests/j+k/matchers.kt index 6d65c7863e9..d28dc9a645e 100644 --- a/compiler/testData/diagnostics/tests/j+k/matchers.kt +++ b/compiler/testData/diagnostics/tests/j+k/matchers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Assert.java public class Assert { diff --git a/compiler/testData/diagnostics/tests/j+k/mutableIterator.fir.kt b/compiler/testData/diagnostics/tests/j+k/mutableIterator.fir.kt deleted file mode 100644 index 9f24f78c48c..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/mutableIterator.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -//FILE:a/JC.java -package a; - -import java.util.Iterator; - -public interface JC { - public Iterator getIterator(); - - public void setIterator(Iterator iterator); - - public Iterable getIterable(); - - public void setIterable(Iterable iterable); -} - -//FILE:n.kt -package n - -import a.JC - -fun foo(c: JC, iterator: Iterator, iterable: Iterable) { - val mutableIterator: MutableIterator? = c.getIterator() - c.setIterator(mutableIterator) - c.setIterator(iterator) - - val mutableIterable: MutableIterable? = c.getIterable() - c.setIterable(mutableIterable) - c.setIterable(iterable) -} diff --git a/compiler/testData/diagnostics/tests/j+k/mutableIterator.kt b/compiler/testData/diagnostics/tests/j+k/mutableIterator.kt index 9f24f78c48c..3415ea142ba 100644 --- a/compiler/testData/diagnostics/tests/j+k/mutableIterator.kt +++ b/compiler/testData/diagnostics/tests/j+k/mutableIterator.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:a/JC.java package a; diff --git a/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.fir.kt b/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.fir.kt deleted file mode 100644 index b3ac1902278..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FULL_JDK - -import java.util.* -import java.util.stream.Stream - -fun Stream?.getIfSingle() = - this?.map { Optional.ofNullable(it) } - ?.reduce(Optional.empty()) { _, _ -> Optional.empty() } - ?.orElse(null) // <<---- should not be an error diff --git a/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.kt b/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.kt index b3ac1902278..625ea81f4b1 100644 --- a/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.kt +++ b/compiler/testData/diagnostics/tests/j+k/nullForOptionalOrElse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK import java.util.* diff --git a/compiler/testData/diagnostics/tests/j+k/overrideRawType.fir.kt b/compiler/testData/diagnostics/tests/j+k/overrideRawType.fir.kt deleted file mode 100644 index 4772e9a77c0..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/overrideRawType.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -//FILE: Foo.java -public class Foo { -} - -//FILE: Bar.java -public interface Bar { - void f(Foo f); -} - -//FILE: a.kt -class BarImpl: Bar { - override fun f(f: Foo<*>?) { - throw UnsupportedOperationException() - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/overrideRawType.kt b/compiler/testData/diagnostics/tests/j+k/overrideRawType.kt index 4772e9a77c0..d2d7ed5ee09 100644 --- a/compiler/testData/diagnostics/tests/j+k/overrideRawType.kt +++ b/compiler/testData/diagnostics/tests/j+k/overrideRawType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE: Foo.java public class Foo { } diff --git a/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.fir.kt b/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.fir.kt deleted file mode 100644 index 8ce4c73cbd9..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: MyFunc.java - -public interface MyFunc { - String apply(String x); -} - -// FILE: A.java -public interface A { - K foo(K key, MyFunc f); -} - -// FILE: B.java -public class B implements A { - @Override - public E foo(E key, MyFunc f) {return null;} -} - -// FILE: main.kt - -fun main() { - B().foo("") { "" } -} diff --git a/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.kt b/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.kt index 8ce4c73cbd9..4544a06b760 100644 --- a/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/j+k/overrideWithSamAndTypeParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: MyFunc.java public interface MyFunc { diff --git a/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.fir.kt b/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.fir.kt deleted file mode 100644 index b93b076994c..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// KT-4021 Java's Package visibilty does not work for static methods - -// FILE: foo/Bar.java - -package foo; - -class Bar { - static void baz() {} -} - -// FILE: main.kt - -package foo - -fun main() { - Bar.baz() -} diff --git a/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.kt b/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.kt index b93b076994c..44df47fbf42 100644 --- a/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.kt +++ b/compiler/testData/diagnostics/tests/j+k/packagePrivateClassStaticMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-4021 Java's Package visibilty does not work for static methods // FILE: foo/Bar.java diff --git a/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.fir.kt b/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.fir.kt deleted file mode 100644 index c4ff078edd2..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !LANGUAGE: +InlineClasses -// FILE: kt1.kt -package kt - -inline class Z(val value: Int) - -interface IFoo { - fun foo(): T -} - -open class KFooZ : IFoo { - override fun foo(): Z = Z(42) -} - -// FILE: j/J.java -package j; - -import kt.Z; -import kt.KFooZ; - -public class J extends KFooZ { -} - -// FILE: kt2.kt -package kt - -import j.J - -fun jfoo(x: J) = x.foo() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.kt b/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.kt index c4ff078edd2..77873fc8132 100644 --- a/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.kt +++ b/compiler/testData/diagnostics/tests/j+k/primitiveOverridesWithInlineClass/inlineClassErasedToPrimitiveInt.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +InlineClasses // FILE: kt1.kt package kt diff --git a/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.fir.kt b/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.fir.kt deleted file mode 100644 index 56516cd67e4..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: B.java - -public abstract class B implements A { - private int size = 1; -} - -// FILE: main.kt - -interface A { - val size: Int -} - -class C : B() { - override val size: Int get() = 1 -} - -fun foo() { - C().size -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.kt b/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.kt index 56516cd67e4..65eda89dc98 100644 --- a/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.kt +++ b/compiler/testData/diagnostics/tests/j+k/privateFieldOverridesNothing.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: B.java public abstract class B implements A { diff --git a/compiler/testData/diagnostics/tests/j+k/properties/interface.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/interface.fir.kt deleted file mode 100644 index 7c3c81e57f5..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/properties/interface.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// FILE: A.java - -public interface A extends B { - public int getFoo(); - public void setFoo(int x); -} - -// FILE: BImpl.java - -public class BImpl implements B { - public int getFoo() {} - public void setFoo(int x) {} -} - -// FILE: main.kt - -interface B { - var foo: Int -} - -interface C1 : A { - override var foo: Int -} - -class D : C1, BImpl() - -fun foo() { - BImpl().foo = BImpl().foo + 1 - D().foo = D().foo + 2 -} - - diff --git a/compiler/testData/diagnostics/tests/j+k/properties/interface.kt b/compiler/testData/diagnostics/tests/j+k/properties/interface.kt index 7c3c81e57f5..86a21f55bb0 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/interface.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/interface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A extends B { diff --git a/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.fir.kt b/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.fir.kt deleted file mode 100644 index e51d7bc5689..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: test/JavaClass.java - -package test; - -public class JavaClass { - protected static int field; - - protected static String method() { - return ""; - } -} - -// FILE: test.kt - -package test - -fun test() { - JavaClass.field - JavaClass.method() -} diff --git a/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.kt b/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.kt index e51d7bc5689..26571cf1818 100644 --- a/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.kt +++ b/compiler/testData/diagnostics/tests/j+k/protectedStaticSamePackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: test/JavaClass.java package test; diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.fir.kt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.fir.kt deleted file mode 100644 index 75a5c2333d8..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: Bad.java - -public class Bad {} - -// FILE: X.java - -public class X { - Bad foo() {return null;} -} - -// FILE: Usage.kt - -fun foo(p: X) = p.foo() diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.kt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.kt index 75a5c2333d8..d089a7172eb 100644 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.kt +++ b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Bad.java public class Bad {} diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.fir.kt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.fir.kt deleted file mode 100644 index dfc3e1205f9..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FILE: XYZ.java -public interface XYZ { - XYZ foo() {} -} - -// FILE: main.kt - -fun main(xyz: XYZ<*>) = xyz.foo() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.kt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.kt index dfc3e1205f9..558805779c5 100644 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.kt +++ b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: XYZ.java public interface XYZ { XYZ foo() {} diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.fir.kt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.fir.kt deleted file mode 100644 index 282814ecf53..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FILE: XYZ.java -public interface XYZ { - XYZ foo() {} -} - -// FILE: main.kt - -fun main(xyz: XYZ<*, *, *>) = xyz.foo() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.kt b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.kt index 282814ecf53..e9ac7137b3d 100644 --- a/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.kt +++ b/compiler/testData/diagnostics/tests/j+k/recursiveRawUpperBound3.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: XYZ.java public interface XYZ { XYZ foo() {} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.fir.kt deleted file mode 100644 index 88ae849b8fb..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: BehaviorSubject.java -public class BehaviorSubject extends Observable { -} - -// FILE: Observable.java - -public class Observable { - public static Observable create(Observable.OnSubscribe f) { - return null; - } - public interface OnSubscribe { - void call(T t); - } -} - -// FILE: 1.kt -fun main() { - BehaviorSubject.create(null) - BehaviorSubject.create { } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.kt b/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.kt index 88ae849b8fb..66af0b31e3a 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/fakeOverrideFunctionForStaticSam.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: BehaviorSubject.java public class BehaviorSubject extends Observable { } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.fir.kt deleted file mode 100644 index 0779d3ced95..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: Statics.java - -public class Statics { - public static void foo(Runnable r) {} -} - -// FILE: test.kt - -class A : Statics() { - fun test() { - foo {} - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt index 0779d3ced95..cf2111c8257 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Statics.java public class Statics { diff --git a/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.fir.kt deleted file mode 100644 index 6457136dfdd..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// FILE: MyFuture.java - -public interface MyFuture { - MyFuture addListener(MyListener> listener); -} - -// FILE: MyListener.java - -public interface MyListener> { - void operationComplete(F future) throws Exception; -} - -// FILE: test.kt - -typealias Handler = (cause: Throwable?) -> Unit - -fun MyFuture.setup() { - addListener(ListenerImpl>()) - addListener { } -} - -class ListenerImpl> : MyListener, Handler { - override fun operationComplete(future: F) { - } - - override fun invoke(cause: Throwable?) { - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.kt b/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.kt index 6457136dfdd..f4d975f42ef 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/recursiveSamsAndInvoke.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: MyFuture.java public interface MyFuture { diff --git a/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.fir.kt deleted file mode 100644 index 4b32b73471d..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: FormFieldValidatorPresenterTest.java -public class FormFieldValidatorPresenterTest { - - public void setValidationListenerTest(ValidationListenerTest validationListener) { - } - - public interface ValidationListenerTest { - void onValidityChanged(boolean valid); - } -} -// FILE: main.kt -fun

> setValidationListener( - presenter: P, - validationListener: (Boolean) -> Unit -) { - presenter.setValidationListenerTest(validationListener) // Error: Type mismatch: inferred type is (Boolean) -> Unit but FormFieldValidatorPresenterTest.ValidationListenerTest! was expected -} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt b/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt index 4b32b73471d..cb53fbb128c 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: FormFieldValidatorPresenterTest.java public class FormFieldValidatorPresenterTest { diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.fir.kt deleted file mode 100644 index b299377a168..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: a/Statics.java - -package a; - -public class Statics { - public static void foo(Runnable r) {} -} - -// FILE: test.kt - -package b - -import a.Statics.* - -fun test() { - foo {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt index b299377a168..aee6a07365d 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a/Statics.java package a; diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.fir.kt deleted file mode 100644 index 8c551eed7b3..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: a/Statics.java - -package a; - -public class Statics { - public static void foo(Runnable r) {} -} - -// FILE: test.kt - -package b; - -import a.Statics.foo - -fun test() { - foo {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt index 8c551eed7b3..8499df66e83 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a/Statics.java package a; diff --git a/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.fir.kt deleted file mode 100644 index 544d981203a..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER -// FILE: A.java -public class A { - public void foo(K key, BiFunction remappingFunction) { - - } -} - -// FILE: BiFunction.java -public interface BiFunction { - R apply(T t, U u); -} - -// FILE: main.kt -fun main() { - val a = A() - a.foo(2, BiFunction { k, v -> null }) - a.foo(2) { k, v -> null } // See KT-12144 -} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.kt b/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.kt index 544d981203a..96430f00a56 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.fir.kt deleted file mode 100644 index acc211a1064..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: ALambda.java - -public interface ALambda { - ALambda curried(); - - ALambda tupled(); -} - -// FILE: ACheckedFunction0.java - -public interface ACheckedFunction0 extends ALambda { - - Integer apply(); - - default ALambda curried() { return null; } - default ALambda tupled() { return null; } -} - -// FILE: main.kt -fun test() { - ACheckedFunction0 { 2 } // error: Interface ACheckedFunction0 does not have constructors -} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.kt b/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.kt index acc211a1064..eefba76528d 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/withDefaultMethods.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: ALambda.java public interface ALambda { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.fir.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.fir.kt deleted file mode 100644 index 1da5559f790..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !CHECK_TYPE -// FILE: EventListener.java -public interface EventListener { - void handle(E e); -} - -// FILE: A.java -public class A { - public void foo(EventListener l) { - } - - public static void bar(EventListener l) { - } - - public static void baz(EventListener l) { - } -} - -// FILE: main.kt -fun main() { - A().foo { - x -> x checkType { _() } - } - - A.bar { - x -> x checkType { _() } - } - - A.baz { - x -> x checkType { _() } - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.kt index 1da5559f790..3407c150a08 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.kt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: EventListener.java public interface EventListener { diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.fir.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.fir.kt deleted file mode 100644 index df6128944c8..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !CHECK_TYPE -// FILE: EventListener.java -public interface EventListener { - void handle(E e); -} - -// FILE: A.java -public class A { - public void foo(EventListener l) { - } - - public static void bar(EventListener l) { - } -} - -// FILE: main.kt -fun main() { - A().foo { - x -> x checkType { _() } - } - - A.bar { - x -> x checkType { _() } - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.kt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.kt index df6128944c8..5bf10e12b8a 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.kt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: EventListener.java public interface EventListener { diff --git a/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.fir.kt b/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.fir.kt deleted file mode 100644 index b8695fc6aaa..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// FILE: j/OnSubscribe.java -package j; - -public interface OnSubscribe { - void f(); -} - -// FILE: j/Observable.java -package j; - -public class Observable { - - protected Observable(OnSubscribe f) { - } -} - -// FILE: Kotlin.kt - -import j.* - -class K : Observable({}) - -class J : Observable(null) diff --git a/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.kt b/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.kt index b8695fc6aaa..71584f41c6b 100644 --- a/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.kt +++ b/compiler/testData/diagnostics/tests/j+k/samInConstructorWithGenerics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: j/OnSubscribe.java package j; diff --git a/compiler/testData/diagnostics/tests/j+k/samWithConsumer.fir.kt b/compiler/testData/diagnostics/tests/j+k/samWithConsumer.fir.kt deleted file mode 100644 index 6480f97c171..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/samWithConsumer.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !CHECK_TYPE -// FULL_JDK -// FILE: A.java -import java.util.function.Consumer; - -public class A { - void test(Consumer consumer) {} -} - -// FILE: 1.kt -import java.util.function.Consumer - -fun test(a: A) { - a.test (Consumer { - it checkType { _() } - it.toInt() - }) - - a.test { - it checkType { _() } - it.toInt() - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/samWithConsumer.kt b/compiler/testData/diagnostics/tests/j+k/samWithConsumer.kt index 6480f97c171..1eb31c2372b 100644 --- a/compiler/testData/diagnostics/tests/j+k/samWithConsumer.kt +++ b/compiler/testData/diagnostics/tests/j+k/samWithConsumer.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FULL_JDK // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.fir.kt b/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.fir.kt deleted file mode 100644 index e5d912fd599..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: B.kt - -import aa.B - -fun use() { - // checking that CONST is of platform type - B.CONST = null - B.CONST?.length - B.CONST.length -} - -// FILE: aa/A.java -package aa; - -public class A { - public static int CONST = 3; -} - -// FILE: aa/B.java -package aa; - -public class B extends A { - public static String CONST = null; -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.kt b/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.kt index e5d912fd599..007c0fbd54a 100644 --- a/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.kt +++ b/compiler/testData/diagnostics/tests/j+k/shadowingPrimitiveStaticField.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: B.kt import aa.B diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.fir.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.fir.kt deleted file mode 100644 index 338461c1433..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: BaseClass.java -import org.jetbrains.annotations.NotNull; - -public class BaseClass { - public void loadCache(@NotNull Object... args) {} -} - -// FILE: main.kt - -class A : BaseClass() { - // org.jetbrains.annotations.NotNull has @Target PARAMETER, so it doesn't affect elements type - override fun loadCache(vararg args: Any?) { - super.loadCache(*args) - } -} - -class B : BaseClass() { - // org.jetbrains.annotations.NotNull has @Target PARAMETER, so it doesn't affect elements type - override fun loadCache(vararg args: Any) { - super.loadCache(*args) - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.kt index 338461c1433..88f6b973b82 100644 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.kt +++ b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/notNullVarargOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: BaseClass.java import org.jetbrains.annotations.NotNull; diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.fir.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.fir.kt deleted file mode 100644 index 6d130cdebff..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: BaseClass.java -import org.jetbrains.annotations.Nullable; - -public class BaseClass { - public void loadCache(@Nullable Object... args) {} -} - -// FILE: main.kt - -class A : BaseClass() { - // org.jetbrains.annotations.Nullable has @Target PARAMETER, so it doesn't affect elements type - override fun loadCache(vararg args: Any?) { - super.loadCache(*args) - } -} - -class B : BaseClass() { - // org.jetbrains.annotations.Nullable has @Target PARAMETER, so it doesn't affect elements type - override fun loadCache(vararg args: Any) { - super.loadCache(*args) - } -} diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.kt index 6d130cdebff..ff185c853f2 100644 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.kt +++ b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/nullableVarargOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: BaseClass.java import org.jetbrains.annotations.Nullable; diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.fir.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.fir.kt deleted file mode 100644 index 3b593be43c3..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ - -// FILE: A.java -// ANDROID_ANNOTATIONS -import kotlin.annotations.jvm.internal.*; - -public class A { - public void connect(@ParameterName("host") String host, @ParameterName("port") int port) { - } -} - -// FILE: test.kt -fun main() { - val test = A() - test.connect("127.0.0.1", 8080) - test.connect(host = "127.0.0.1", port = 8080) - test.connect(port = 8080, host = "127.0.0.1") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.kt index 3b593be43c3..4aaa69f7cdb 100644 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.kt +++ b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/reorderedParameterNames.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java // ANDROID_ANNOTATIONS diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.fir.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.fir.kt deleted file mode 100644 index 44c47d2bfc3..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: A.java -// ANDROID_ANNOTATIONS -import kotlin.annotations.jvm.internal.*; - - -public class A { - public void foo(@ParameterName("hello") String world) {} -} - -// FILE: B.kt - -class B : A() { - override fun foo(hello: String) {} -} - -// FILE: C.kt - -class C : A() { -} - diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.kt index 44c47d2bfc3..834176d51cb 100644 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.kt +++ b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/stableParameterName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java // ANDROID_ANNOTATIONS import kotlin.annotations.jvm.internal.*; diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.fir.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.fir.kt deleted file mode 100644 index 6f101ae561b..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// IGNORE_BACKEND: JS, NATIVE - -// FILE: A.java -// ANDROID_ANNOTATIONS - -import kotlin.annotations.jvm.internal.*; - -class A { - public static String withDefault(@DefaultValue("OK") String arg) { - return arg; - } -} - -// FILE: test.kt -fun box(): String { - return A.withDefault(); -} diff --git a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.kt b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.kt index 6f101ae561b..c6dab56099a 100644 --- a/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.kt +++ b/compiler/testData/diagnostics/tests/j+k/signatureAnnotations/staticMethodWithDefaultValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // IGNORE_BACKEND: JS, NATIVE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/j+k/specialBridges.fir.kt b/compiler/testData/diagnostics/tests/j+k/specialBridges.fir.kt deleted file mode 100644 index f83c28a9a99..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/specialBridges.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// JAVAC_EXPECTED_FILE -interface I2 { - val size: Int -} - -class B2 : java.util.ArrayList(), I2 - diff --git a/compiler/testData/diagnostics/tests/j+k/specialBridges.kt b/compiler/testData/diagnostics/tests/j+k/specialBridges.kt index f83c28a9a99..2548ca9fca1 100644 --- a/compiler/testData/diagnostics/tests/j+k/specialBridges.kt +++ b/compiler/testData/diagnostics/tests/j+k/specialBridges.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE interface I2 { val size: Int diff --git a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.fir.kt b/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.fir.kt deleted file mode 100644 index 3fb99cd2976..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// FULL_JDK - -class C1 : java.util.Hashtable() -class C2 : java.util.Hashtable() { - override fun get(key: String) = 123 -} diff --git a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.kt b/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.kt index 3fb99cd2976..6e915ccf91e 100644 --- a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.kt +++ b/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/hashtableInheritance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK class C1 : java.util.Hashtable() diff --git a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.fir.kt b/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.fir.kt deleted file mode 100644 index 9a532723211..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// FULL_JDK - -import java.security.Provider - -class Example : Provider("A", 1.0, "B") diff --git a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.kt b/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.kt index 9a532723211..7849c5231ec 100644 --- a/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.kt +++ b/compiler/testData/diagnostics/tests/j+k/specialBuiltIns/securityProvider.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK import java.security.Provider diff --git a/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.fir.kt b/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.fir.kt deleted file mode 100644 index 06c9a89809d..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: JavaClass.java - -public class JavaClass { - public static String testStatic() { - return "OK"; - } - -} - -// FILE: 1.kt -import JavaClass.testStatic - -fun test() { - JavaClass.testStatic() - testStatic() -} diff --git a/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.kt b/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.kt index 06c9a89809d..a1ac05021d1 100644 --- a/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.kt +++ b/compiler/testData/diagnostics/tests/j+k/staticMethodInClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: JavaClass.java public class JavaClass { diff --git a/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.fir.kt b/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.fir.kt deleted file mode 100644 index ab708f9a374..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: OnSubscribe.java -public interface OnSubscribe { - void f(); -} - -// FILE: Observable.java -public class Observable { - public Observable(OnSubscribe f) { - } -} - -// FILE: Kotlin.kt - -typealias ObservableAlias = Observable -typealias ObservableIntAlias = Observable - -class A : ObservableAlias({}) -class B : ObservableIntAlias({}) diff --git a/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.kt b/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.kt index ab708f9a374..c860f3c8b75 100644 --- a/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.kt +++ b/compiler/testData/diagnostics/tests/j+k/typeAliasWithSamConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: OnSubscribe.java public interface OnSubscribe { void f(); diff --git a/compiler/testData/diagnostics/tests/j+k/types/arrayList.fir.kt b/compiler/testData/diagnostics/tests/j+k/types/arrayList.fir.kt deleted file mode 100644 index 68825e9c8d8..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/types/arrayList.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: k.kt - -interface ML { - public fun foo(): MutableList -} - -class K : J(), ML - -// FILE: J.java - -import java.util.*; - -public class J extends ML { - public List foo() { return null; } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/types/arrayList.kt b/compiler/testData/diagnostics/tests/j+k/types/arrayList.kt index 68825e9c8d8..5d2395ee838 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/arrayList.kt +++ b/compiler/testData/diagnostics/tests/j+k/types/arrayList.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: k.kt interface ML { diff --git a/compiler/testData/diagnostics/tests/j+k/types/returnCollection.fir.kt b/compiler/testData/diagnostics/tests/j+k/types/returnCollection.fir.kt deleted file mode 100644 index 4ead28c1794..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/types/returnCollection.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: k.kt - -interface K { - fun foo(): List -} - -// FILE: J.java - -import java.util.*; - -interface J extends K { - List foo(); -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/types/returnCollection.kt b/compiler/testData/diagnostics/tests/j+k/types/returnCollection.kt index 4ead28c1794..0eba612ee8b 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/returnCollection.kt +++ b/compiler/testData/diagnostics/tests/j+k/types/returnCollection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: k.kt interface K { diff --git a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.fir.kt b/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.fir.kt deleted file mode 100644 index 84c8934b225..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: k.kt - -interface G -interface SubG : G - -interface K { - fun foo(): G - fun bar(): G? -} - -// FILE: J.java - -import java.util.*; - -interface J extends K { - SubG foo(); - SubG bar(); - SubG baz(); -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.kt b/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.kt index 84c8934b225..df74cb5a4fb 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.kt +++ b/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPosition.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: k.kt interface G diff --git a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.fir.kt b/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.fir.kt deleted file mode 100644 index 2ab572dca5a..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: k.kt - -interface G -interface SubG : G - -interface K { - fun foo(): G - fun bar(): G? -} - -// FILE: J.java - -import java.util.*; - -interface J extends K { - SubG> foo(); - SubG> bar(); - SubG> baz(); -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.kt b/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.kt index 2ab572dca5a..b50b0a17535 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.kt +++ b/compiler/testData/diagnostics/tests/j+k/types/shapeMismatchInCovariantPositionGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: k.kt interface G diff --git a/compiler/testData/diagnostics/tests/j+k/types/typeParameter.fir.kt b/compiler/testData/diagnostics/tests/j+k/types/typeParameter.fir.kt deleted file mode 100644 index 550b69b506d..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/types/typeParameter.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// FILE: k.kt - -interface K { - fun foo(t: T) -} - -// FILE: J.java - -interface J extends K { - void foo(T t); -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/types/typeParameter.kt b/compiler/testData/diagnostics/tests/j+k/types/typeParameter.kt index 550b69b506d..2c20cf7d6df 100644 --- a/compiler/testData/diagnostics/tests/j+k/types/typeParameter.kt +++ b/compiler/testData/diagnostics/tests/j+k/types/typeParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: k.kt interface K { diff --git a/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.fir.kt b/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.fir.kt deleted file mode 100644 index 3c918e0f098..00000000000 --- a/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -interface IC { - fun toString(x: String): String = "IC$x" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.kt b/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.kt index 3c918e0f098..48db9b1e370 100644 --- a/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.kt +++ b/compiler/testData/diagnostics/tests/java8Overrides/notAMethodOfAny.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IC { fun toString(x: String): String = "IC$x" } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.fir.kt b/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.fir.kt deleted file mode 100644 index 9fd93ea94b2..00000000000 --- a/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -interface ITop { - fun foo() {} -} - -interface ILeft : ITop - -interface IRight : ITop - -interface IDerived : ILeft, IRight \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.kt b/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.kt index 9fd93ea94b2..960123c139b 100644 --- a/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.kt +++ b/compiler/testData/diagnostics/tests/java8Overrides/singleRelevantDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface ITop { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/kt53.fir.kt b/compiler/testData/diagnostics/tests/kt53.fir.kt deleted file mode 100644 index be726999125..00000000000 --- a/compiler/testData/diagnostics/tests/kt53.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -val T.foo : T? - get() = null - -fun test(): Int? { - return 1.foo -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/kt53.kt b/compiler/testData/diagnostics/tests/kt53.kt index be726999125..3fd9adfc7b3 100644 --- a/compiler/testData/diagnostics/tests/kt53.kt +++ b/compiler/testData/diagnostics/tests/kt53.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val T.foo : T? get() = null diff --git a/compiler/testData/diagnostics/tests/labels/kt3920.fir.kt b/compiler/testData/diagnostics/tests/labels/kt3920.fir.kt deleted file mode 100644 index 9ae310acc38..00000000000 --- a/compiler/testData/diagnostics/tests/labels/kt3920.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -//KT-3920 Labeling information is lost when passing through some expressions - -fun test() { - run f@{ - val x = if (1 > 2) return@f 1 else 2 - 2 - } -} diff --git a/compiler/testData/diagnostics/tests/labels/kt3920.kt b/compiler/testData/diagnostics/tests/labels/kt3920.kt index 9ae310acc38..7403376d85e 100644 --- a/compiler/testData/diagnostics/tests/labels/kt3920.kt +++ b/compiler/testData/diagnostics/tests/labels/kt3920.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE //KT-3920 Labeling information is lost when passing through some expressions diff --git a/compiler/testData/diagnostics/tests/labels/kt4586.fir.kt b/compiler/testData/diagnostics/tests/labels/kt4586.fir.kt deleted file mode 100644 index 80ff4c1115b..00000000000 --- a/compiler/testData/diagnostics/tests/labels/kt4586.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -//KT-4586 this@ does not work for builders - -fun string(init: StringBuilder.() -> Unit): String{ - val answer = StringBuilder() - answer.init() - return answer.toString() -} - -val str = string l@{ - append("hello, ") - - val sub = string { - append("world!") - this@l.append(this) - } -} diff --git a/compiler/testData/diagnostics/tests/labels/kt4586.kt b/compiler/testData/diagnostics/tests/labels/kt4586.kt index 80ff4c1115b..3d58291e034 100644 --- a/compiler/testData/diagnostics/tests/labels/kt4586.kt +++ b/compiler/testData/diagnostics/tests/labels/kt4586.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE //KT-4586 this@ does not work for builders diff --git a/compiler/testData/diagnostics/tests/labels/kt4603.fir.kt b/compiler/testData/diagnostics/tests/labels/kt4603.fir.kt deleted file mode 100644 index 31e6bb298fe..00000000000 --- a/compiler/testData/diagnostics/tests/labels/kt4603.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -//KT-4603 Labeling information is lost when passing through local classes or objects - -fun foo() { - val s: Int.() -> Unit = l@{ - class Local(val y: Int = this@l) { - fun bar() { - val x: Int = this@l //unresolved - } - } - } -} diff --git a/compiler/testData/diagnostics/tests/labels/kt4603.kt b/compiler/testData/diagnostics/tests/labels/kt4603.kt index 31e6bb298fe..e19ee8079dc 100644 --- a/compiler/testData/diagnostics/tests/labels/kt4603.kt +++ b/compiler/testData/diagnostics/tests/labels/kt4603.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE //KT-4603 Labeling information is lost when passing through local classes or objects diff --git a/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.fir.kt b/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.fir.kt deleted file mode 100644 index 9586a34dfca..00000000000 --- a/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !LANGUAGE: +LateinitLocalVariables - -fun test() { - lateinit var s: String - s = "" - s.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.kt b/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.kt index 9586a34dfca..76c09e80d78 100644 --- a/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.kt +++ b/compiler/testData/diagnostics/tests/lateinit/local/localLateinit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +LateinitLocalVariables fun test() { diff --git a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt deleted file mode 100644 index 090a7d0cce9..00000000000 --- a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !LANGUAGE: +LateinitLocalVariables - -fun test1() { - lateinit var s: String - s.length -} - -fun test2() { - lateinit var s: String - run { - s = "" - } - s.length -} - -fun almostAlwaysTrue(): Boolean = true - -fun test3() { - lateinit var s: String - if (almostAlwaysTrue()) { - s = "" - } - s.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt index 090a7d0cce9..8c21c4e3258 100644 --- a/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt +++ b/compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +LateinitLocalVariables fun test1() { diff --git a/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.fir.kt deleted file mode 100644 index bace34caa25..00000000000 --- a/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: A.java - -public class A { - public static final String FOO = "foo"; -} - -// FILE: B.java - -public class B extends A { -} - -// FILE: main.kt - -const val K1 = B.FOO -const val K2 = A.FOO \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.kt b/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.kt index bace34caa25..122ce09cd88 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/fromJavaSubclass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/modifiers/const/kt12248.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/kt12248.fir.kt deleted file mode 100644 index 093c6ca967c..00000000000 --- a/compiler/testData/diagnostics/tests/modifiers/const/kt12248.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: Bar.java - -public class Bar { - public static final int BAR = Foo.FOO + 1; -} - -// FILE: Test.kt - -class Foo { - companion object { - const val FOO = 1 - } -} - -class Baz { - companion object { - const val BAZ = Bar.BAR + 1 - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/const/kt12248.kt b/compiler/testData/diagnostics/tests/modifiers/const/kt12248.kt index 093c6ca967c..51711f7fef2 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/kt12248.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/kt12248.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Bar.java public class Bar { diff --git a/compiler/testData/diagnostics/tests/modifiers/const/kt15913.fir.kt b/compiler/testData/diagnostics/tests/modifiers/const/kt15913.fir.kt deleted file mode 100644 index 13884090354..00000000000 --- a/compiler/testData/diagnostics/tests/modifiers/const/kt15913.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: Context.java - -public interface Context { - String BEAN = "context"; -} - -// FILE: Test.kt - -annotation class Resource(val name: String) - -class MyController { - companion object { - private const val foo = Context.BEAN - } - - @Resource(name = Context.BEAN) - fun setContext() { - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/modifiers/const/kt15913.kt b/compiler/testData/diagnostics/tests/modifiers/const/kt15913.kt index 13884090354..117a6e3e075 100644 --- a/compiler/testData/diagnostics/tests/modifiers/const/kt15913.kt +++ b/compiler/testData/diagnostics/tests/modifiers/const/kt15913.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Context.java public interface Context { diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.fir.kt deleted file mode 100644 index fb8a15bf719..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// FILE: f1.kt -// SKIP_TXT - -package kotlin - -class Unit - -// FILE: f2.kt - -class C: MutableIterator { - override fun remove(): Unit { - throw UnsupportedOperationException() - } - override fun next(): Int { - throw UnsupportedOperationException() - } - override fun hasNext(): Boolean { - throw UnsupportedOperationException() - } - -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.kt index fb8a15bf719..aa0e88d1590 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/collectionMethodStub.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: f1.kt // SKIP_TXT diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.fir.kt deleted file mode 100644 index 28bed038c27..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// MODULE: m1 -// FILE: a.kt - -package p - -public class A -public class B { - public val a: A = A() -} - -// MODULE: m2 -// FILE: b.kt - -package p - -public class A { - val x = 1 -} - -public fun foo(a: A) { - a.x + 1 -} - -// MODULE: m3(m1, m2) -// FILE: b.kt - -import p.* - -fun test() { - foo(B().a) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.kt index 28bed038c27..03f3ea807a9 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.fir.kt deleted file mode 100644 index 73f4f212412..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// MODULE: m1 -// FILE: a.kt - -package p - -public interface A -public class B : A -public class M1 { - public val b: B = B() -} - -// MODULE: m2 -// FILE: b.kt - -package p - -public interface A - -public fun foo(a: A) { -} - -// MODULE: m3(m1, m2) -// FILE: b.kt - -import p.* - -fun test() { - foo(M1().b) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.kt index 73f4f212412..73c57b9d6fa 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/duplicateSuperClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.fir.kt deleted file mode 100644 index 20f29622e77..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// MODULE: m1 -// FILE: a.kt - -package p - -public class A -public class B { - public val a: A = A() -} - -// MODULE: m2(m1) -// FILE: b.kt - -package p - -class A { - fun foo() {} -} - -fun test() { - val a: A = B().a - a.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.kt index 20f29622e77..4e4fceba4bd 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/inTheSameModuleWithUsage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.fir.kt deleted file mode 100644 index bc4cf46afd4..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// MODULE: m1 -// FILE: a.kt - -package p - -public class A -public class M1 { - public val a: A = A() -} - -// MODULE: m2 -// FILE: b.kt - -package p - -public class A - -public fun foo(a: A) { -} - -// MODULE: m3(m1, m2) -// FILE: b.kt - -import p.* - -fun test() { - foo(M1().a) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.kt index bc4cf46afd4..0d9c3d97e3b 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateClass/sameGenericArguments.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.fir.kt deleted file mode 100644 index 5b0df4dc633..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T) -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: X) - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: T) -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo("") - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.kt index 5b0df4dc633..b835d033472 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.fir.kt deleted file mode 100644 index 2bd33d184da..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T?) -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: X?) - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface Tr - -public interface B { - public fun foo(a: T?) -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo(null) - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.kt index 2bd33d184da..f6b4f38f101 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsBoundMismatch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.fir.kt deleted file mode 100644 index 3a6fd9ff269..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T) -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: X) - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: T1) -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?, y: Y) { - if (b is C) { - b?.foo(y) - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.kt index 3a6fd9ff269..ec29bbe746a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsNameMismatch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.fir.kt deleted file mode 100644 index 14093a54c25..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(): T -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(): X - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(): T -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo() - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.kt index 14093a54c25..dc6aeb13967 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInReturnType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.fir.kt deleted file mode 100644 index 5f278c9cf55..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: Int, b: String): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: Int, b: String): B? - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a1: Int, b1: String): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo(1, "") - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.kt index 5f278c9cf55..7b31875b1cb 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differenceInParamNames.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.fir.kt deleted file mode 100644 index 60d54f8cf72..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun String.getParent(): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public class C : B { - override fun String.getParent(): B? = null - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun String.getParent(): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun B.test() { - if (this is C) { - "".getParent() - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt index 60d54f8cf72..b564d849f82 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/extensionMatch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.fir.kt deleted file mode 100644 index ff4d22e7a93..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.fir.kt +++ /dev/null @@ -1,42 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: T): B? - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo("") - } -} - -fun test1(b: B?) { - if (b is C) { - b?.foo("") - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.kt index ff4d22e7a93..a26d6dd86e2 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.fir.kt deleted file mode 100644 index 664571d7d31..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.fir.kt +++ /dev/null @@ -1,52 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: T): B? - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b == null) return - b?.foo("") -} - -fun test1(b: B?) { - if (b != null) { - b?.foo("") - } -} - -fun test2(b: B?) { - if (b == null) return - b?.foo("") -} - -fun test3(b: B?) { - if (b != null) { - b?.foo("") - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.kt index 664571d7d31..e6487a26828 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsEqNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.fir.kt deleted file mode 100644 index e24aee75faf..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.fir.kt +++ /dev/null @@ -1,40 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: T): B? - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b !is C) return - b?.foo("") -} - -fun test1(b: B?) { - if (b !is C) return - b?.foo("") -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.kt index e24aee75faf..18496bd3b2a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsNotIs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.fir.kt deleted file mode 100644 index 5e775bc5e72..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.fir.kt +++ /dev/null @@ -1,44 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface Foo - -public interface B { - public fun foo(a: T): Foo -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: T): Foo - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface Foo - -public interface B { - public fun foo(a: T): Foo -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b !is C) return - b?.foo("") -} - -fun test1(b: B?) { - if (b !is C) return - b?.foo("") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.kt index 5e775bc5e72..c98e0671399 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnFooT.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.fir.kt deleted file mode 100644 index 494c865981b..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.fir.kt +++ /dev/null @@ -1,40 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T): T -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: T): T - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: T): T -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b !is C) return - b?.foo("") -} - -fun test1(b: B?) { - if (b !is C) return - b?.foo("") -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.kt index 494c865981b..89c796919a7 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsReturnT.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.fir.kt deleted file mode 100644 index 5a5eb3c618f..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: Int, b: String): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: Int, b: String): B? - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun foo(a: Int, b: String): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo(1, "") - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.kt index 5a5eb3c618f..649dd5cd34c 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noGenericsInParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.fir.kt deleted file mode 100644 index 67a86edc2e1..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun getParent(): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public class C : B { - override fun getParent(): B? = null - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface B { - public fun getParent(): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.getParent() - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.kt index 67a86edc2e1..a73d7c92528 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/noParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.fir.kt deleted file mode 100644 index 2e8bfca20f5..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m0 -// FILE: a.kt -package p - -public interface G1 -public interface G2 - -// MODULE: m1(m0) -// FILE: a.kt -package p - -public interface B { - public fun foo(a: G1, b: G2): B? -} - -// MODULE: m2(m1, m0) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: G1, b: G2): B? - -} - -// MODULE: m3(m0) -// FILE: b.kt -package p - -public interface B { - public fun foo(a: G1, b: G2): B? -} - -// MODULE: m4(m3, m2, m0) -// FILE: c.kt -import p.* - -fun test(b: B?, a: G1, b1: G2) { - if (b is C) { - b?.foo(a, b1) - } -} diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.kt index 2e8bfca20f5..a442c791360 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sameGenericsInParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m0 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.fir.kt deleted file mode 100644 index 99450485c7a..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// MODULE: m1 -// FILE: x.kt -package p - -public interface Base { - public fun foo() {} -} - -public interface A : Base { - override fun foo() {} -} - -public interface C : A - - -// MODULE: m2 -// FILE: x.kt -package p - -public interface Base { - public fun foo() {} -} - -public interface B : Base - -// MODULE: m3(m1, m2) -// FILE: x.kt - -import p.* - -class Foo: C, B \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.kt index 99450485c7a..a75aa5bf7cb 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/differentSuperTraits.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: x.kt package p diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.fir.kt deleted file mode 100644 index b6d5d833f04..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// MODULE: m1 -// FILE: x.kt -package p - -public interface Base { - public fun foo() {} -} - -public interface A : Base - -// MODULE: m2 -// FILE: x.kt -package p - -public interface Base { - public fun foo() {} -} - -public interface B : Base - -// MODULE: m3(m1, m2) -// FILE: x.kt - -import p.* - -class Foo: A, B \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.kt index b6d5d833f04..8618152071d 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTrait.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: x.kt package p diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.fir.kt deleted file mode 100644 index 4c1e52747a4..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// MODULE: m1 -// FILE: x.kt -package p - -public interface Base { - public fun foo(t: Array) {} -} - -public interface A : Base - -// MODULE: m2 -// FILE: x.kt -package p - -public interface Base { - public fun foo(t: Array) {} -} - -public interface B : Base - -// MODULE: m3(m1, m2) -// FILE: x.kt - -import p.* - -class Foo: A, B { - override fun foo(t: Array) {} - override fun foo(t: Array) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.kt index 4c1e52747a4..bcf88e59fbb 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitDifferentBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: x.kt package p diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.fir.kt deleted file mode 100644 index 6fceaf1f9e1..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// MODULE: m1 -// FILE: x.kt -package p - -public interface Base { - public fun foo(t: T) {} -} - -public interface A : Base - -// MODULE: m2 -// FILE: x.kt -package p - -public interface Base { - public fun foo(t: T) {} -} - -public interface B : Base - -// MODULE: m3(m1, m2) -// FILE: x.kt - -import p.* - -class Foo: A, B \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.kt index 6fceaf1f9e1..1b53a147715 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateSuper/sameSuperTraitGenerics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: x.kt package p diff --git a/compiler/testData/diagnostics/tests/multimodule/kt14249.fir.kt b/compiler/testData/diagnostics/tests/multimodule/kt14249.fir.kt deleted file mode 100644 index cbcb03b507a..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/kt14249.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// MODULE: m1 -// FILE: test/Foo.java - -package test; - -class Foo { - static Foo create() { return Foo(); } - void takeFoo(Foo f) {} -} - -// MODULE: m2(m1) -// FILE: test.kt - -package test - -fun test() { - Foo() - val a: Foo = Foo.create() - Foo().takeFoo(a) -} diff --git a/compiler/testData/diagnostics/tests/multimodule/kt14249.kt b/compiler/testData/diagnostics/tests/multimodule/kt14249.kt index cbcb03b507a..77a92d1d3fd 100644 --- a/compiler/testData/diagnostics/tests/multimodule/kt14249.kt +++ b/compiler/testData/diagnostics/tests/multimodule/kt14249.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: test/Foo.java diff --git a/compiler/testData/diagnostics/tests/multimodule/varargConflict.fir.kt b/compiler/testData/diagnostics/tests/multimodule/varargConflict.fir.kt deleted file mode 100644 index 0631d24ad78..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/varargConflict.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -// MODULE: m1 -// FILE: a.kt - -package p - -public fun foo(a: Int) {} -public fun foo(vararg values: Int) {} - -// MODULE: m2 -// FILE: b.kt - -package p - -public fun foo(a: Int) {} -public fun foo(vararg values: Int) {} - -// MODULE: m3(m1, m2) -// FILE: c.kt -package m - -import p.foo - -fun main() { - foo(12) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/varargConflict.kt b/compiler/testData/diagnostics/tests/multimodule/varargConflict.kt index 0631d24ad78..bfbf56eebef 100644 --- a/compiler/testData/diagnostics/tests/multimodule/varargConflict.kt +++ b/compiler/testData/diagnostics/tests/multimodule/varargConflict.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.fir.kt deleted file mode 100644 index 550215ec4b3..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.fir.kt +++ /dev/null @@ -1,89 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -import kotlin.reflect.KClass - -expect annotation class Primitives( - val z: Boolean = true, - val c: Char = 'c', - val b: Byte = 42.toByte(), - val s: Short = (-1).toShort(), - val i: Int = -42, - val f: Float = 2.72f, - val j: Long = 123456789123456789L, - val d: Double = 3.14159265358979 -) - -expect annotation class PrimitiveArrays( - val z: BooleanArray = [true], - val c: CharArray = ['c'], - val b: ByteArray = [42.toByte()], - val s: ShortArray = [(-1).toShort()], - val i: IntArray = [-42], - val f: FloatArray = [2.72f], - val j: LongArray = [123456789123456789L], - val d: DoubleArray = [3.14159265358979] -) - -enum class En { A, B } - -annotation class Anno(val value: String = "Anno") - -expect annotation class Classes( - val s: String = "OK", - val e: En = En.B, - // TODO: this does not work at the moment because AnnotationDescriptor subclasses do not implement equals correctly - // val a: Anno = Anno(), - val k: KClass<*> = List::class -) - -expect annotation class ClassArrays( - val s: Array = ["OK"], - val e: Array = [En.B], - // val a: Array = [Anno()], - val k: Array> = [List::class], - vararg val v: Int = [42] -) - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -import kotlin.reflect.KClass - -actual annotation class Primitives( - actual val z: Boolean = true, - actual val c: Char = 'c', - actual val b: Byte = 42.toByte(), - actual val s: Short = (-1).toShort(), - actual val i: Int = -42, - actual val f: Float = 2.72f, - actual val j: Long = 123456789123456789L, - actual val d: Double = 3.14159265358979 -) - -actual annotation class PrimitiveArrays( - actual val z: BooleanArray = [true], - actual val c: CharArray = ['c'], - actual val b: ByteArray = [42.toByte()], - actual val s: ShortArray = [(-1).toShort()], - actual val i: IntArray = [-42], - actual val f: FloatArray = [2.72f], - actual val j: LongArray = [123456789123456789L], - actual val d: DoubleArray = [3.14159265358979] -) - -actual annotation class Classes( - actual val s: String = "OK", - actual val e: En = En.B, - // actual val a: Anno = Anno(), - actual val k: KClass<*> = List::class -) - -actual annotation class ClassArrays( - actual val s: Array = ["OK"], - actual val e: Array = [En.B], - // actual val a: Array = [Anno()], - actual val k: Array> = [List::class], - actual vararg val v: Int = [42] -) diff --git a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.kt b/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.kt index 550215ec4b3..be2fa05791d 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationArgumentEquality.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.fir.kt deleted file mode 100644 index 5d69200f014..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.fir.kt +++ /dev/null @@ -1,79 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -ProhibitGenericArrayClassLiteral -// MODULE: m1-common -// FILE: common.kt - -// See also compiler/testData/codegen/boxAgainstJava/multiplatform/annotationsViaActualTypeAliasFromBinary.kt - -import kotlin.reflect.KClass - -expect annotation class Anno( - val b: Byte = 1.toByte(), - val c: Char = 'x', - val d: Double = 3.14, - val f: Float = -2.72f, - val i: Int = 42424242, - val i2: Int = 53535353, - val j: Long = 239239239239239L, - val j2: Long = 239239L, - val s: Short = 42.toShort(), - val z: Boolean = true, - val ba: ByteArray = [(-1).toByte()], - val ca: CharArray = ['y'], - val da: DoubleArray = [-3.14159], - val fa: FloatArray = [2.7218f], - val ia: IntArray = [424242], - val ja: LongArray = [239239239239L, 239239L], - val sa: ShortArray = [(-43).toShort()], - val za: BooleanArray = [false, true], - val str: String = "fizz", - val k: KClass<*> = Number::class, - val e: E = E.E1, - // TODO: val a: A = A("1"), - val stra: Array = ["bu", "zz"], - val ka: Array> = [Double::class, String::class, LongArray::class, Array>>::class, Unit::class], - val ea: Array = [E.E2, E.E3] - // TODO: val aa: Array = [A("2"), A("3")] -) - -enum class E { E1, E2, E3 } - -annotation class A(val value: String) - -@Anno -fun test() {} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual typealias Anno = Jnno - -// FILE: Jnno.java - -public @interface Jnno { - byte b() default 1; - char c() default 'x'; - double d() default 3.14; - float f() default -2.72f; - int i() default 42424242; - int i2() default 21212121 + 32323232; - long j() default 239239239239239L; - long j2() default 239239; - short s() default 42; - boolean z() default true; - byte[] ba() default {-1}; - char[] ca() default {'y'}; - double[] da() default {-3.14159}; - float[] fa() default {2.7218f}; - int[] ia() default {424242}; - long[] ja() default {239239239239L, 239239}; - short[] sa() default {-43}; - boolean[] za() default {false, true}; - String str() default "fi" + "zz"; - Class k() default Number.class; - E e() default E.E1; - // TODO: A a() default @A("1"); - String[] stra() default {"bu", "zz"}; - Class[] ka() default {double.class, String.class, long[].class, Integer[][][].class, void.class}; - E[] ea() default {E.E2, E.E3}; - // TODO: A[] aa() default {@A("2"), @A("3")}; -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.kt b/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.kt index 5d69200f014..6f25f16e624 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/defaultArguments/annotationsViaActualTypeAlias2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects -ProhibitGenericArrayClassLiteral // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.fir.kt deleted file mode 100644 index 0fdbc9c2816..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect enum class Foo { A, B } -expect enum class Bar { X, Y, Z } - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual enum class Foo { A, B, C, D, E } -actual enum class Bar { V, X, W, Y, Z } diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.kt index 0fdbc9c2816..17f3586af9e 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/enum/additionalEntriesInImpl.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.fir.kt deleted file mode 100644 index a0928c8d2ed..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect enum class Foo { A, B } -expect enum class Bar { X, Y, Z } - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual enum class Foo { B, A } -actual enum class Bar { X, Z, Y } diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.kt index a0928c8d2ed..0e071fee695 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/enum/differentEntryOrder.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.fir.kt deleted file mode 100644 index 5072b4f2cd8..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect enum class Foo { - ENTRY -} - -expect enum class _TimeUnit - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual typealias Foo = FooImpl - -actual typealias _TimeUnit = java.util.concurrent.TimeUnit - -// FILE: FooImpl.java -public enum FooImpl { - ENTRY("OK") { - @Override - public String getResult() { - return value; - } - }; - - protected final String value; - - public FooImpl(String value) { - this.value = value; - } - - public abstract String getResult(); -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.kt index 5072b4f2cd8..d10e59c7376 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/enum/javaEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.fir.kt deleted file mode 100644 index 853f3029a2c..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect enum class Foo { - ENTRY1, - ENTRY2, - ENTRY3; -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual enum class Foo(val x: String) { - ENTRY1("1"), - ENTRY2("2"), - ENTRY3("3"); -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.kt index 853f3029a2c..15c7f097c22 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/enum/simpleEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.fir.kt deleted file mode 100644 index 8023137fd55..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect fun > Array.sort(): Unit - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual fun > Array.sort(): Unit {} - -fun Array.sort(): Unit {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.kt b/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.kt index 8023137fd55..01bcf6ae830 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/generic/functionTypeParameterBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.fir.kt deleted file mode 100644 index e13adfe8d64..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class A { - fun foo(): Unit - - fun > bar(): List -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual typealias A = JavaA - -// FILE: JavaA.java -import java.util.List; - -public class JavaA { - public void foo() {} - - public > List bar() { - return null; - } -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.kt b/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.kt index e13adfe8d64..48debd5315b 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/generic/genericMemberBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.fir.kt deleted file mode 100644 index 109e6652f72..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect interface A { - val x: T - var y: List - fun f(p: Collection): Map> -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual interface A { - actual val x: T - actual var y: List - actual fun f(p: Collection): Map> -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.kt b/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.kt index 109e6652f72..d7642a1d5c1 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/generic/membersInGenericClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.fir.kt deleted file mode 100644 index d8f41113255..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect interface Interface - -expect annotation class Anno(val prop: String) - -expect object Object - -expect class Class - -expect enum class En { ENTRY } - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual interface Interface - -actual annotation class Anno actual constructor(actual val prop: String) - -actual object Object - -actual class Class - -actual enum class En { ENTRY } diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.kt index d8f41113255..09b3470ee2f 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/classKinds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.fir.kt deleted file mode 100644 index 63088d416ac..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { - fun f() - val v: String -} - -expect class Bar { - fun g() -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual open class Foo(actual open val v: String) { - actual open fun f() {} -} - -actual typealias Bar = JavaBar - -// FILE: JavaBar.java - -public class JavaBar { - public void g() {} -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.kt index 63088d416ac..2ccaab051c7 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/expectFinalActualOpen.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.fir.kt deleted file mode 100644 index 79af20b647b..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { - val bar: String -} - -// MODULE: m1-jvm(m1-common) -// FILE: jvm.kt - -actual class Foo { - actual val bar = "bar" - fun bar() = bar -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.kt index 79af20b647b..eae86ee516c 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/functionAndPropertyWithSameName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.fir.kt deleted file mode 100644 index 89ac1118e5b..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect class Foo { - val foo: String - - fun bar(x: Int): Int -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual class Foo { - actual val foo: String = "JVM" - - actual fun bar(x: Int): Int = x + 1 -} - -// MODULE: m3-js(m1-common) -// FILE: js.kt -actual class Foo { - actual val foo: String = "JS" - - actual fun bar(x: Int): Int = x - 1 -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.kt index 89ac1118e5b..411269dcc25 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.fir.kt deleted file mode 100644 index 06bdbf3b645..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo(x: Int, y: String) { - val x: Int - val y: String -} - -expect class Bar(z: Double) - -expect class Baz(w: List) { - val w: List - - operator fun component1(): List - - // Disabled because default arguments are not allowed - // fun copy(w: List = ...): Baz - - override fun equals(other: Any?): Boolean - override fun hashCode(): Int - override fun toString(): String -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual data class Foo actual constructor(actual val x: Int, actual val y: String) - -actual data class Bar actual constructor(val z: Double) - -actual data class Baz actual constructor(actual val w: List) diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.kt index 06bdbf3b645..58c7df6d49d 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/implDataClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.fir.kt deleted file mode 100644 index f115edd5638..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo - -expect fun getFoo(): Foo - -fun bar() {} // no "Foo is final" warning should be here - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual open class Foo - -class Bar : Foo() - -actual fun getFoo(): Foo = Bar() diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.kt index f115edd5638..419486408f4 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/implOpenClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.fir.kt deleted file mode 100644 index 5a44875cda6..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// !DIAGNOSTICS: -UNUSED_PARAMETER -// MODULE: m1-common -// FILE: common.kt - -expect open class Container { - internal fun internalFun() -} - -// MODULE: m2-jvm(m1-common) - -// FILE: foo/Foo.java - -package foo; - -public class Foo { - public final void internalFun() {} // OK: internal -> public -} - -// FILE: jvm.kt - -actual typealias Container = foo.Foo \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.kt index 5a44875cda6..16f31103a51 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/morePermissiveVisibilityOnActualViaTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // !DIAGNOSTICS: -UNUSED_PARAMETER // MODULE: m1-common diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.fir.kt deleted file mode 100644 index ba17319f3dd..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.fir.kt +++ /dev/null @@ -1,58 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class OuterClass { - class NestedClass { - class DeepNested { - class Another { - fun f(s: String) - val p: Int - } - } - } - - inner class InnerClass { - fun f(x: Int) - val p: String - } - - companion object -} - -expect class OuterClassWithNamedCompanion { - companion object Factory -} - -expect object OuterObject { - object NestedObject -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual class OuterClass { - actual class NestedClass { - actual class DeepNested { - actual class Another { - actual fun f(s: String) {} - actual val p: Int = 42 - } - } - } - - actual inner class InnerClass { - actual fun f(x: Int) {} - actual val p: String = "" - } - - actual companion object -} - -actual class OuterClassWithNamedCompanion { - actual companion object Factory -} - -actual object OuterObject { - actual object NestedObject -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.kt index ba17319f3dd..db1817d5c6b 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/nestedClasses.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.fir.kt deleted file mode 100644 index d4032bccead..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect class Foo - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual class Foo - -// MODULE: m3-js(m1-common) -// FILE: js.kt -actual class Foo diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.kt index d4032bccead..8a40e9c3fa9 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/simpleHeaderClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.fir.kt deleted file mode 100644 index bb2649aa8ee..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { // also, it's important that Foo doesn't override equals - fun foo() -} - -fun check(x1: Foo, x: Any) { - if (x1 == x) { - x.foo() - } -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.kt index bb2649aa8ee..cc5384f4fc2 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/smartCastOnExpectClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.fir.kt deleted file mode 100644 index 9d3e9381025..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect open class Foo { - open fun bar(): String -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -interface Bar { - fun bar(): String -} - -val bar: Bar - get() = null!! - -actual open class Foo : Bar by bar diff --git a/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.kt b/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.kt index 9d3e9381025..452adfc31d4 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/implDelegatedMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/implDynamic.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/implDynamic.fir.kt deleted file mode 100644 index 8f5f15bc218..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/implDynamic.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// !DIAGNOSTICS: -UNSUPPORTED -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { - constructor(p: Any) - - fun f1(s: String): Int - - fun f2(s: List?): MutableMap - - fun > f3(t: T): T? -} - -// MODULE: m2-js(m1-common) -// FILE: js.kt - -// TODO: do not suppress UNSUPPORTED once JS files in multi-platform tests are analyzed with JS analyzer facade - -actual class Foo { - actual constructor(p: dynamic) {} - - actual fun f1(s: dynamic): dynamic = null!! - - actual fun f2(s: dynamic): MutableMap = null!! - - actual fun > f3(t: T): dynamic = null!! -} diff --git a/compiler/testData/diagnostics/tests/multiplatform/implDynamic.kt b/compiler/testData/diagnostics/tests/multiplatform/implDynamic.kt index 8f5f15bc218..c87f05840b1 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/implDynamic.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/implDynamic.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // !DIAGNOSTICS: -UNSUPPORTED // MODULE: m1-common diff --git a/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.fir.kt deleted file mode 100644 index 6b0167213e8..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { - fun bar(): String -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -open class Bar { - fun bar() = "bar" -} - -actual class Foo : Bar() diff --git a/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt b/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt index 6b0167213e8..6cd5609ea02 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/implFakeOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.fir.kt deleted file mode 100644 index 0c9ce6637e0..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { - constructor(p: Any) - - fun f1(s: String): Int - - fun f2(s: List?): MutableMap - - fun > f3(t: T): T? -} - -// MODULE: m2-jvm(m1-common) -// FILE: FooImpl.java - -import java.util.*; - -public class FooImpl { - public FooImpl(Object p) {} - - public final int f1(String s) { return 0; } - - public final Map f2(List s) { return null; } - - public final > T f3(T t) { return null; } -} - -// FILE: jvm.kt - -actual typealias Foo = FooImpl diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.kt b/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.kt index 0c9ce6637e0..8889c224406 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/java/flexibleTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.fir.kt deleted file mode 100644 index e20079bebaa..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect class Foo { - fun foo(i: Int, d: Double, f: Float): Unit -} - -// MODULE: m2-jvm(m1-common) -// FILE: FooImpl.java - -public class FooImpl { - public final void foo(int d, double i, float f) {} -} - -// FILE: jvm.kt - -actual typealias Foo = FooImpl diff --git a/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt b/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt index e20079bebaa..47fac8ffff7 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/java/parameterNames.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.fir.kt deleted file mode 100644 index 8694b547fb8..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect sealed class Presence { - object Online: Presence - object Offline: Presence -} - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual typealias Presence = P -sealed class P { - object Online : P() - object Offline : P() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.kt b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.kt index 8694b547fb8..5c37dc14af6 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.fir.kt deleted file mode 100644 index f2f0aab5368..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect sealed class Presence -expect object Online: Presence -expect object Offline: Presence - - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual typealias Presence = P -sealed class P -actual object Online : P() -actual object Offline : P() diff --git a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.kt b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.kt index f2f0aab5368..f13fb4f241c 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.fir.kt deleted file mode 100644 index 722251b5fc0..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect fun foo(x: Int): Int - -fun callFromCommonCode(x: Int) = foo(x) - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual fun foo(x: Int): Int { - return x + 1 -} - -fun callFromJVM(x: Int) = foo(x) - -// MODULE: m3-js(m1-common) -// FILE: js.kt - -actual fun foo(x: Int): Int { - return x - 1 -} - -fun callFromJS(x: Int) = foo(x) diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.kt index 722251b5fc0..0a4f73595a1 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/callHeaderFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.fir.kt deleted file mode 100644 index 4b5982611b2..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// !DIAGNOSTICS: -NOTHING_TO_INLINE -// MODULE: m1-common -// FILE: common.kt - -expect fun external() -expect fun tailrec() -expect fun inline() -expect fun String.unaryMinus(): String -expect fun String.and(other: String): String - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -actual external fun external() -actual tailrec fun tailrec(): Unit = if (true) Unit else tailrec() -actual inline fun inline() {} -actual operator fun String.unaryMinus(): String = this -actual infix fun String.and(other: String): String = this + other diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.kt index 4b5982611b2..f55d2eb22d3 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/functionModifiers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // !DIAGNOSTICS: -NOTHING_TO_INLINE // MODULE: m1-common diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.fir.kt deleted file mode 100644 index 28299c1d935..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect fun foo() diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.kt index 28299c1d935..491933a59d9 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerWithoutImpl.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.fir.kt deleted file mode 100644 index a6f7808abf5..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect fun foo() - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual fun foo() {} - -// MODULE: m3-js(m1-common) -// FILE: js.kt -actual fun foo() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.kt index a6f7808abf5..374c1241b7f 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/simpleHeaderFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.fir.kt deleted file mode 100644 index 5f0401c080f..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt -expect var foo: String - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt -actual var foo: String = "JVM" - -// MODULE: m3-js(m1-common) -// FILE: js.kt -actual var foo: String = "JS" diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.kt index 5f0401c080f..573132d9dcb 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/simpleHeaderVar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.fir.kt b/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.fir.kt deleted file mode 100644 index 86e395e8dbd..00000000000 --- a/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: A.java - -public @interface A { - int x(); - - String y(); -} - -// FILE: 1.kt - -@A(x = 1, y = "2") -fun test() {} diff --git a/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt b/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt index 86e395e8dbd..5b2b492768d 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/allowForJavaAnnotation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { diff --git a/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.fir.kt b/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.fir.kt deleted file mode 100644 index ce61b4cfa3c..00000000000 --- a/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -interface A { - fun foo(a1: Int, a2: Double) -} - -interface B { - fun foo(b1: Int, b2: String) -} - -interface C : A, B {} - -fun test(d: C) { - d.foo(a1 = 1, a2 = 1.0) - d.foo(b1 = 1, b2 = "") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.kt b/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.kt index ce61b4cfa3c..739c254a03c 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/namedArgumentsInOverloads.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun foo(a1: Int, a2: Double) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.fir.kt deleted file mode 100644 index b841960b590..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class Foo { - fun foo() {} -} - -fun Any?.foo() {} - -fun test(f : Foo?) { - f.foo() -} diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.kt index b841960b590..2010320b401 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/PreferExtensionsOnNullableReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.fir.kt deleted file mode 100644 index 47dc3d1626c..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun test(a: Any?) { - if (a is String) { - a == "" - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.kt index 47dc3d1626c..cdddfd83da7 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/equalityUnderNotNullCheck.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test(a: Any?) { if (a is String) { a == "" diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.fir.kt deleted file mode 100644 index b0624fd098e..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// FILE: A.java - -class A { - enum Empty {} - - static Empty foo() { return null; } -} - -// FILE: 1.kt - -fun bar() = when (A.foo()) { - null -> "null" - else -> "else" -} - -fun baz(t: T) = when (t) { - is Int -> "int" - is Long -> "long" - null -> "null" - else -> "else" -} diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.kt index b0624fd098e..20d053094b9 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noSenselessNullOnNullableType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java class A { diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.fir.kt deleted file mode 100644 index ff08f2d31c3..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -package a - -fun foo() { - bar()!! -} - -fun bar() = aa \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.kt index ff08f2d31c3..44032311e40 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/noUnnecessaryNotNullAssertionOnErrorType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package a fun foo() { diff --git a/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.fir.kt deleted file mode 100644 index 87606001595..00000000000 --- a/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class My { - fun other() {} -} - -fun another() {} - -fun foo(x: My?) { - // Both elvis parts should be alive - // See also KT-7936, KT-8347 - x?.other() ?: another() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.kt b/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.kt index 87606001595..253bda71095 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/elvisOnUnit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class My { fun other() {} } diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.fir.kt deleted file mode 100644 index e9904a7da75..00000000000 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -data class My(val x: Unit) - -fun foo(my: My?): Int? { - val x = my?.x - // ?. is required here - return x?.hashCode() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.kt index e9904a7da75..2cca5830bb4 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL data class My(val x: Unit) fun foo(my: My?): Int? { diff --git a/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.fir.kt b/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.fir.kt deleted file mode 100644 index 4d9df23ad57..00000000000 --- a/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun test(numbers: List) { - - // Short <: R, ILT <: R => CST(Short, ILT) = Short - // => we should pick Short in such situation as it more specific - shortExpected { getShort() ?: 1 } - - // Short <: R, ILT <: R, R <: Comparable => - // Short <: Comparable, ILT <: Comparable => - // Comparable <: Comparable, Comparable <: Comparable => - // R <: Short, R <: ILT => - // R := Short, R := ILT - // => we should pick Short as it more specific - shortComparable { getShort() ?: 1 } -} - -fun shortExpected(f: () -> R) {} -fun > shortComparable(f: () -> R) {} - -fun getShort(): Short? = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.kt b/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.kt index 4d9df23ad57..58424f6d81d 100644 --- a/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.kt +++ b/compiler/testData/diagnostics/tests/numbers/numberAsUnionAndIntersection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.fir.kt deleted file mode 100644 index 4a72ff41864..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.fir.kt +++ /dev/null @@ -1,142 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// See KT-21515 for a class diagram and details - -// class is to prevent accidental short-name import -class O { - open class Alpha { - open fun foo() = 42 - - class FromAlpha { - fun foo() = 42 - } - - companion object { - class FromCompanionAlpha { - fun foo() = 42 - } - } - } - - open class Beta : Alpha() { - override fun foo() = 42 - - class FromBeta { - fun foo() = 42 - } - - companion object { - class FromCompanionBeta { - fun foo() = 42 - } - } - } - - - open class A { - open fun foo() = 42 - - class FromA { - fun foo() = 42 - } - - companion object : Beta() { - class FromCompanionA { - fun foo() = 42 - } - } - } - -////////////////////////// - - open class FarAway { - open fun foo() = 42 - - class FromFarAway { - fun foo() = 42 - } - - } - - open class Gamma { - open fun foo() = 42 - - class FromGamma { - fun foo() = 42 - } - - companion object : FarAway() { - class FromCompanionGamma { - fun foo() = 42 - } - } - } - - open class B : A() { - override fun foo() = 42 - - class FromB { - fun foo() = 42 - } - - companion object : Gamma() { - override fun foo() = 42 - - class FromCompanionB { - fun foo() = 42 - } - } - } -} - -/////////////////////////////// - - -open class Delta { - open fun foo() = 42 - class FromDelta { - fun foo() = 42 - } -} - -class C : O.B() { - override fun foo() = 42 - - companion object : Delta() { - class FromCompanionC { - fun foo() = 42 - } - } - - // VISIBLE: Classifiers from direct superclasses - val c = O.A.FromA::foo - val d = O.B.FromB::foo - - // VISIBLE: Classifiers from our own companion - val n = C.Companion.FromCompanionC::foo - - // INVISIBLE: direct superclasses themselves. - val a = O.A::foo - val b = O.A::foo - - // DEPRECATED: Classifiers from companions of direct superclasses - val e = O.A.Companion.FromCompanionA::foo - val f = O.B.Companion.FromCompanionB::foo - - // INVISIBLE: "cousin" supertypes themselves - val g = O.Alpha::foo - val h = O.Beta::foo - val i = O.Gamma::foo - - // DEPRECATED: classifiers from "cousin" superclasses - val k = O.Alpha.FromAlpha::foo - val l = O.Beta.FromBeta::foo - val m = O.Gamma.FromGamma::foo - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = O.Alpha.Companion.FromCompanionAlpha::foo - val p = O.Beta.Companion.FromCompanionBeta::foo - val q = O.Gamma.Companion.FromCompanionGamma::foo - - // DEPRECATED: Classifiers from supertypes of our own companion - val r = Delta.FromDelta::foo -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.kt index 4a72ff41864..e242f117bd7 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // See KT-21515 for a class diagram and details diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.fir.kt deleted file mode 100644 index 365ce45f7b7..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.fir.kt +++ /dev/null @@ -1,142 +0,0 @@ -// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// See KT-21515 for a class diagram and details - -// class is to prevent accidental short-name import -class O { - open class Alpha { - open fun foo() = 42 - - class FromAlpha { - fun foo() = 42 - } - - companion object { - class FromCompanionAlpha { - fun foo() = 42 - } - } - } - - open class Beta : Alpha() { - override fun foo() = 42 - - class FromBeta { - fun foo() = 42 - } - - companion object { - class FromCompanionBeta { - fun foo() = 42 - } - } - } - - - open class A { - open fun foo() = 42 - - class FromA { - fun foo() = 42 - } - - companion object : Beta() { - class FromCompanionA { - fun foo() = 42 - } - } - } - -////////////////////////// - - open class FarAway { - open fun foo() = 42 - - class FromFarAway { - fun foo() = 42 - } - - } - - open class Gamma { - open fun foo() = 42 - - class FromGamma { - fun foo() = 42 - } - - companion object : FarAway() { - class FromCompanionGamma { - fun foo() = 42 - } - } - } - - open class B : A() { - override fun foo() = 42 - - class FromB { - fun foo() = 42 - } - - companion object : Gamma() { - override fun foo() = 42 - - class FromCompanionB { - fun foo() = 42 - } - } - } -} - -/////////////////////////////// - - -open class Delta { - open fun foo() = 42 - class FromDelta { - fun foo() = 42 - } -} - -class C : O.B() { - override fun foo() = 42 - - companion object : Delta() { - class FromCompanionC { - fun foo() = 42 - } - } - - // VISIBLE: Classifiers from direct superclasses - val c = O.A.FromA::foo - val d = O.B.FromB::foo - - // VISIBLE: Classifiers from our own companion - val n = FromCompanionC::foo - - // INVISIBLE: direct superclasses themselves. - val a = O.A::foo - val b = O.A::foo - - // DEPRECATED: Classifiers from companions of direct superclasses - val e = O.A.Companion.FromCompanionA::foo - val f = O.B.Companion.FromCompanionB::foo - - // INVISIBLE: "cousin" supertypes themselves - val g = O.Alpha::foo - val h = O.Beta::foo - val i = O.Gamma::foo - - // DEPRECATED: classifiers from "cousin" superclasses - val k = O.Alpha.FromAlpha::foo - val l = O.Beta.FromBeta::foo - val m = O.Gamma.FromGamma::foo - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = O.Alpha.Companion.FromCompanionAlpha::foo - val p = O.Beta.Companion.FromCompanionBeta::foo - val q = O.Gamma.Companion.FromCompanionGamma::foo - - // DEPRECATED: Classifiers from supertypes of our own companion - val r = Delta.FromDelta::foo -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.kt index 365ce45f7b7..0b419f78ea6 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesWithQualificationOld.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // See KT-21515 for a class diagram and details diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.fir.kt deleted file mode 100644 index cee85fc989c..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.fir.kt +++ /dev/null @@ -1,99 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion - -// See KT-21515 for a class diagram and details - -// Object is to prevent accidental short-name import -object O { - open class Alpha { - class FromAlpha - - companion object { - class FromCompanionAlpha - } - } - - open class Beta : Alpha() { - class FromBeta - - companion object { - class FromCompanionBeta - } - } - - - open class A { - class FromA - - companion object : Beta() { - class FromCompanionA - } - } - -////////////////////////// - - open class FarAway { - class FromFarAway - - } - - open class Gamma { - class FromGamma - companion object : FarAway() { - class FromCompanionGamma - } - } - - open class B : A() { - class FromB - - companion object : Gamma() { - class FromCompanionB - } - } -} - -/////////////////////////////// - - -open class Delta { - class FromDelta -} - -class C : O.B() { - companion object : Delta() { - class FromCompanionC - } - - // VISIBLE: Classifiers from direct superclasses - val c: O.A.FromA? = null - val d: O.B.FromB? = null - - // VISIBLE: Classifiers from our own companion - val n: C.Companion.FromCompanionC? = null - - // INVISIBLE: direct superclasses themselves. - val a: O.A? = null - val b: O.B? = null - - // DEPRECATED: Classifiers from companions of direct superclasses - val e: O.A.Companion.FromCompanionA? = null - val f: O.B.Companion.FromCompanionB? = null - - // INVISIBLE: "cousin" supertypes themselves - val g: O.Alpha? = null - val h: O.Beta? = null - val i: O.Gamma? = null - - // DEPRECATED: classifiers from "cousin" superclasses - val k: O.Alpha.FromAlpha? = null - val l: O.Beta.FromBeta? = null - val m: O.Gamma.FromGamma? = null - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o: O.Alpha.Companion.FromCompanionAlpha? = null - val p: O.Beta.Companion.FromCompanionBeta? = null - val q: O.Gamma.Companion.FromCompanionGamma? = null - - // DEPRECATED: Classifiers from supertypes of our own companion - val r: Delta.FromDelta? = null -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.kt index cee85fc989c..4380e4a3051 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // See KT-21515 for a class diagram and details diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.fir.kt deleted file mode 100644 index 6a65b624428..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.fir.kt +++ /dev/null @@ -1,98 +0,0 @@ -// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// See KT-21515 for a class diagram and details - -// Object is to prevent accidental short-name import -object O { - open class Alpha { - class FromAlpha - - companion object { - class FromCompanionAlpha - } - } - - open class Beta : Alpha() { - class FromBeta - - companion object { - class FromCompanionBeta - } - } - - - open class A { - class FromA - - companion object : Beta() { - class FromCompanionA - } - } - -////////////////////////// - - open class FarAway { - class FromFarAway - - } - - open class Gamma { - class FromGamma - companion object : FarAway() { - class FromCompanionGamma - } - } - - open class B : A() { - class FromB - - companion object : Gamma() { - class FromCompanionB - } - } -} - -/////////////////////////////// - - -open class Delta { - class FromDelta -} - -class C : O.B() { - companion object : Delta() { - class FromCompanionC - } - - // VISIBLE: Classifiers from direct superclasses - val c: O.A.FromA? = null - val d: O.B.FromB? = null - - // VISIBLE: Classifiers from our own companion - val n: C.Companion.FromCompanionC? = null - - // INVISIBLE: direct superclasses themselves. - val a: O.A? = null - val b: O.B? = null - - // DEPRECATED: Classifiers from companions of direct superclasses - val e: O.A.Companion.FromCompanionA? = null - val f: O.B.Companion.FromCompanionB? = null - - // INVISIBLE: "cousin" supertypes themselves - val g: O.Alpha? = null - val h: O.Beta? = null - val i: O.Gamma? = null - - // DEPRECATED: classifiers from "cousin" superclasses - val k: O.Alpha.FromAlpha? = null - val l: O.Beta.FromBeta? = null - val m: O.Gamma.FromGamma? = null - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o: O.Alpha.Companion.FromCompanionAlpha? = null - val p: O.Beta.Companion.FromCompanionBeta? = null - val q: O.Gamma.Companion.FromCompanionGamma? = null - - // DEPRECATED: Classifiers from supertypes of our own companion - val r: Delta.FromDelta? = null -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.kt index 6a65b624428..0d428b9e917 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/classifierFromCompanionObjectWithQualificationOld.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // See KT-21515 for a class diagram and details diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.fir.kt deleted file mode 100644 index bdc9c72d601..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -open class A { - class FromA { - fun foo() = 42 - } -} - -class B : A() { - companion object : A() { } - - // we're seeing FromA here by two paths: one is deprecated (via companion object), and another one is not, - // so we shouldn't see deprecation warning - val a: FromA? = null - - val b = FromA::foo - - val c = FromA() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.kt b/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.kt index bdc9c72d601..d2dc7b3522b 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/classifierIsVisibleByTwoPaths.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A { class FromA { fun foo() = 42 diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.fir.kt deleted file mode 100644 index f1abf117b2d..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.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 : O.A.FromA() - open class d : O.B.FromB() - - // VISIBLE: Classifiers from our own companion - open class n : C.Companion.FromCompanionC() - - // INVISIBLE: direct superclasses themselves. - open class a : O.A() - open class b : O.B() - - // DEPRECATED: Classifiers from companions of direct superclasses - open class e : O.A.Companion.FromCompanionA() - open class f : O.B.Companion.FromCompanionB() - - // INVISIBLE: "cousin" supertypes themselves - open class g : O.Alpha() - open class h : O.Beta() - open class i : O.Gamma() - - // DEPRECATED: classifiers from "cousin" superclasses - open class k : O.Alpha.FromAlpha() - open class l : O.Beta.FromBeta() - open class m : O.Gamma.FromGamma() - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - open class o : O.Alpha.Companion.FromCompanionAlpha() - open class p : O.Beta.Companion.FromCompanionBeta() - open class q : O.Gamma.Companion.FromCompanionGamma() - - // DEPRECATED: Classifiers from supertypes of our own companion - open class r : Delta.FromDelta() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.kt index f1abf117b2d..223e3f2ba8a 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.fir.kt deleted file mode 100644 index ea97e72b0c0..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.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 : O.A.FromA() - open class d : O.B.FromB() - - // VISIBLE: Classifiers from our own companion - open class n : C.Companion.FromCompanionC() - - // INVISIBLE: direct superclasses themselves. - open class a : O.A() - open class b : O.B() - - // DEPRECATED: Classifiers from companions of direct superclasses - open class e : O.A.Companion.FromCompanionA() - open class f : O.B.Companion.FromCompanionB() - - // INVISIBLE: "cousin" supertypes themselves - open class g : O.Alpha() - open class h : O.Beta() - open class i : O.Gamma() - - // DEPRECATED: classifiers from "cousin" superclasses - open class k : O.Alpha.FromAlpha() - open class l : O.Beta.FromBeta() - open class m : O.Gamma.FromGamma() - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - open class o : O.Alpha.Companion.FromCompanionAlpha() - open class p : O.Beta.Companion.FromCompanionBeta() - open class q : O.Gamma.Companion.FromCompanionGamma() - - // DEPRECATED: Classifiers from supertypes of our own companion - open class r : Delta.FromDelta() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.kt b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.kt index ea97e72b0c0..da69e70fc37 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/inheritedFromDeprecatedWithQualificationOld.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.fir.kt deleted file mode 100644 index ca2d5e72a55..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.fir.kt +++ /dev/null @@ -1,53 +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 - -import test.Java.method -import test.Java.Classifier -import test.Java.property -import test.Java.syntheticSam - -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() { - - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.kt index ca2d5e72a55..858589eef59 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.fir.kt deleted file mode 100644 index 0d15c35222d..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.fir.kt +++ /dev/null @@ -1,53 +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 - -import test.Java.method -import test.Java.Classifier -import test.Java.property -import test.Java.syntheticSam - -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() { - - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.kt b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.kt index 0d15c35222d..f6a6d5b8e99 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/staticsFromJavaWithQualificationOld.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.fir.kt deleted file mode 100644 index 2a1da9d91d3..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.fir.kt +++ /dev/null @@ -1,100 +0,0 @@ -// !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// !DIAGNOSTICS: -UNUSED_VARIABLE - -// See KT-21515 for a class diagram and details - -// Object is to prevent accidental short-name import -object O { - open class Alpha { - class FromAlpha - - companion object { - class FromCompanionAlpha - } - } - - open class Beta : Alpha() { - class FromBeta - - companion object { - class FromCompanionBeta - } - } - - - open class A { - class FromA - - companion object : Beta() { - class FromCompanionA - } - } - -////////////////////////// - - open class FarAway { - class FromFarAway - - } - - open class Gamma { - class FromGamma - companion object : FarAway() { - class FromCompanionGamma - } - } - - open class B : A() { - class FromB - - companion object : Gamma() { - class FromCompanionB - } - } -} - -/////////////////////////////// - - -open class Delta { - class FromDelta -} - -class C : O.B() { - companion object : Delta() { - class FromCompanionC - } - - // VISIBLE: Classifiers from direct superclasses - val c = O.A.FromA() - val d = O.B.FromB() - - // VISIBLE: Classifiers from our own companion - val n = C.Companion.FromCompanionC() - - // INVISIBLE: direct superclasses themselves. - val a = O.A() - val b = O.B() - - // DEPRECATED: Classifiers from companions of direct superclasses - val e = O.A.Companion.FromCompanionA() - val f = O.B.Companion.FromCompanionB() - - // INVISIBLE: "cousin" supertypes themselves - val g = O.Alpha() - val h = O.Beta() - val i = O.Gamma() - - // DEPRECATED: classifiers from "cousin" superclasses - val k = O.Alpha.FromAlpha() - val l = O.Beta.FromBeta() - val m = O.Gamma.FromGamma() - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = O.Alpha.Companion.FromCompanionAlpha() - val p = O.Beta.Companion.FromCompanionBeta() - val q = O.Gamma.Companion.FromCompanionGamma() - - // DEPRECATED: Classifiers from supertypes of our own companion - val r = Delta.FromDelta() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.kt index 2a1da9d91d3..8ce0900798c 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationNew.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.fir.kt deleted file mode 100644 index ab80273e1c2..00000000000 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.fir.kt +++ /dev/null @@ -1,100 +0,0 @@ -// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion -// !DIAGNOSTICS: -UNUSED_VARIABLE - -// See KT-21515 for a class diagram and details - -// Object is to prevent accidental short-name import -object O { - open class Alpha { - class FromAlpha - - companion object { - class FromCompanionAlpha - } - } - - open class Beta : Alpha() { - class FromBeta - - companion object { - class FromCompanionBeta - } - } - - - open class A { - class FromA - - companion object : Beta() { - class FromCompanionA - } - } - -////////////////////////// - - open class FarAway { - class FromFarAway - - } - - open class Gamma { - class FromGamma - companion object : FarAway() { - class FromCompanionGamma - } - } - - open class B : A() { - class FromB - - companion object : Gamma() { - class FromCompanionB - } - } -} - -/////////////////////////////// - - -open class Delta { - class FromDelta -} - -class C : O.B() { - companion object : Delta() { - class FromCompanionC - } - - // VISIBLE: Classifiers from direct superclasses - val c = O.A.FromA() - val d = O.B.FromB() - - // VISIBLE: Classifiers from our own companion - val n = C.Companion.FromCompanionC() - - // INVISIBLE: direct superclasses themselves. - val a = O.A() - val b = O.B() - - // DEPRECATED: Classifiers from companions of direct superclasses - val e = O.A.Companion.FromCompanionA() - val f = O.B.Companion.FromCompanionB() - - // INVISIBLE: "cousin" supertypes themselves - val g = O.Alpha() - val h = O.Beta() - val i = O.Gamma() - - // DEPRECATED: classifiers from "cousin" superclasses - val k = O.Alpha.FromAlpha() - val l = O.Beta.FromBeta() - val m = O.Gamma.FromGamma() - - // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = O.Alpha.Companion.FromCompanionAlpha() - val p = O.Beta.Companion.FromCompanionBeta() - val q = O.Gamma.Companion.FromCompanionGamma() - - // DEPRECATED: Classifiers from supertypes of our own companion - val r = Delta.FromDelta() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.kt b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.kt index ab80273e1c2..a691e3e1e24 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/useDeprecatedConstructorWithQualificationOld.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.fir.kt b/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.fir.kt deleted file mode 100644 index 6a593b39d65..00000000000 --- a/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !CHECK_TYPE - -fun foo() { - val a = object { - val b = object { - val c = 42 - } - } - - checkSubtype(a.b.c) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.kt b/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.kt index 6a593b39d65..c83f016278b 100644 --- a/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.kt +++ b/compiler/testData/diagnostics/tests/objects/localObjectInsideObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE fun foo() { diff --git a/compiler/testData/diagnostics/tests/objects/objectInsideFun.fir.kt b/compiler/testData/diagnostics/tests/objects/objectInsideFun.fir.kt deleted file mode 100644 index 481c7c017ac..00000000000 --- a/compiler/testData/diagnostics/tests/objects/objectInsideFun.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -interface A { - val foo: Int - val bar: String - get() = "" -} - -fun test(foo: Int, bar: Int) { - object : A { - override val foo: Int = foo + bar - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/objects/objectInsideFun.kt b/compiler/testData/diagnostics/tests/objects/objectInsideFun.kt index 481c7c017ac..d406efcd2eb 100644 --- a/compiler/testData/diagnostics/tests/objects/objectInsideFun.kt +++ b/compiler/testData/diagnostics/tests/objects/objectInsideFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { val foo: Int val bar: String diff --git a/compiler/testData/diagnostics/tests/operatorRem/operatorRem.fir.kt b/compiler/testData/diagnostics/tests/operatorRem/operatorRem.fir.kt deleted file mode 100644 index 7cd65cc45ec..00000000000 --- a/compiler/testData/diagnostics/tests/operatorRem/operatorRem.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE - -class Foo { - operator fun rem(x: Int): Foo = Foo() -} - -class Bar { - operator fun remAssign(x: Int) {} -} - -fun baz() { - val f = Foo() % 1 - val b = Bar() - b %= 1 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorRem/operatorRem.kt b/compiler/testData/diagnostics/tests/operatorRem/operatorRem.kt index 7cd65cc45ec..614a3063cb2 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/operatorRem.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/operatorRem.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE class Foo { diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.fir.kt deleted file mode 100644 index e2cb9f6115d..00000000000 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -object Foo { - operator fun invoke() {} -} - -fun main() { - Foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.kt index e2cb9f6115d..f5cedcaee73 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt13349.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object Foo { operator fun invoke() {} } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.fir.kt deleted file mode 100644 index 3f5d1e27f07..00000000000 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -public class A { - public operator fun get(vararg attrs : Pair) : A = this -} -operator fun String.unaryPlus() : A = A() -operator fun A.div(s : String) : A = A() - -fun test() { - (+"node2" / "node3" / "zzz") ["attr" to "value", "a2" to "v2"] -} - -//--------- -class B { - public operator fun get(s : String, q : String) : B = this - public operator fun get(s : Pair) : B = this - public operator fun invoke(q : B.() -> Unit) : B = this -} -val x = B()["a", "v"]["a" to "b"] {} ["q" to "p"] // does not parses around {} - -//from library -data class Pair (val first: A, val second: B) -infix fun A.to(that: B) = Pair(this, that) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt index 3f5d1e27f07..083b26358f0 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER public class A { diff --git a/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.fir.kt b/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.fir.kt deleted file mode 100644 index 066ad1f50a0..00000000000 --- a/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun Int.rty() = 3 - -fun String.rty() = 4 diff --git a/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.kt b/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.kt index 066ad1f50a0..5f73386e375 100644 --- a/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.kt +++ b/compiler/testData/diagnostics/tests/overload/ExtFunDifferentReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun Int.rty() = 3 fun String.rty() = 4 diff --git a/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.fir.kt b/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.fir.kt deleted file mode 100644 index 7ef2f1c5738..00000000000 --- a/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: pkg1.kt -// check no error in overload in different packages - -package pkg1 -fun e() = 1 - -// FILE: pkg2.kt -package pkg2 -fun e() = 1 - -// FILE: pkg3pkg1.kt -package pkg3.pkg1 -fun e() = 1 diff --git a/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.kt b/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.kt index 7ef2f1c5738..39f4f0a5e12 100644 --- a/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.kt +++ b/compiler/testData/diagnostics/tests/overload/FunNoConflictInDifferentPackages.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: pkg1.kt // check no error in overload in different packages diff --git a/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.fir.kt b/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.fir.kt deleted file mode 100644 index 34c84965174..00000000000 --- a/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// check no error when regular function and extension function have same name - -package extensionAndRegular - -fun who() = 1 - -fun Int.who() = 1 diff --git a/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.kt b/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.kt index 34c84965174..b2410a204c4 100644 --- a/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.kt +++ b/compiler/testData/diagnostics/tests/overload/OverloadFunRegularAndExt.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // check no error when regular function and extension function have same name package extensionAndRegular diff --git a/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.fir.kt b/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.fir.kt deleted file mode 100644 index 201a1193c06..00000000000 --- a/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class Aaaa() { - val bb = 1 - fun bb() = 1 -} diff --git a/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.kt b/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.kt index 201a1193c06..1e5c28b1fef 100644 --- a/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.kt +++ b/compiler/testData/diagnostics/tests/overload/OverloadVarAndFunInClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Aaaa() { val bb = 1 fun bb() = 1 diff --git a/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.fir.kt b/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.fir.kt deleted file mode 100644 index 0fbe04eebe7..00000000000 --- a/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -fun Runnable(f: () -> Unit): Runnable = object : Runnable { - public override fun run() { - f() - } -} - -val x = Runnable { } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.kt b/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.kt index 0fbe04eebe7..8da433e42df 100644 --- a/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.kt +++ b/compiler/testData/diagnostics/tests/overload/SyntheticAndNotSynthetic.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun Runnable(f: () -> Unit): Runnable = object : Runnable { public override fun run() { f() diff --git a/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.fir.kt b/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.fir.kt deleted file mode 100644 index 9615bb55a6b..00000000000 --- a/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -// FILE: Base.java -public interface Base { - String foo(T a); - int foo(T a, Object... args); -} - -// FILE: Derived.java -public interface Derived extends Base { -} - -// FILE: test.kt -fun testDerived(base: Base, derived: Derived) { - val test1: String = base.foo("") - val test2: String = derived.foo("") -} diff --git a/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.kt b/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.kt index 9615bb55a6b..4d961316f7d 100644 --- a/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.kt +++ b/compiler/testData/diagnostics/tests/overload/UnsubstitutedJavaGenetics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: Base.java diff --git a/compiler/testData/diagnostics/tests/overload/kt10939.fir.kt b/compiler/testData/diagnostics/tests/overload/kt10939.fir.kt deleted file mode 100644 index 1aca3d7749a..00000000000 --- a/compiler/testData/diagnostics/tests/overload/kt10939.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -object X1 -object X2 - -interface Base { - fun foo(a: T1): X1 - fun foo(a: T2, vararg args: Any): X2 -} - -interface Derived : Base - -fun testDerived(base: Base, derived: Derived) { - val test1: X1 = base.foo("") - val test2: X1 = derived.foo("") -} - -interface GenericBase { - fun foo(x: T, a: T1): X1 -} - -interface SpecializedDerived : GenericBase { - fun foo(x: String, a: T2, vararg args: Any): X2 -} - -fun testSpecializedDerived(derived: SpecializedDerived) { - val test1: X1 = derived.foo("", "") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/kt10939.kt b/compiler/testData/diagnostics/tests/overload/kt10939.kt index 1aca3d7749a..974154bad34 100644 --- a/compiler/testData/diagnostics/tests/overload/kt10939.kt +++ b/compiler/testData/diagnostics/tests/overload/kt10939.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE object X1 diff --git a/compiler/testData/diagnostics/tests/overload/kt1998.fir.kt b/compiler/testData/diagnostics/tests/overload/kt1998.fir.kt deleted file mode 100644 index 56e521a67e2..00000000000 --- a/compiler/testData/diagnostics/tests/overload/kt1998.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// KT-1998 Strange "Overload resolution ambiguity" - -object A { - val c : String = "test" - - fun f(b: B): String { - return b.c // Test no "Overload resolution ambiguity" is reported here - } -} - -class B - -val B.c : String - get() = "test" diff --git a/compiler/testData/diagnostics/tests/overload/kt1998.kt b/compiler/testData/diagnostics/tests/overload/kt1998.kt index 56e521a67e2..c659fdabe47 100644 --- a/compiler/testData/diagnostics/tests/overload/kt1998.kt +++ b/compiler/testData/diagnostics/tests/overload/kt1998.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-1998 Strange "Overload resolution ambiguity" object A { diff --git a/compiler/testData/diagnostics/tests/overload/kt7068.fir.kt b/compiler/testData/diagnostics/tests/overload/kt7068.fir.kt deleted file mode 100644 index cc337d40b11..00000000000 --- a/compiler/testData/diagnostics/tests/overload/kt7068.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun withLambda(block : Int.(String) -> Unit) { -} - -fun withLambda(o : Int, block : Int.(String) -> Unit) { -} - -fun test() { - withLambda { - it.length - } - - withLambda { r -> // no error should be here - r.length - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/kt7068.kt b/compiler/testData/diagnostics/tests/overload/kt7068.kt index cc337d40b11..b9b624437b0 100644 --- a/compiler/testData/diagnostics/tests/overload/kt7068.kt +++ b/compiler/testData/diagnostics/tests/overload/kt7068.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun withLambda(block : Int.(String) -> Unit) { diff --git a/compiler/testData/diagnostics/tests/overload/kt7068_2.fir.kt b/compiler/testData/diagnostics/tests/overload/kt7068_2.fir.kt deleted file mode 100644 index d038ee2264f..00000000000 --- a/compiler/testData/diagnostics/tests/overload/kt7068_2.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun withLambda(block : Int.(String) -> Unit) { -} - -fun withLambda(block : Int.(String, String) -> Unit) { -} - -fun test() { - withLambda { r -> - r.length - } - - withLambda { x, y -> - x.length + y.length - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/kt7068_2.kt b/compiler/testData/diagnostics/tests/overload/kt7068_2.kt index d038ee2264f..fa3ee885dab 100644 --- a/compiler/testData/diagnostics/tests/overload/kt7068_2.kt +++ b/compiler/testData/diagnostics/tests/overload/kt7068_2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun withLambda(block : Int.(String) -> Unit) { diff --git a/compiler/testData/diagnostics/tests/overload/kt7440.fir.kt b/compiler/testData/diagnostics/tests/overload/kt7440.fir.kt deleted file mode 100644 index afc5a210323..00000000000 --- a/compiler/testData/diagnostics/tests/overload/kt7440.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -// KT-7440 Cannot complete type inference if two extension functions for interface hierarchy - -package inferenceagain - -interface Base -interface Derived : Base - -fun , T : Any> Base.maxBy(f: (T) -> R): T? = null -fun , T : Any> Derived.maxBy(f: (T) -> R): T? = null - -fun derivedOf(vararg members: T): Derived = null!! - -fun x(l: Derived) { - derivedOf(1, 2, 3).maxBy { it } // works - derivedOf(1, 2, 3).maxBy { it } // should work -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/kt7440.kt b/compiler/testData/diagnostics/tests/overload/kt7440.kt index afc5a210323..34b015c105c 100644 --- a/compiler/testData/diagnostics/tests/overload/kt7440.kt +++ b/compiler/testData/diagnostics/tests/overload/kt7440.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER // KT-7440 Cannot complete type inference if two extension functions for interface hierarchy diff --git a/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.fir.kt b/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.fir.kt deleted file mode 100644 index ef6b6fa41b8..00000000000 --- a/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -abstract class A { - abstract fun foo(): Int -} - -class B() : A() { - override fun foo() = 1 -} diff --git a/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.kt b/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.kt index ef6b6fa41b8..95ce0ecdb73 100644 --- a/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.kt +++ b/compiler/testData/diagnostics/tests/override/AbstractFunImplemented.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class A { abstract fun foo(): Int } diff --git a/compiler/testData/diagnostics/tests/override/AbstractValImplemented.fir.kt b/compiler/testData/diagnostics/tests/override/AbstractValImplemented.fir.kt deleted file mode 100644 index a9669a69142..00000000000 --- a/compiler/testData/diagnostics/tests/override/AbstractValImplemented.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -abstract class A { - abstract val i: Int -} - -class B() : A() { - override val i = 1 -} diff --git a/compiler/testData/diagnostics/tests/override/AbstractValImplemented.kt b/compiler/testData/diagnostics/tests/override/AbstractValImplemented.kt index a9669a69142..c76bafce194 100644 --- a/compiler/testData/diagnostics/tests/override/AbstractValImplemented.kt +++ b/compiler/testData/diagnostics/tests/override/AbstractValImplemented.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class A { abstract val i: Int } diff --git a/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.fir.kt b/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.fir.kt deleted file mode 100644 index b0c3055b5fa..00000000000 --- a/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -abstract class A { - abstract var i: Int -} - -class B() : A() { - override var i = 1 -} diff --git a/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.kt b/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.kt index b0c3055b5fa..a57927da4f0 100644 --- a/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.kt +++ b/compiler/testData/diagnostics/tests/override/AbstractVarImplemented.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class A { abstract var i: Int } diff --git a/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.fir.kt b/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.fir.kt deleted file mode 100644 index a27d78224ca..00000000000 --- a/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -interface Y { - fun foo(a : Int = 1) -} - -interface YSub : Y { - -} - -class Z2 : Y, YSub { - override fun foo(a : Int) {} -} - -object Z2O : Y, YSub { - override fun foo(a : Int) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.kt b/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.kt index a27d78224ca..5ce0b5442a0 100644 --- a/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.kt +++ b/compiler/testData/diagnostics/tests/override/DefaultParameterValues-NoErrorsWhenInheritingFromOneTypeTwice.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Y { fun foo(a : Int = 1) } diff --git a/compiler/testData/diagnostics/tests/override/DelegationFun.fir.kt b/compiler/testData/diagnostics/tests/override/DelegationFun.fir.kt deleted file mode 100644 index b7ff2c55ef7..00000000000 --- a/compiler/testData/diagnostics/tests/override/DelegationFun.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -package delegation - -interface Aaa { - fun foo() -} - -class Bbb(aaa: Aaa) : Aaa by aaa diff --git a/compiler/testData/diagnostics/tests/override/DelegationFun.kt b/compiler/testData/diagnostics/tests/override/DelegationFun.kt index b7ff2c55ef7..911a17a0044 100644 --- a/compiler/testData/diagnostics/tests/override/DelegationFun.kt +++ b/compiler/testData/diagnostics/tests/override/DelegationFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package delegation interface Aaa { diff --git a/compiler/testData/diagnostics/tests/override/DelegationVal.fir.kt b/compiler/testData/diagnostics/tests/override/DelegationVal.fir.kt deleted file mode 100644 index 7f7a506b5b5..00000000000 --- a/compiler/testData/diagnostics/tests/override/DelegationVal.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -package delegation - -interface Aaa { - val i: Int -} - -class Bbb(aaa: Aaa) : Aaa by aaa diff --git a/compiler/testData/diagnostics/tests/override/DelegationVal.kt b/compiler/testData/diagnostics/tests/override/DelegationVal.kt index 7f7a506b5b5..301e749c60a 100644 --- a/compiler/testData/diagnostics/tests/override/DelegationVal.kt +++ b/compiler/testData/diagnostics/tests/override/DelegationVal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package delegation interface Aaa { diff --git a/compiler/testData/diagnostics/tests/override/DelegationVar.fir.kt b/compiler/testData/diagnostics/tests/override/DelegationVar.fir.kt deleted file mode 100644 index 4c9a70763c1..00000000000 --- a/compiler/testData/diagnostics/tests/override/DelegationVar.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -package delegation - -interface Aaa { - var i: Int -} - -class Bbb(aaa: Aaa) : Aaa by aaa diff --git a/compiler/testData/diagnostics/tests/override/DelegationVar.kt b/compiler/testData/diagnostics/tests/override/DelegationVar.kt index 4c9a70763c1..ebfa4248a2f 100644 --- a/compiler/testData/diagnostics/tests/override/DelegationVar.kt +++ b/compiler/testData/diagnostics/tests/override/DelegationVar.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package delegation interface Aaa { diff --git a/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.fir.kt b/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.fir.kt deleted file mode 100644 index fc35e955bac..00000000000 --- a/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -interface Foo -interface Bar - -interface A { - fun foo() - where T : Foo, T : Bar - = Unit -} - -class B : A { - override fun foo() - where T : Foo, T : Bar - = Unit - -} diff --git a/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt b/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt index fc35e955bac..9e732c950a6 100644 --- a/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt +++ b/compiler/testData/diagnostics/tests/override/EqualityOfIntersectionTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Foo interface Bar diff --git a/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.fir.kt b/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.fir.kt deleted file mode 100644 index 7c8c385152a..00000000000 --- a/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -open class Ccc() { - fun foo() = 1 -} - -interface Ttt { - fun foo(): Int -} - -class Zzz() : Ccc(), Ttt diff --git a/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.kt b/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.kt index 7c8c385152a..51f2766cfe5 100644 --- a/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.kt +++ b/compiler/testData/diagnostics/tests/override/FakeOverrideAbstractAndNonAbstractFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Ccc() { fun foo() = 1 } diff --git a/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.fir.kt b/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.fir.kt deleted file mode 100644 index 94867e7289b..00000000000 --- a/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -open class A { - private fun foo() : Int = 1 -} - -class B : A() { - fun foo() : String = "" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.kt b/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.kt index 94867e7289b..9084d297779 100644 --- a/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.kt +++ b/compiler/testData/diagnostics/tests/override/InvisiblePotentialOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A { private fun foo() : Int = 1 } diff --git a/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.fir.kt b/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.fir.kt deleted file mode 100644 index 158db681970..00000000000 --- a/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -interface X { - fun foo(a : Int = 1) -} - -interface Y { - fun foo(a : Int) -} - -class Z : X, Y { - override fun foo(a : Int) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.kt b/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.kt index 158db681970..4f20c8fee0a 100644 --- a/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.kt +++ b/compiler/testData/diagnostics/tests/override/ParameterDefaultValues-DefaultValueFromOnlyOneSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface X { fun foo(a : Int = 1) } diff --git a/compiler/testData/diagnostics/tests/override/PropertyInConstructor.fir.kt b/compiler/testData/diagnostics/tests/override/PropertyInConstructor.fir.kt deleted file mode 100644 index 409fbb14b2e..00000000000 --- a/compiler/testData/diagnostics/tests/override/PropertyInConstructor.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -open class Base { - protected open val prot: Int = 1 - internal open val int: Int = 1 - public open val pub: Int = 1 -} - -class Child( - override val prot: Int, - override val int: Int, - override val pub: Int -) : Base() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/PropertyInConstructor.kt b/compiler/testData/diagnostics/tests/override/PropertyInConstructor.kt index 409fbb14b2e..b26d5fb0514 100644 --- a/compiler/testData/diagnostics/tests/override/PropertyInConstructor.kt +++ b/compiler/testData/diagnostics/tests/override/PropertyInConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Base { protected open val prot: Int = 1 internal open val int: Int = 1 diff --git a/compiler/testData/diagnostics/tests/override/SuspiciousCase1.fir.kt b/compiler/testData/diagnostics/tests/override/SuspiciousCase1.fir.kt deleted file mode 100644 index e80e4732343..00000000000 --- a/compiler/testData/diagnostics/tests/override/SuspiciousCase1.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// NamedFunctionDescriptor.substitute substitutes "overrides" -// this test checks it does it properly - -interface Foo

{ - fun quux(p: P, q: Int = 17) : Int = 18 -} - -interface Bar : Foo - -abstract class Baz() : Bar - -fun zz(b: Baz) = b.quux("a") diff --git a/compiler/testData/diagnostics/tests/override/SuspiciousCase1.kt b/compiler/testData/diagnostics/tests/override/SuspiciousCase1.kt index e80e4732343..e83fb811d76 100644 --- a/compiler/testData/diagnostics/tests/override/SuspiciousCase1.kt +++ b/compiler/testData/diagnostics/tests/override/SuspiciousCase1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // NamedFunctionDescriptor.substitute substitutes "overrides" // this test checks it does it properly diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.fir.kt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.fir.kt deleted file mode 100644 index 1c27c283354..00000000000 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// FILE: J.java -public interface J { - String foo(); // String! -} - -// FILE: K.kt -interface K1 { - fun foo(): String -} - -interface K2 { - fun foo(): String? -} - -interface KDerived1a : K1, J - -interface KDerived1b : J, K1 - -interface KDerived2a : K2, J - -interface KDerived2b : J, K2 - -interface KDerived12a : K1, K2, J - -interface KDerived12b : K1, J, K2 - -interface KDerived12c : J, K1, K2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.kt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.kt index 1c27c283354..ad8ce555e12 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.kt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: J.java public interface J { String foo(); // String! diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.fir.kt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.fir.kt deleted file mode 100644 index 0c0e63b2220..00000000000 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.fir.kt +++ /dev/null @@ -1,61 +0,0 @@ -// FILE: InOut.kt -interface In - -// FILE: J1.java -public interface J1 { - In foo(); -} - -// FILE: J2.java -import org.jetbrains.annotations.*; - -public interface J2 { - @NotNull In foo(); -} - -// FILE: J3.java -import org.jetbrains.annotations.*; - -public interface J3 { - @Nullable In foo(); -} - -// FILE: K.kt -interface K1 { - fun foo(): In -} - -interface K2 { - fun foo(): In -} - -// FIXME TestJ1K1 should have foo(): In, since In <: In. -interface TestJ1K1 : J1, K1 -interface TestK1J1 : K1, J1 - -interface TestJ1K2 : J1, K2 -interface TestK2J1 : K2, J1 - -interface TestJ2K1 : J2, K1 -interface TestK1J2 : K1, J2 - -interface TestJ2K2 : J2, K2 -interface TestK2J2 : K2, J2 - -interface TestJ3K1 : J3, K1 -interface TestK1J3 : K1, J3 - -interface TestJ3K2 : J3, K2 -interface TestK2J3 : K2, J3 - -interface TestJ1K1K2 : J1, K1, K2 -interface TestK1J1K2 : K1, J1, K2 -interface TestK1K2J1 : K1, K2, J1 - -interface TestJ2K1K2 : J2, K1, K2 -interface TestK1J2K2 : K1, J2, K2 -interface TestK1K2J2 : K1, K2, J2 - -interface TestJ3K1K2 : J3, K1, K2 -interface TestK1J3K2 : K1, J3, K2 -interface TestK1K2J3 : K1, K2, J3 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.kt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.kt index 0c0e63b2220..62ecc3b4587 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.kt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/flexibleReturnTypeIn.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: InOut.kt interface In diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.fir.kt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.fir.kt deleted file mode 100644 index 453cbb87571..00000000000 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.fir.kt +++ /dev/null @@ -1,56 +0,0 @@ -// FILE: JFooWithUpperBound.java -public interface JFooWithUpperBound { - T foo(); -} - -// FILE: JFooWithUpperBoundDerived.java -public interface JFooWithUpperBoundDerived extends JFooWithUpperBound { -} - -// FILE: JCFooWithUpperBound.java -public class JCFooWithUpperBound { - public T foo() { - return null; - } -} - -// FILE: JCFooWithUpperBoundDerived.java -public class JCFooWithUpperBoundDerived extends JCFooWithUpperBound { -} - -// FILE: K.kt -interface IBase - -interface IDerived : IBase - -interface IFooWithUpperBound { - fun foo(): T -} - -interface IFooT { - fun foo(): T -} - -interface IFoo { - fun foo(): IBase -} - -interface IFooDerived : IFoo { - override fun foo(): IDerived -} - -interface IFooWithUpperBoundDerived : IFooWithUpperBound - -interface Test1 : IFooWithUpperBound, IFoo - -interface Test2 : IFooT, IFoo - -interface Test3 : IFooWithUpperBoundDerived, IFooDerived - -interface Test4 : JFooWithUpperBound, IFoo - -interface Test5 : JFooWithUpperBoundDerived, IFooDerived - -class Test6 : JCFooWithUpperBound(), IFoo - -class Test7 : JCFooWithUpperBoundDerived(), IFooDerived \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.kt b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.kt index 453cbb87571..e4b3ec4ecb0 100644 --- a/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.kt +++ b/compiler/testData/diagnostics/tests/override/clashesOnInheritance/genericWithUpperBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: JFooWithUpperBound.java public interface JFooWithUpperBound { T foo(); diff --git a/compiler/testData/diagnostics/tests/override/fakeEquals.fir.kt b/compiler/testData/diagnostics/tests/override/fakeEquals.fir.kt deleted file mode 100644 index 81e96a21e8b..00000000000 --- a/compiler/testData/diagnostics/tests/override/fakeEquals.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_REFERENCE - -class Foo - -fun test(a: Foo, b: Foo) { - // Note that signature matches the 'equals' - fun equals(x: Any?): Boolean = false - equals(b) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/fakeEquals.kt b/compiler/testData/diagnostics/tests/override/fakeEquals.kt index 81e96a21e8b..11ca2ed1444 100644 --- a/compiler/testData/diagnostics/tests/override/fakeEquals.kt +++ b/compiler/testData/diagnostics/tests/override/fakeEquals.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_REFERENCE class Foo diff --git a/compiler/testData/diagnostics/tests/override/kt6014.fir.kt b/compiler/testData/diagnostics/tests/override/kt6014.fir.kt deleted file mode 100644 index a8ecad03d8d..00000000000 --- a/compiler/testData/diagnostics/tests/override/kt6014.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -interface IBase { - override fun toString(): String -} - -interface IDerived : IBase - -object BaseImpl : IBase { - override fun toString(): String = "A" -} - -object DerivedImpl : IDerived { - override fun toString(): String = "A" -} - -class Test1 : IBase by BaseImpl - -class Test2 : IDerived by DerivedImpl diff --git a/compiler/testData/diagnostics/tests/override/kt6014.kt b/compiler/testData/diagnostics/tests/override/kt6014.kt index a8ecad03d8d..f03a770a76b 100644 --- a/compiler/testData/diagnostics/tests/override/kt6014.kt +++ b/compiler/testData/diagnostics/tests/override/kt6014.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IBase { override fun toString(): String } diff --git a/compiler/testData/diagnostics/tests/override/kt8990.fir.kt b/compiler/testData/diagnostics/tests/override/kt8990.fir.kt deleted file mode 100644 index ca218fc52c8..00000000000 --- a/compiler/testData/diagnostics/tests/override/kt8990.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -open class A { - private fun foo() {} - - inner class B : A() { - private fun foo() {} - } -} - -class C : A() { - private fun foo() {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/override/kt8990.kt b/compiler/testData/diagnostics/tests/override/kt8990.kt index ca218fc52c8..cf7d717fa18 100644 --- a/compiler/testData/diagnostics/tests/override/kt8990.kt +++ b/compiler/testData/diagnostics/tests/override/kt8990.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A { private fun foo() {} diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.fir.kt b/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.fir.kt deleted file mode 100644 index dacf0a11ff9..00000000000 --- a/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: Super.java - -interface Super { - void foo(long superName); -} - -// FILE: Sub.java - -interface Sub extends Super { -} - -// FILE: SubSub.kt - -class SubSub : Sub { - override fun foo(subName: Long) {} -} diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.kt b/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.kt index dacf0a11ff9..3ba9620fcf7 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.kt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/jjkHierarchy.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Super.java interface Super { diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.fir.kt b/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.fir.kt deleted file mode 100644 index 32527db7597..00000000000 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.fir.kt +++ /dev/null @@ -1,51 +0,0 @@ -// FILE: KSuper.kt - -interface KSuper { - fun foo(ksuperName: Int) -} - -// FILE: JSuper1.java - -interface JSuper1 { - void foo(int jsuper1Name); -} - -// FILE: JSuper2.java - -interface JSuper2 { - void foo(int jsuper2Name); -} - - -// FILE: Sub1.java -interface Sub1 extends KSuper, JSuper1, JSuper2 { - @Override - void foo(int sub1Name); -} - -// FILE: Sub2.java -interface Sub2 extends JSuper1, KSuper, JSuper2 { - @Override - void foo(int sub2Name); -} - -// FILE: Sub3.java -interface Sub3 extends JSuper1, JSuper2, KSuper { - @Override - void foo(int sub3Name); -} - - -// FILE: SubSub.kt - -class SubSub1 : Sub1 { - override fun foo(ksuperName: Int) {} -} - -class SubSub2 : Sub2 { - override fun foo(ksuperName: Int) {} -} - -class SubSub3 : Sub3 { - override fun foo(ksuperName: Int) {} -} diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.kt b/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.kt index 32527db7597..1eb29501cc4 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.kt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/kjkWithSeveralSupers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KSuper.kt interface KSuper { diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.fir.kt b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.fir.kt deleted file mode 100644 index 1e7d997c393..00000000000 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: JavaInterface.java - -public interface JavaInterface { - void foo(int javaName); -} - -// FILE: kotlin.kt - -class SimpleSubclass : JavaInterface { - override fun foo(kotlinName: Int) {} -} - - -interface SubtraitWithFakeOverride : JavaInterface - -class Subclass : SubtraitWithFakeOverride { - override fun foo(otherKotlinName: Int) {} -} diff --git a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.kt b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.kt index 1e7d997c393..21fd2f6ac36 100644 --- a/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.kt +++ b/compiler/testData/diagnostics/tests/override/parameterNames/kotlinInheritsJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: JavaInterface.java public interface JavaInterface { diff --git a/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.fir.kt b/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.fir.kt deleted file mode 100644 index 61f5cf91a8c..00000000000 --- a/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -interface I1 -interface I2 -open class C - -interface A { - fun foo(t: T) where T : I1, T : C, T : I2 -} - -interface B1 : A { - override fun foo(t: T) where T : C, T : I1, T : I2 -} - -interface B2 : A { - override fun foo(t: T) where T : I1, T : C, T : I2 -} - -interface B3 : A { - override fun foo(t: T) where T : I1, T : I2, T : C -} - -interface B4 : A { - override fun foo(t: T) where T : C, T : I2, T : I1 -} - -interface B5 : A { - override fun foo(t: T) where T : I2, T : C, T : I1 -} - -interface B6 : A { - override fun foo(t: T) where T : I2, T : I1, T : C -} diff --git a/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.kt b/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.kt index 61f5cf91a8c..17c5a1dad89 100644 --- a/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.kt +++ b/compiler/testData/diagnostics/tests/override/typeParameters/classAndTwoInterfaceBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface I1 interface I2 open class C diff --git a/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.fir.kt b/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.fir.kt deleted file mode 100644 index 413c36eebd3..00000000000 --- a/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -abstract class Base { - abstract fun foo(list: List) where T : Number, T : Comparable -} - -class Derived : Base() { - override fun foo(list: List) where T : Number, T : Comparable { - } -} diff --git a/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.kt b/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.kt index 413c36eebd3..8b443a47cbb 100644 --- a/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.kt +++ b/compiler/testData/diagnostics/tests/override/typeParameters/kt9850.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class Base { abstract fun foo(list: List) where T : Number, T : Comparable } diff --git a/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.fir.kt b/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.fir.kt deleted file mode 100644 index 37d3705f995..00000000000 --- a/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -interface A - -interface B { - fun accept(visitor: String) - fun accept(visitor: A): R -} - -interface C : B { - override fun accept(visitor: A): R -} diff --git a/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.kt b/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.kt index 37d3705f995..e7eb076c3eb 100644 --- a/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.kt +++ b/compiler/testData/diagnostics/tests/override/typeParameters/simpleVisitorTwoAccepts.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A interface B { diff --git a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.fir.kt b/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.fir.kt deleted file mode 100644 index a33e3c04054..00000000000 --- a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface AnnotationsOnNullableParenthesizedTypes { - fun B<(@A C)?>.receiverArgument() {} - - fun parameter(a: (@A C)?) {} - - fun parameterArgument(a: B<(@A C)?>) {} - - fun returnValue(): (@A C)? - - fun returnTypeParameterValue(): (@A T)? - - fun returnArgument(): B<(@A C)?> - - val lambdaType: (@A() (() -> C))? - - val lambdaParameter: ((@A C)?) -> C - - val lambdaReturnValue: () -> (@A C)? - - val lambdaReceiver: (@A C)?.() -> C -} - -@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) -annotation class A - -interface B -interface C \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.kt b/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.kt index a33e3c04054..1a5ced711d9 100644 --- a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.kt +++ b/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnNullableParenthesizedTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface AnnotationsOnNullableParenthesizedTypes { diff --git a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.fir.kt b/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.fir.kt deleted file mode 100644 index ab5e5e046e6..00000000000 --- a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface AnnotationsOnParenthesizedTypes { - fun B<(@A C)>.receiverArgument() {} - - fun parameter(a: (@A C)) {} - - fun parameterArgument(a: B<(@A C)>) {} - - fun returnValue(): (@A C) - - fun returnTypeParameterValue(): (@A T) - - fun returnArgument(): B<(@A C)> - - val lambdaType: (@A() (() -> C)) - - val lambdaParameter: ((@A C)) -> C - - val lambdaReturnValue: () -> (@A C) - - val lambdaReceiver: (@A C).() -> C - - val lambdaParameterNP: (@A C) -> C -} - -@Target(AnnotationTarget.TYPE, AnnotationTarget.TYPE_PARAMETER) -annotation class A - -interface B -interface C \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.kt b/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.kt index ab5e5e046e6..5545e27d0e5 100644 --- a/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.kt +++ b/compiler/testData/diagnostics/tests/parenthesizedTypes/annotationsOnParenthesizedTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface AnnotationsOnParenthesizedTypes { diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.fir.kt deleted file mode 100644 index 73340ce072f..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: p/Utils.java - -package p; - -public class Utils { - public static java.util.Collection c() { return null; } -} - -// FILE: k.kt - -import p.* - -fun T.foo() {} - -fun test(b: Boolean) { - val c = if (b) Utils.c() else null - - c?.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.kt index 73340ce072f..3bc5149cd60 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/collectionOrNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/Utils.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.fir.kt deleted file mode 100644 index 4a4d125e162..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.fir.kt +++ /dev/null @@ -1,41 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: p/Super.java - -package p; - -public interface Super { - -} - -// FILE: p/Sub.java - -package p; - -public interface Sub extends Super {} - -// FILE: p/Other.java - -package p; - -import java.util.*; - -public class Other { - - public static Sub sub; - - public static Collection subs; - public static Collection supers; -} - -// FILE: k.kt - -import p.* - -fun test() { - val col = if (1 < 2) Other.subs else Other.supers - col.foo() -} - -fun Collection.foo(): T = null!! -fun listOf(t: T): List = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.kt index 4a4d125e162..7f6ee63cdc3 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/inferenceWithBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: p/Super.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.fir.kt deleted file mode 100644 index eab1285e638..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// !CHECK_TYPE - -import java.util.ArrayList - -fun foo(handlers: Array?>) { - val v = handlers[0] ?: ArrayList() - handlers[0] = v - val js: MutableList = v - // TODO: fix with dominance -// v checkType { it : _>} -// v checkType { it : _>} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.kt index eab1285e638..544311c65a7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedElvis.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // !CHECK_TYPE diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.fir.kt deleted file mode 100644 index 5c1639e3079..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// !CHECK_TYPE -// FILE: p/J.java - -package p; - -public class J { - public static J j() { return null; } -} - -// FILE: k.kt - -import p.* - -fun foo(j: J) { - val v = if (true) j else J.j() - val js: J = v - // TODO: fix with dominance -// v checkType { it : _>} -// v checkType { it : _>} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.kt index 5c1639e3079..d4b756c2fea 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/mixedIf.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // !CHECK_TYPE // FILE: p/J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.fir.kt deleted file mode 100644 index fd370e7547e..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -// !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE - -// FILE: p/Rec.java - -package p; - -public interface Rec { - -} - -// FILE: p/A.java - -package p; - -public interface A extends Rec { - -} - -// FILE: p/B.java - -package p; - -public interface B extends Rec { - -} - -// FILE: k.kt - -import p.* - -fun test(a: A, b: B, c: Boolean) { - var ab = if (c) a else b - ab = a - ab = b -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.kt index fd370e7547e..973f6e7eede 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/recursiveGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE // FILE: p/Rec.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.fir.kt deleted file mode 100644 index 79e2df864bc..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: p/Utils.java - -package p; - -public class Utils { - public static String str() { return null; } -} - -// FILE: k.kt - -import p.* - -fun T.foo() {} - -fun test(b: Boolean) { - val str = if (b) Utils.str() else null - - str?.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.kt index 79e2df864bc..b1acfdd509f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/stringOrNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/Utils.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.fir.kt deleted file mode 100644 index 907f324a43b..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: p/J.java - -package p; - -public class J { - public static J j() { return null; } -} - -// FILE: k.kt - -import p.* - -fun foo(): J? = null - -fun main() { - val v = foo() ?: J.j() - if (v != null) { - - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.kt index 907f324a43b..aede5b02fe3 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/typeOfElvis.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.fir.kt deleted file mode 100644 index ffc1f27d5dc..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: A.java - -import java.util.*; - -public interface A { - void foo(); -} - -// FILE: B.java - -public interface B extends A {} - -// FILE: k.kt - -class C(x: A) : A by x, B {} diff --git a/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.kt b/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.kt index ffc1f27d5dc..f122b2c688d 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/delegateByComplexInheritance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java import java.util.*; diff --git a/compiler/testData/diagnostics/tests/platformTypes/dereference.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/dereference.fir.kt deleted file mode 100644 index 78a8bfaae72..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/dereference.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !CHECK_TYPE - -// FILE: p/J.java - -package p; - -public class J { - public J j() {return null;} - - public T foo() {return null;} - public T foo1() {return null;} -} - -// FILE: k.kt - -import p.* - -fun test(j: J) { - checkSubtype(j.j()) - j.j().j() - j.j()!!.j() - - val ann = j.foo() - ann!!.length - ann.length - - val a = j.foo() - a!!.j() - a.j() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/dereference.kt b/compiler/testData/diagnostics/tests/platformTypes/dereference.kt index 78a8bfaae72..8daf652b162 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/dereference.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/dereference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: p/J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/elvis.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/elvis.fir.kt deleted file mode 100644 index ce6b32105a7..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/elvis.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION - -// FILE: p/J.java - -package p; - -public class J { - public String s() { return null; } -} - -// FILE: k.kt -import p.* - -fun test(j: J) { - j.s()?.length ?: "" -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/elvis.kt b/compiler/testData/diagnostics/tests/platformTypes/elvis.kt index ce6b32105a7..b337f6bc674 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/elvis.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/elvis.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION // FILE: p/J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.fir.kt deleted file mode 100644 index 6be7f3dcf05..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.*; - -public class A { - void foo(List x) {} -} -// FILE: main.kt - -fun main(a: A, ml: MutableList, l: List) { - a.foo(ml) - a.foo(l) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.kt b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.kt index 6be7f3dcf05..1770646716a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/rawTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.fir.kt deleted file mode 100644 index f06e8d918d6..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.*; - -public class A { - void foo(Out x) {} - void bar(Out x) {} -} -// FILE: main.kt - -public class Out() - -fun main(a: A, o: Out) { - a.foo(o) - a.bar(o) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.kt b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.kt index f06e8d918d6..c99b3dde764 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/userDefinedOut.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.fir.kt deleted file mode 100644 index 844dc40d09a..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.fir.kt +++ /dev/null @@ -1,49 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.*; - -public class A { - void foo(List x) {} - void foo(Iterable x) {} - void foo(Iterator x) {} - void foo(Set x) {} - void foo(Map x) {} - void foo(Map.Entry x) {} -} - -// FILE: main.kt - -fun main( - a: A, - ml: MutableList, l: List, - ms: MutableSet, s: Set, - mm: MutableMap, m: Map, - mme: MutableMap.MutableEntry, me: Map.Entry -) { - // Lists - a.foo(ml) - a.foo(l) - - // Iterables - val mit: MutableIterable = ml - val it: Iterable = ml - a.foo(mit) - a.foo(it) - - // Iterators - a.foo(ml.iterator()) - a.foo(l.iterator()) - - // Sets - a.foo(ms) - a.foo(s) - - // Maps - a.foo(mm) - a.foo(m) - - // Map entries - a.foo(mme) - a.foo(me) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.kt b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.kt index 844dc40d09a..084128c7af4 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/genericVarianceViolation/wildcards.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.fir.kt deleted file mode 100644 index 298c74ab12a..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// FILE: p/PsiElement.java - -package p; - -public interface PsiElement {} - -// FILE: p/JetExpression.java - -package p; - -public interface JetExpression extends PsiElement {} - -// FILE: p/Util.java - -package p; - -public class Util { - - public static T getParentOfType(@Nullable PsiElement element, @NotNull Class aClass) { - return null; - } - - public static void on(JetExpression e) {} -} - -// FILE: k.kt - -import p.* - -fun test(e: JetExpression) { - Util.on( - Util.getParentOfType(e, javaClass()) ?: e - ) -} - -fun javaClass(): Class = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.kt b/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.kt index 298c74ab12a..9cf46900f6a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/getParentOfType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/PsiElement.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/intersection/map.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/intersection/map.fir.kt deleted file mode 100644 index 5edcc2d090d..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/intersection/map.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE -// !EXPLICIT_FLEXIBLE_TYPES - -fun foo( - p1: ft, Map?>, - p2: Map -) = p1 == p2 - -fun foo( - p1: ft, - p2: String -) = p1 == p2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/intersection/map.kt b/compiler/testData/diagnostics/tests/platformTypes/intersection/map.kt index 5edcc2d090d..154d9cd7c1c 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/intersection/map.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/intersection/map.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !EXPLICIT_FLEXIBLE_TYPES diff --git a/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.fir.kt deleted file mode 100644 index a31eb896c2f..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !CHECK_TYPE - -// FILE: Collections.java -import java.util.List; - -public class Collections { - public static final List emptyList() { - return null; - } -} - -// FILE: 1.kt - -fun bar(): List = null!! - -fun test() { - val f = if (true) { - Collections.emptyList() - } - else { - bar() - } - - checkSubtype>(f) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.kt b/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.kt index a31eb896c2f..1d22b4b6fff 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/javaEmptyList.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: Collections.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.fir.kt deleted file mode 100644 index 3aaf4cce6e2..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: p/MultiMap.java - -package p; - -import java.util.*; - -public class MultiMap { - public Set> entrySet() { - return null; - } -} - -// FILE: k.kt - -import p.* - -fun test() { - val map = MultiMap() - val set = map.entrySet() - set.iterator() - - val set1 = map.entrySet()!! - set1.iterator() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.kt index 3aaf4cce6e2..35af15b8c1f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/entrySet.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/MultiMap.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt deleted file mode 100644 index 754b5196000..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// Issue: KT-36254 - -// FILE: Convertor.java - -public interface Convertor { - Dst convert(Src o); -} - -// FILE: main.kt - -fun takeConvertor(c: Convertor) {} - -fun main() { - takeConvertor(Convertor { null }) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.kt index 754b5196000..cc6f630d3e9 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt deleted file mode 100644 index fb3e0dcba7f..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// Issue: KT-36254 - -// FILE: Convertor.java - -public interface Convertor { - Out convert(Out o); -} - -// FILE: main.kt - -fun takeConvertor(c: Convertor) {} - -class Out {} - -fun main(o: Out) { - takeConvertor(Convertor { o }) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.kt index fb3e0dcba7f..8a9355e6e85 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/flexibilityThroughTypeVariableOut.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.fir.kt deleted file mode 100644 index 143f5c4cd89..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: p/J.java - -package p; - -public class J { - public void foo(Ref r) {} -} - -// FILE: p/Ref.java - -package p; - -public class Ref { - public static Ref create() { return null; } -} - -// FILE: k.kt - -import p.* - -fun main(j: J) { - val r = Ref.create>() - j.foo(r) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.kt index 143f5c4cd89..5415d2d89dd 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/genericsAndArrays.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.fir.kt deleted file mode 100644 index d79113f9023..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: p/J.java - -package p; - -public class J { - public void intArr(int[] s) {} -} - -// FILE: k.kt - -import p.* - -fun test(ia: IntArray) { - J().intArr(ia) - J().intArr(null) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.kt index d79113f9023..6319245892f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/intArray.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.fir.kt deleted file mode 100644 index fa1baddc8f9..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import java.util.* - -fun takeJ(map: Map) {} - -fun test() { - takeJ(HashMap()) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.kt index fa1baddc8f9..9b14eb42881 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaCollectionToKotlin.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import java.util.* diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.fir.kt deleted file mode 100644 index cbd9d0da968..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: p/J.java - -package p; - -import java.util.ArrayList; - -public class J { - public ArrayList list() { return null; } - public void takeList(ArrayList list) { } -} - -// FILE: k.kt - -import p.* - -fun test(j: J) { - j.takeList(j.list()) - val l = j.list() - j.takeList(l) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.kt index cbd9d0da968..5e070b669ca 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.fir.kt deleted file mode 100644 index e454e5b2dca..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// FILE: p/J.java - -package p; - -public class J { - public J j() { return this; } -} - -// FILE: k.kt - -import p.* - -fun takeJ(j: J) {} - -fun test() { - takeJ(J().j()) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.kt index e454e5b2dca..836fb3d4ee1 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/javaToKotlin.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: p/J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.fir.kt deleted file mode 100644 index d08d6cf52fa..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import java.util.* - -fun test(map: Map) { - HashMap(map) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.kt index d08d6cf52fa..9c105b49871 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/kotlinCollectionToJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER import java.util.* diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.fir.kt deleted file mode 100644 index fb32dda83fc..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-27565 - -// FILE: Runnable.java - -public interface Runnable { - void run(); -} - -// FILE: k.kt - -fun fail() { - foo({ }, { }) - foo(::bar, { }) -} - -fun foo(f: Runnable, selector: () -> Unit) {} -fun foo(func1: () -> Unit, func2: () -> Unit) {} - -fun bar() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.kt index fb32dda83fc..a43295c5461 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/kt27565.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions // !DIAGNOSTICS: -UNUSED_PARAMETER // ISSUE: KT-27565 diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.fir.kt deleted file mode 100644 index a1f4cf524f8..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: p/J.java - -package p; - -public class J { - public void list(java.util.List s) {} -} - -// FILE: k.kt - -import p.* - -fun test(ls: List, mls: MutableList, lsn: List, mlsn: MutableList?) { - J().list(ls) - J().list(mls) - J().list(lsn) - J().list(mlsn) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.kt index a1f4cf524f8..3391c9d196a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/list.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.fir.kt deleted file mode 100644 index 64ac5f084cf..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !CHECK_TYPE -// FILE: p/J.java - -package p; - -public class J { - public void arr(Object[] s) {} -} - -// FILE: k.kt - -import p.* - -fun test( - aa: Array, - sa: Array, - san: Array -) { - J().arr(null) - J().arr(aa) - J().arr(sa) - J().arr(san) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.kt index 64ac5f084cf..312a8dae040 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/objectArray.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: p/J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.fir.kt deleted file mode 100644 index d15ca76f0a5..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// FILE: p/Super.java -package p; - -public interface Super {} - -// FILE: p/Sub.java -package p; - -public interface Sub extends Super {} - -// FILE: p/Util.java - -package p; - -public abstract class Util { - public abstract void foo(String s, Super sup); - public void foo(String s, Sub sub) {} -} - -// FILE: k.kt - -import p.* - -class C: Util() { - override fun foo(s: String, sub: Super) {} -} - -fun foo(sub: Sub) { - C().foo("", sub) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.kt index d15ca76f0a5..0fe9193d570 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/overloadingForSubclass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/Super.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.fir.kt deleted file mode 100644 index ed1b08ed76a..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// FILE: p/SAM.java - -package p; - -public interface SAM { - R foo(); -} - -// FILE: p/Util.java - -package p; - -public class Util { - - public static void sam(SAM sam) {} -} - -// FILE: k.kt - -import p.* - -fun test() { - Util.sam { - null - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.kt index ed1b08ed76a..fc91452da76 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/sam.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/SAM.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.fir.kt deleted file mode 100644 index 1b0f1370754..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: p/J.java - -package p; - -public class J { - public void str(J s) {} -} - -// FILE: k.kt - -import p.* - -fun test() { - J().str(J()) - J().str(null) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.kt index 1b0f1370754..cc810791d75 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/string.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.fir.kt deleted file mode 100644 index ee932531ddb..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !WITH_NEW_INFERENCE -// FILE: p/Visitor.java - -package p; - -public interface Visitor { - -} - -// FILE: p/Element.java - -package p; - -import org.jetbrains.annotations.NotNull; - -public class Element { - public R accept(@NotNull Visitor visitor, D data) {return null;} -} - -// FILE: k.kt - -import p.* - -fun test(v: Visitor, e: Element) { - e.accept(v, null) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt b/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt index ee932531ddb..83ea7decc29 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodCall/visitor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // FILE: p/Visitor.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.fir.kt deleted file mode 100644 index 2d3b7398878..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// FILE: Derived.java -import kotlin.jvm.functions.Function0; -import org.jetbrains.annotations.NotNull; - -public class Derived implements Base { - @Override - public void foo() {} -} - -// FILE: main.kt -interface Base { - fun foo() -} - -class KotlinDerived1 : Derived() { - override fun foo() {} -} - -class KotlinDerived2 : Derived() { - override fun foo() {} -} - -fun main() { - Derived().foo() -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.kt b/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.kt index 2d3b7398878..9141fa4343b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/methodTypeParameterDefaultBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Derived.java import kotlin.jvm.functions.Function0; import org.jetbrains.annotations.NotNull; diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.fir.kt deleted file mode 100644 index c86b1711a17..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// FILE: A.kt - -import org.jetbrains.annotations.NotNull; -public interface A { - fun foo(x: T) -} - -// FILE: B.java -public class B { - public void foo(E x) {} -} - -// FILE: C.java -public class C extends B implements A { - public static C create() { return null; } - public void foo(F x) {} -} - -// FILE: main.kt - -fun test() { - C.create().foo(null) - C.create().foo("") - - C().foo(null) - C().foo(null) - C().foo("") -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.kt b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.kt index c86b1711a17..f9435b93b41 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/notNullTypeParameter/enhancementFromKotlin.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.kt import org.jetbrains.annotations.NotNull; diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.fir.kt deleted file mode 100644 index fe37a7510fb..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// FILE: J.java - -import org.jetbrains.annotations.*; -import java.util.*; - -public class J { - @NotNull - public String nn() { return ""; } - - @Nullable - public List n() { return null; } -} - -// FILE: k.kt - -fun safeCall(c: J?) { - c?.nn()?.length -} - -fun ifelse(c: J): Any? { - return if (true) c.nn() else null -} - -fun elvis(c: J): Any? { - return null ?: c.nn() -} - diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.kt index fe37a7510fb..20d57a07aa8 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/inferenceInConditionals.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: J.java import org.jetbrains.annotations.*; diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.fir.kt deleted file mode 100644 index e9891546877..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun test() { - take(nullable() ?: nullable() ?: "foo") -} - -fun nullable(): T? = TODO() -fun take(x: Any) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt index e9891546877..02d03a4e158 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/noWarningOnDoubleElvis.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun test() { diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.fir.kt deleted file mode 100644 index 420dc45a990..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: J.java - -import org.jetbrains.annotations.*; - -public class J { - public @NotNull String nn() { return ""; } -} - -// FILE: k.kt - -fun test(j: J?) { - val s = j?.nn() - if (s != null) { - - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.kt index 420dc45a990..c07889514b7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAfterSafeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: J.java import org.jetbrains.annotations.*; diff --git a/compiler/testData/diagnostics/tests/platformTypes/override.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/override.fir.kt deleted file mode 100644 index bf7c372a64f..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/override.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// FILE: p/I.java - -package p; - -import p.J.Param; - -public interface I { - String s(); -} - -// FILE: p/J.java - -package p; - -public class J implements I { - public String s() { return null; } -} - -// FILE: k.kt -import p.* - -fun test() { - val s = J().s() - s.get(0) - s!!.get(0) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/override.kt b/compiler/testData/diagnostics/tests/platformTypes/override.kt index bf7c372a64f..2899b610c3f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/override.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/override.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/I.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.fir.kt deleted file mode 100644 index 594034d0c9f..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: A.java -import java.util.*; - -public class A { - public void foo(Err x, List y); -} - -// FILE: B.java - -public class B extends A { - -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.kt index 594034d0c9f..1c339397962 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/errorType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java import java.util.*; diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.fir.kt deleted file mode 100644 index a0351f21e5c..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -// FILE: JavaScriptParser.java -public class JavaScriptParser {} -// FILE: JSPsiTypeParser.java -public class JSPsiTypeParser {} diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.kt index a0351f21e5c..fdf5d1d7ad4 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/interClassesRecursion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: JavaScriptParser.java public class JavaScriptParser {} // FILE: JSPsiTypeParser.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.fir.kt deleted file mode 100644 index 302f3976a29..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: B.java -import java.util.List; - -public class B implements X { - @Override - List foo(List l) { - return super.foo(l); - } -} - -// FILE: 1.kt - -interface X { - fun foo(l: MutableList): List? -} - -internal class C : B() diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.kt index 302f3976a29..3a31e83bcd5 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawEnhancment.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: B.java import java.util.List; diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.fir.kt deleted file mode 100644 index a5a839b461a..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.List; - -public class A { - List getChildrenStubs() { return null; } - void consume(T x) {} - - T produce() { return null; } -} - -// FILE: B.java - -public class B { - public E foo() { return null;} - E field; -} - -// FILE: Test.java - -public class Test { - static B rawB = null; -} - -// FILE: main.kt - -fun foo(x: B<*>) { - // TODO: x.foo() now is flexible type instead of raw, because of captured type approximation - val q: MutableList = x.foo().getChildrenStubs() - - // Raw(B).field erased to A..A? - Test.rawB.field = A() - val anyA: A = Test.rawB.field - - Test.rawB.field.consume("") - val y: Any = Test.rawB.field.produce() -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.kt index a5a839b461a..ade575bbaed 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawTypeInUpperBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.fir.kt deleted file mode 100644 index db44de8b200..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// FILE: Test.java - -class Test { - static void foo(Comparable x) {} -} - -// FILE: main.kt - -fun main() { - Test.foo(1) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.kt index db44de8b200..cb8114dac5a 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/rawWithInProjection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Test.java class Test { diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.fir.kt deleted file mode 100644 index 2c6e7839c86..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.List; - -public interface A {} -// FILE: main.kt - -class D : A - -fun main(x: A<*>) { - if (x is D) { - - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.kt index 2c6e7839c86..dd18ccfe9a0 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/recursiveBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.fir.kt deleted file mode 100644 index aac713a9e7a..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.*; - -class A { - public class Inner { - List foo() {} - } -} - -// FILE: Test.java - -class Test { - static A rawAField = null; -} - -// FILE: main.kt - -val result = Test.rawAField.Inner().foo() diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.kt index aac713a9e7a..1e421b73b63 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/saveRawCapabilitiesAfterSubtitution.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.fir.kt deleted file mode 100644 index 4a89c3ce777..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java - -import java.util.*; - -public class A {} - -// FILE: B.java - -import java.util.*; - -public class B {} - -// FILE: Test.java - -class Test { - static void foo(B x) {} -} - -// FILE: main.kt - - -fun main(x: B<*>) { - Test.foo(x) -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt index 4a89c3ce777..54e0a5c1bbc 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/safeCall.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/safeCall.fir.kt deleted file mode 100644 index 9c38f26a63d..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/safeCall.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !CHECK_TYPE -// FILE: p/J.java - -package p; - -public class J { - public String s() { return null; } -} - -// FILE: k.kt -import p.* - -fun test(j: J) { - j.s()?.length.checkType { _() } -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/safeCall.kt b/compiler/testData/diagnostics/tests/platformTypes/safeCall.kt index 9c38f26a63d..fbb77ca02f8 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/safeCall.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/safeCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: p/J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.fir.kt deleted file mode 100644 index 6918bd69c88..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER - -// FILE: A.java -import java.util.Comparator; - -public class A { - public A(Comparator comparator) {} -} - -// FILE: main.kt - -fun foo() { - val result: A = A { x, y -> 1 } -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.kt b/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.kt index 6918bd69c88..97dca85242b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/samAdapterInConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/samConstructor.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.fir.kt deleted file mode 100644 index 51507e0d511..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/samConstructor.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: p/J.java - -package p; - -public class J { - public static void c(java.util.Comparator c) {} - -} - -// FILE: k.kt - -import java.util.* -import p.* - -fun test() { - J.c(Comparator { a, b -> b - a }) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt index 51507e0d511..87ab98967ed 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/samConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.fir.kt deleted file mode 100644 index 899414d61cc..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// JAVAC_EXPECTED_FILE -interface ExtMap : Map -class HashMapEx : java.util.HashMap(), ExtMap \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.kt b/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.kt index 899414d61cc..8746f6be26d 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/supertypeTypeArguments.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE interface ExtMap : Map class HashMapEx : java.util.HashMap(), ExtMap \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/privateInFile/kt12429.fir.kt b/compiler/testData/diagnostics/tests/privateInFile/kt12429.fir.kt deleted file mode 100644 index 9cc707d89e9..00000000000 --- a/compiler/testData/diagnostics/tests/privateInFile/kt12429.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -private const val a = "" - -@Deprecated("$a") -fun test() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/privateInFile/kt12429.kt b/compiler/testData/diagnostics/tests/privateInFile/kt12429.kt index 9cc707d89e9..1be7c68958b 100644 --- a/compiler/testData/diagnostics/tests/privateInFile/kt12429.kt +++ b/compiler/testData/diagnostics/tests/privateInFile/kt12429.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL private const val a = "" @Deprecated("$a") diff --git a/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.fir.kt b/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.fir.kt deleted file mode 100644 index 62acd1f9aba..00000000000 --- a/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.fir.kt +++ /dev/null @@ -1,39 +0,0 @@ -//!LANGUAGE: +ProperComputationOrderOfTailrecDefaultParameters -import kotlin.reflect.KClass - -fun withEffects(): String = "OK" - -const val Z = "123" - -enum class EnumA { - A -} - -tailrec fun foo(i: Int = 1, c: Char = '2', s: String = "1234", b: Boolean = true, d: Double = 1.0, l: Long = 1L, y: String = withEffects()) { - foo(i, c, s, b, d, l, y) -} - - -tailrec fun foo2(x: Int = 1, y: String = withEffects(), z: String = Z) { - foo2(x, y, z) -} - -tailrec fun foo3(y: String = withEffects()) { - foo3(y) -} - -tailrec fun foo4(x: String = withEffects(), y: String = withEffects()) { - foo4(x, y) -} - -tailrec fun foo5(x: String = withEffects(), y: String = withEffects(), z: String = withEffects()) { - foo5(x, y, z) -} - -tailrec fun foo6(x: String = withEffects(), y: EnumA = EnumA.A) { - foo6(x, y) -} - -tailrec fun foo7(x: String = withEffects(), y: KClass = EnumA.A::class) { - foo7(x, y) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.kt b/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.kt index 62acd1f9aba..22fda7bf3d9 100644 --- a/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.kt +++ b/compiler/testData/diagnostics/tests/properDefaultInitializationInTailrec.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //!LANGUAGE: +ProperComputationOrderOfTailrecDefaultParameters import kotlin.reflect.KClass diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.fir.kt deleted file mode 100644 index 8b40039c0d8..00000000000 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.fir.kt +++ /dev/null @@ -1,76 +0,0 @@ -// MODULE: m1 -// FILE: a.kt -package a.b - -class c { - fun ab_c() {} -} - -// MODULE: m2 -// FILE: b.kt -package a - -class b { - class c { - fun a_bc() {} - } -} - -// MODULE: m3(m1, m2) -// FILE: c.kt -import a.b.c - -fun test(ab_c: c) { - ab_c.ab_c() - - val ab_c2: a.b.c = a.b.c() - ab_c2.ab_c() - - val ab_c3 = a.b.c() - ab_c3.ab_c() -} - -// NB according to the maximum package prefix rule, 'a.b.c' denotes 'c' in package 'a.b' (thus ab_c, not a_bc) -fun test2(ab_c: a.b.c) { - ab_c.a_bc() - ab_c.ab_c() -} - - - -//---------------------------TOP LEVEL---------- -// MODULE: top_m1 -// FILE: top_a.kt -package a - -class b { - fun a_b() {} -} - -// MODULE: top_m2 -// FILE: top_b.kt -class a { - class b { - fun _ab() {} - } - fun _a() {} -} - -// MODULE: top_m3(top_m1, top_m2) -// FILE: top_c.kt -import a.b - -fun test(a_b: b) { - a_b.a_b() - - val _ab: a.b = a.b() - _ab._ab() - - val _ab2 = a.b() - _ab2._ab() -} - -fun test2(_ab: a.b) { - _ab._ab() - _ab.a_b() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.kt index 8b40039c0d8..420c713b615 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/GenericClassVsPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt package a.b diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.fir.kt deleted file mode 100644 index b0f497158d2..00000000000 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: Owner.java - -public class Owner { - public static final String name = "Owner"; -} - -// FILE: Use.kt - -val x = Owner.name diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.kt index b0f497158d2..37eb0598cdf 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/JavaQualifier.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Owner.java public class Owner { diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.fir.kt deleted file mode 100644 index 53c311808ae..00000000000 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.fir.kt +++ /dev/null @@ -1,88 +0,0 @@ -// MODULE: m1 -// FILE: a.kt -package a.b - -class c { - fun ab_c() {} -} - -// MODULE: m2 -// FILE: b.kt -package a - -fun a_fun() {} - -class b { - fun a_b() {} - - class c { - fun a_bc() {} - } -} - -// MODULE: m3(m1, m2) -// FILE: c.kt - -fun test(a_b: a.b) { - a_b.a_b() - - val ab_c: a.b.c = a.b.c() - ab_c.ab_c() - ab_c.a_bc() - - val ab_c2 = a.b.c() - ab_c2.ab_c() - ab_c2.a_bc() -} - -fun test2(ab_c: a.b.c) { - ab_c.ab_c() -} - -//---- Changed dependence order -// MODULE: _m1 -// FILE: _a.kt -package a.b - -fun ab_fun() {} - -class c { - fun ab_c() {} - - class d { - fun ab_cd() {} - } -} - -// MODULE: _m2 -// FILE: _b.kt -package a - -fun a_fun() {} - -class b { - fun a_b() {} - - class c { - fun a_bc() {} - } -} - -// MODULE: _m3(_m1, _m2) -// FILE: _c.kt - -fun test(a_b: a.b) { - a_b.a_b() - - val ab_c: a.b.c = a.b.c() - ab_c.ab_c() - ab_c.a_bc() - - val ab_c2 = a.b.c() - ab_c2.ab_c() - ab_c2.a_bc() -} - -fun test2(ab_c: a.b.c) { - ab_c.ab_c() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.kt index 53c311808ae..93d11e5f475 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt package a.b diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.fir.kt deleted file mode 100644 index 6cccc7a53f2..00000000000 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.fir.kt +++ /dev/null @@ -1,33 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// MODULE: m1 -// FILE: a.kt -package a - -class a { - companion object {} -} - -class b { - fun a_b() {} -} - -// MODULE: m2(m1) -// FILE: b.kt -package test - -class a - -val x = a.b() - -// MODULE: m3(m1) -// FILE: c.kt -package test - -import a.a - -fun foo(i: a) { - a - a() - a.a - a.a() -} diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.kt index 6cccc7a53f2..1f1c02848b4 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsClass2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // MODULE: m1 // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.fir.kt deleted file mode 100644 index e81b8ef51d5..00000000000 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.fir.kt +++ /dev/null @@ -1,44 +0,0 @@ -// MODULE: m1 -// FILE: a.kt -package a - -class b { - fun a_b() {} -} - -// MODULE: m2 -// FILE: b.kt -class a { - class b { - fun _ab() {} - } -} - -// MODULE: m3(m1, m2) -// FILE: c1.kt -package some - -fun test(a_b: a.b) { - a_b.a_b() - - val a_b2 = a.b() - a_b2.a_b() -} - -// FILE: c2.kt -package a - -fun test(a_b: a.b) { - a_b.a_b() - - val a_b2 = a.b() - a_b2.a_b() -} - -// FILE: c3.kt -fun test(_ab: a.b) { - _ab._ab() - - val _ab2 = a.b() - _ab2._ab() // todo -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.kt index e81b8ef51d5..2db2f02f040 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/PackageVsRootClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // MODULE: m1 // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/reassignment/noifelse.fir.kt b/compiler/testData/diagnostics/tests/reassignment/noifelse.fir.kt deleted file mode 100644 index b096df5bcdb..00000000000 --- a/compiler/testData/diagnostics/tests/reassignment/noifelse.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun foo(f: Boolean): Int { - val i: Int - if (f) {} - i = 3 - return i -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/reassignment/noifelse.kt b/compiler/testData/diagnostics/tests/reassignment/noifelse.kt index b096df5bcdb..7c403d676c1 100644 --- a/compiler/testData/diagnostics/tests/reassignment/noifelse.kt +++ b/compiler/testData/diagnostics/tests/reassignment/noifelse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(f: Boolean): Int { val i: Int if (f) {} diff --git a/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.fir.kt b/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.fir.kt deleted file mode 100644 index 4152b60aa97..00000000000 --- a/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main(args: Array) { - args is Array<> -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.kt b/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.kt index 4152b60aa97..5d178be8153 100644 --- a/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.kt +++ b/compiler/testData/diagnostics/tests/recovery/emptyTypeArgs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun main(args: Array) { args is Array<> } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.fir.kt deleted file mode 100644 index 4ccc2f901a6..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -package kt2247 - -class B { - companion object { - class Y { - } - } - - class Y { - } - -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.kt b/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.kt index 4ccc2f901a6..52eab0c7bf9 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/NoRedeclarationForClassesInDefaultObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package kt2247 class B { diff --git a/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.fir.kt deleted file mode 100644 index 651d4ac0235..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class A() { - val a: Int = 1 - fun a(): Int = 2 -} - -class B() { - fun b(): Int = 2 - val b: Int = 1 -} diff --git a/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.kt b/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.kt index 651d4ac0235..6ec22e73dfc 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/PropertyAndFunInClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A() { val a: Int = 1 fun a(): Int = 2 diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.fir.kt deleted file mode 100644 index b98f96fdc4e..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// FILE: a.kt -fun main() {} - -// FILE: b.kt -fun main() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.kt index b98f96fdc4e..d67c12379de 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationMainInMultiFile.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt fun main() {} diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.fir.kt deleted file mode 100644 index 41583bce9c6..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// FILE: a.kt -fun main() {} - -// FILE: b.kt -fun main() {} diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.kt index 41583bce9c6..005ecfab53b 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationParameterlessMain.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt fun main() {} diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.fir.kt deleted file mode 100644 index edb92ec06bf..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// FILE: a.kt -suspend fun main() {} - -// FILE: b.kt -suspend fun main() {} diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.kt index edb92ec06bf..aecdad4a587 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclarationSuspendMainInMultiFile.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt suspend fun main() {} diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.fir.kt deleted file mode 100644 index 8298c498e70..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -class C { - fun Int.foo() {} -} - -fun C.foo() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.kt index 8298c498e70..30df528ea59 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionFunVsMemberExtensionFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { fun Int.foo() {} } diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.fir.kt deleted file mode 100644 index 796aee5f4e0..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -interface Test { - fun foo() - val bar: Int -} - -fun Test?.foo() {} -val Test?.bar: Int get() = 42 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.kt index 796aee5f4e0..678418cef31 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnNullableReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Test { fun foo() val bar: Int diff --git a/compiler/testData/diagnostics/tests/regressions/Jet121.fir.kt b/compiler/testData/diagnostics/tests/regressions/Jet121.fir.kt deleted file mode 100644 index b062181aaa9..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/Jet121.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -package jet121 - -fun box() : String { -val answer = apply("OK") { - get(0) - length -} - -return if (answer == 2) "OK" else "FAIL" -} - -fun apply(arg:String, f : String.() -> Int) : Int { - return arg.f() -} diff --git a/compiler/testData/diagnostics/tests/regressions/Jet121.kt b/compiler/testData/diagnostics/tests/regressions/Jet121.kt index b062181aaa9..51c37077d21 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet121.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet121.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package jet121 fun box() : String { diff --git a/compiler/testData/diagnostics/tests/regressions/Jet17.fir.kt b/compiler/testData/diagnostics/tests/regressions/Jet17.fir.kt deleted file mode 100644 index d9fb94fa6c1..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/Jet17.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// JET-17 Do not infer property types by the initializer before the containing scope is ready - -class WithC() { - val a = 1 - val b = a -} diff --git a/compiler/testData/diagnostics/tests/regressions/Jet17.kt b/compiler/testData/diagnostics/tests/regressions/Jet17.kt index d9fb94fa6c1..95c01d22fd0 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet17.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet17.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JET-17 Do not infer property types by the initializer before the containing scope is ready class WithC() { diff --git a/compiler/testData/diagnostics/tests/regressions/Jet183-1.fir.kt b/compiler/testData/diagnostics/tests/regressions/Jet183-1.fir.kt deleted file mode 100644 index 8103acc9fd3..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/Jet183-1.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -enum class ProtocolState { - WAITING { - override fun signal() = ProtocolState.TALKING - }, - - TALKING { - override fun signal() = ProtocolState.WAITING - }; - - abstract fun signal() : ProtocolState -} - - -fun box(): String { - var x: ProtocolState = ProtocolState.WAITING - x = x.signal() - if (x != ProtocolState.TALKING) return "fail 1" - x = x.signal() - if (x != ProtocolState.WAITING) return "fail 2" - return "OK" -} diff --git a/compiler/testData/diagnostics/tests/regressions/Jet183-1.kt b/compiler/testData/diagnostics/tests/regressions/Jet183-1.kt index 8103acc9fd3..e962b16343d 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet183-1.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet183-1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class ProtocolState { WAITING { override fun signal() = ProtocolState.TALKING diff --git a/compiler/testData/diagnostics/tests/regressions/Jet53.fir.kt b/compiler/testData/diagnostics/tests/regressions/Jet53.fir.kt deleted file mode 100644 index 0703aa50dd6..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/Jet53.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !CHECK_TYPE - -import java.util.Collections - -val ab = checkSubtype?>(Collections.emptyList()) diff --git a/compiler/testData/diagnostics/tests/regressions/Jet53.kt b/compiler/testData/diagnostics/tests/regressions/Jet53.kt index 0703aa50dd6..3ed62f6056f 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet53.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet53.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE import java.util.Collections diff --git a/compiler/testData/diagnostics/tests/regressions/Jet67.fir.kt b/compiler/testData/diagnostics/tests/regressions/Jet67.fir.kt deleted file mode 100644 index 94549ab8df9..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/Jet67.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -abstract class XXX { - abstract val a : Int get - -} diff --git a/compiler/testData/diagnostics/tests/regressions/Jet67.kt b/compiler/testData/diagnostics/tests/regressions/Jet67.kt index 94549ab8df9..28dfd3d5593 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet67.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet67.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL abstract class XXX { abstract val a : Int get diff --git a/compiler/testData/diagnostics/tests/regressions/Jet68.fir.kt b/compiler/testData/diagnostics/tests/regressions/Jet68.fir.kt deleted file mode 100644 index 40348b96052..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/Jet68.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class Foo() - -fun test() { - val f : Foo? = null - if (f == null) { - - } - if (f != null) { - - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/Jet68.kt b/compiler/testData/diagnostics/tests/regressions/Jet68.kt index 40348b96052..f09e127d94f 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet68.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet68.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo() fun test() { diff --git a/compiler/testData/diagnostics/tests/regressions/OverrideResolution.fir.kt b/compiler/testData/diagnostics/tests/regressions/OverrideResolution.fir.kt deleted file mode 100644 index 26a262dc8c1..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/OverrideResolution.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -fun box(c : C) { - val a : C = c - a.foo() -} - -open class A { - open fun foo() {} -} - -open class B : A() { - override fun foo() {} -} - -open class C : B() { - override fun foo() {} -} diff --git a/compiler/testData/diagnostics/tests/regressions/OverrideResolution.kt b/compiler/testData/diagnostics/tests/regressions/OverrideResolution.kt index 26a262dc8c1..eb339e56d68 100644 --- a/compiler/testData/diagnostics/tests/regressions/OverrideResolution.kt +++ b/compiler/testData/diagnostics/tests/regressions/OverrideResolution.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun box(c : C) { val a : C = c a.foo() diff --git a/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.fir.kt b/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.fir.kt deleted file mode 100644 index efc97fc4e05..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -import kotlin.reflect.KProperty - -class MyMetadata(val default: R) { - operator fun getValue(thisRef: T, desc: KProperty<*>): R = TODO() - operator fun setValue(thisRef: T, desc: KProperty<*>, value: R) {} -} - -interface Something -class MyReceiver -var MyReceiver.something: Something? by MyMetadata(default = null) diff --git a/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.kt b/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.kt index efc97fc4e05..f2c3a75708d 100644 --- a/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.kt +++ b/compiler/testData/diagnostics/tests/regressions/delegationWithReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.KProperty class MyMetadata(val default: R) { diff --git a/compiler/testData/diagnostics/tests/regressions/ea40964.fir.kt b/compiler/testData/diagnostics/tests/regressions/ea40964.fir.kt deleted file mode 100644 index 0410edc71ad..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/ea40964.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -package checkFiles - -import java.util.HashMap - -fun main() { - val hashMap = HashMap() - hashMap[] -} diff --git a/compiler/testData/diagnostics/tests/regressions/ea40964.kt b/compiler/testData/diagnostics/tests/regressions/ea40964.kt index 0410edc71ad..bb12a51256b 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea40964.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea40964.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package checkFiles import java.util.HashMap diff --git a/compiler/testData/diagnostics/tests/regressions/ea43298.fir.kt b/compiler/testData/diagnostics/tests/regressions/ea43298.fir.kt deleted file mode 100644 index 7a68643cae8..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/ea43298.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -import A.; - -class A diff --git a/compiler/testData/diagnostics/tests/regressions/ea43298.kt b/compiler/testData/diagnostics/tests/regressions/ea43298.kt index 7a68643cae8..a4989b26eb5 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea43298.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea43298.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import A.; class A diff --git a/compiler/testData/diagnostics/tests/regressions/ea53340.fir.kt b/compiler/testData/diagnostics/tests/regressions/ea53340.fir.kt deleted file mode 100644 index 7205d13137b..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/ea53340.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class A : Function0 { - override fun invoke(): Int = 1 -} - -fun main() { - A()() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/ea53340.kt b/compiler/testData/diagnostics/tests/regressions/ea53340.kt index 7205d13137b..397315e1d0f 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea53340.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea53340.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A : Function0 { override fun invoke(): Int = 1 } diff --git a/compiler/testData/diagnostics/tests/regressions/ea69735.fir.kt b/compiler/testData/diagnostics/tests/regressions/ea69735.fir.kt deleted file mode 100644 index c7fd82de1cd..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/ea69735.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -enum class MyEnum { - // Here we have a problem - // while checking on a deprecated super constructor - FIRST: -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/ea69735.kt b/compiler/testData/diagnostics/tests/regressions/ea69735.kt index c7fd82de1cd..2aa68bda0db 100644 --- a/compiler/testData/diagnostics/tests/regressions/ea69735.kt +++ b/compiler/testData/diagnostics/tests/regressions/ea69735.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class MyEnum { // Here we have a problem // while checking on a deprecated super constructor diff --git a/compiler/testData/diagnostics/tests/regressions/intchar.fir.kt b/compiler/testData/diagnostics/tests/regressions/intchar.fir.kt deleted file mode 100644 index edfb8c134cb..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/intchar.fir.kt +++ /dev/null @@ -1 +0,0 @@ -val x: Char = '1'.plus(1) diff --git a/compiler/testData/diagnostics/tests/regressions/intchar.kt b/compiler/testData/diagnostics/tests/regressions/intchar.kt index edfb8c134cb..7b7dbfa8d18 100644 --- a/compiler/testData/diagnostics/tests/regressions/intchar.kt +++ b/compiler/testData/diagnostics/tests/regressions/intchar.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL val x: Char = '1'.plus(1) diff --git a/compiler/testData/diagnostics/tests/regressions/kt13954.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt13954.fir.kt deleted file mode 100644 index d5a0c803542..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt13954.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// FILE: foo/A.kt - -package foo - -class A(val c: C) - -// FILE: foo/B.kt - -package foo - -class B { - interface D { - fun foo(): E - } - - class E -} - -// FILE: foo/C.java - -package foo; - -import static foo.B.D.*; - -@SuppressWarnings("RedundantTypeArguments") -public class C {} diff --git a/compiler/testData/diagnostics/tests/regressions/kt13954.kt b/compiler/testData/diagnostics/tests/regressions/kt13954.kt index d5a0c803542..ba1861c09be 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt13954.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt13954.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: foo/A.kt package foo diff --git a/compiler/testData/diagnostics/tests/regressions/kt14740.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt14740.fir.kt deleted file mode 100644 index 411e8dcbe5a..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt14740.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: Foo.java -public abstract class Foo { - - public interface Transformer {} - public interface LifecycleTransformer extends Transformer {} - - public class Observable { - public Observable compose(Transformer transformer) { - return null; - } - } - - - public final LifecycleTransformer bindToLifecycle() { - return null; - } -} - -// FILE: 1.kt -fun Foo.Observable.bindTo(a: Foo): Foo.Observable = compose(a.bindToLifecycle()) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt14740.kt b/compiler/testData/diagnostics/tests/regressions/kt14740.kt index 411e8dcbe5a..4e66de2280c 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt14740.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt14740.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Foo.java public abstract class Foo { diff --git a/compiler/testData/diagnostics/tests/regressions/kt1550.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt1550.fir.kt deleted file mode 100644 index f9bf9dcf7b4..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt1550.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -package foo - -import java.util.* - -fun main() -{ - val c = ArrayList() - c.add(3) - System.out.println(++(c[0])) - System.out.println((c[1])--) - System.out.println(-(c[2])) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt1550.kt b/compiler/testData/diagnostics/tests/regressions/kt1550.kt index f9bf9dcf7b4..7466519b439 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt1550.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt1550.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package foo import java.util.* diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt16086.fir.kt deleted file mode 100644 index 54173a9811c..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt16086.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// JAVAC_EXPECTED_FILE -// FILE: com/winterbe/domain/IEntity.java -package com.winterbe.domain; -import com.winterbe.observer.ObserverSupport; - -public interface IEntity { - ObserverSupport getObserverSupport(); -} - -// FILE: 1.kt -package com.winterbe.observer -import com.winterbe.domain.IEntity - -abstract class Observer : List - - -// FILE: 2.kt -package com.winterbe.observer -import com.winterbe.domain.IEntity - -class ObserverSupport(private val observers: List) diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086.kt b/compiler/testData/diagnostics/tests/regressions/kt16086.kt index 54173a9811c..05291cc2211 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt16086.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt16086.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // FILE: com/winterbe/domain/IEntity.java package com.winterbe.domain; diff --git a/compiler/testData/diagnostics/tests/regressions/kt1647.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt1647.fir.kt deleted file mode 100644 index dc0b3e26c38..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt1647.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// KT-1647 Pattern matching doesn't work with generics - -open class Abs -class Bar : Abs() - -fun patternMatchingAndGenerics(arg : F) : String { - if(arg is Bar){ - return "Bar"; - } - return "else"; -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt1647.kt b/compiler/testData/diagnostics/tests/regressions/kt1647.kt index dc0b3e26c38..5e2a167a415 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt1647.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt1647.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-1647 Pattern matching doesn't work with generics open class Abs diff --git a/compiler/testData/diagnostics/tests/regressions/kt2376.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt2376.fir.kt deleted file mode 100644 index 61acbc6a036..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt2376.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FILE: main.kt -//KT-2376 java.lang.Number should be visible in Kotlin as kotlin.Number -fun main() { - Test().number(5.toInt()) -} - -// FILE: Test.java -public class Test { - void number(Number n){} -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt2376.kt b/compiler/testData/diagnostics/tests/regressions/kt2376.kt index 61acbc6a036..183dc48f440 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt2376.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt2376.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: main.kt //KT-2376 java.lang.Number should be visible in Kotlin as kotlin.Number fun main() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt26-1.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt26-1.fir.kt deleted file mode 100644 index 3403459f44f..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt26-1.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: this.kt - -// KT-26 Import namespaces defined in this file -package foo - -import bar.* // Must not be an error - -// FILE: other.kt -package bar diff --git a/compiler/testData/diagnostics/tests/regressions/kt26-1.kt b/compiler/testData/diagnostics/tests/regressions/kt26-1.kt index 3403459f44f..aaa7d3b8113 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt26-1.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt26-1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: this.kt // KT-26 Import namespaces defined in this file diff --git a/compiler/testData/diagnostics/tests/regressions/kt26.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt26.fir.kt deleted file mode 100644 index c1557c3de55..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt26.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: a.kt -// KT-26 Import namespaces defined in this file - -import html.* // Must not be an error - -// FILE: b.kt - -package html - -abstract class Factory { -fun create() : T? = null -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt26.kt b/compiler/testData/diagnostics/tests/regressions/kt26.kt index c1557c3de55..6b6cb80e929 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt26.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt26.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt // KT-26 Import namespaces defined in this file diff --git a/compiler/testData/diagnostics/tests/regressions/kt28001.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt28001.fir.kt deleted file mode 100644 index 0f51ff2f666..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt28001.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - -private object Case1 { - interface Validator - - class CharSequenceValidator: Validator - - class PredicateValidator(val predicate: (T) -> Boolean): Validator - - class CompositeValidator(vararg val validators: Validator) - - fun process(input: String) = true - - fun main() { - val validators1 = CompositeValidator(CharSequenceValidator(), PredicateValidator(::process)) - val validators2 = CompositeValidator(CharSequenceValidator(), PredicateValidator(::process)) - val validators3 = CompositeValidator(CharSequenceValidator(), PredicateValidator { it: String -> process(it) }) - } -} - -private object Case2 { - interface Expr - data class Add(val left: Expr, val right: Expr): Expr - data class Subtract(val left: Expr, val right: Expr): Expr - - fun f() { - val operators1 = listOf(::Add, ::Subtract) - val operators2 = listOf<(Expr, Expr) -> Expr>(::Add, ::Subtract) - } - - fun listOf(vararg elements: T): List = TODO() -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt28001.kt b/compiler/testData/diagnostics/tests/regressions/kt28001.kt index 0f51ff2f666..3e6bcbc72ab 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt28001.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt28001.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER private object Case1 { diff --git a/compiler/testData/diagnostics/tests/regressions/kt316.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt316.fir.kt deleted file mode 100644 index 4816e9763f5..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt316.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// KT-316 Members of traits must be open by default - -interface B { - fun bar() {} - fun foo() {} -} - -open class A() : B{ - override fun foo() {} -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt316.kt b/compiler/testData/diagnostics/tests/regressions/kt316.kt index 4816e9763f5..59b0865d287 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt316.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt316.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-316 Members of traits must be open by default interface B { diff --git a/compiler/testData/diagnostics/tests/regressions/kt32836.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt32836.fir.kt deleted file mode 100644 index adbdda52fea..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt32836.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -inline fun parse(json: String): T? = TODO() - -class MyType - -fun parseMyData(json: String): MyType = - try { - parse(json) // error with new inf only: Cannot use 'Nothing?' as reified type parameter - ?: throw IllegalArgumentException("Can't parse") - } catch (e: Exception) { - throw IllegalArgumentException("Can't parse") - } - -fun main() { - parseMyData("") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt32836.kt b/compiler/testData/diagnostics/tests/regressions/kt32836.kt index adbdda52fea..5129301e7bb 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt32836.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt32836.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER inline fun parse(json: String): T? = TODO() diff --git a/compiler/testData/diagnostics/tests/regressions/kt337.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt337.fir.kt deleted file mode 100644 index 7cac265e866..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt337.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -//KT-337 Can't break a line before a dot - -class A() { - fun foo() {} -} - -fun test() { - val a = A() - - a - - .foo() // Should be a valid expression - -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt337.kt b/compiler/testData/diagnostics/tests/regressions/kt337.kt index 7cac265e866..4fb0d2f8a49 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt337.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt337.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-337 Can't break a line before a dot class A() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt3535.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt3535.fir.kt deleted file mode 100644 index 4b027cb07d4..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt3535.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// KT-3535 Functional value-parametr in nested class is inaccessible - -class Foo { - class Bar(val p: (Any) -> Any) { - fun f() { - p(1) - } - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt3535.kt b/compiler/testData/diagnostics/tests/regressions/kt3535.kt index 4b027cb07d4..a4a3ce5673d 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt3535.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt3535.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-3535 Functional value-parametr in nested class is inaccessible class Foo { diff --git a/compiler/testData/diagnostics/tests/regressions/kt3647.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt3647.fir.kt deleted file mode 100644 index 75416a55034..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt3647.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// KT-3647 Unexpected compilation error: "Expression is inaccessible from a nested class" - -class Test(val value: Int) { - companion object { - fun create(init: () -> Int): Test { - return Test(init()) - } - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt3647.kt b/compiler/testData/diagnostics/tests/regressions/kt3647.kt index 75416a55034..35eb43a08b2 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt3647.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt3647.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-3647 Unexpected compilation error: "Expression is inaccessible from a nested class" class Test(val value: Int) { diff --git a/compiler/testData/diagnostics/tests/regressions/kt3731.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt3731.fir.kt deleted file mode 100644 index de1728d6c84..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt3731.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// KT-3731 Resolve & inner class - -class A { - fun foo() {} - fun bar(f: A.() -> Unit = {}) = f() -} - -class B { - class D { - init { - A().bar { - this.foo() - foo() - } - } - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt3731.kt b/compiler/testData/diagnostics/tests/regressions/kt3731.kt index de1728d6c84..c2f4cd15ceb 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt3731.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt3731.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-3731 Resolve & inner class class A { diff --git a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.fir.kt deleted file mode 100644 index 625e715e707..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.fir.kt +++ /dev/null @@ -1,33 +0,0 @@ -// KT-385 type inference does not work properly` -// KT-109 Good code is red: type arguments are not inferred -// KT-441 Exception in type inference when multiple overloads accepting an integer literal are accessible - -import java.util.* - -infix fun Iterator.foreach(operation: (element: T) -> Unit) : Unit { while(hasNext()) operation(next()) } - -infix fun Iterator.foreach(operation: (index: Int, element: T) -> Unit) : Unit { - var k = 0 - while(hasNext()) - operation(k++, next()) -} - -fun Iterable.foreach(operation: (element: T) -> Unit) : Unit = iterator() foreach operation - -fun Iterable.foreach(operation: (index: Int, element: T) -> Unit) : Unit = iterator() foreach operation - -fun box() : String { - return generic_invoker( { "OK"} ) -} - -fun generic_invoker(gen : () -> T) : T { - return gen() -} - -fun println(message : Int) { System.out.println(message) } -fun println(message : Long) { System.out.println(message) } - -fun main() { - - println(run { 1 }) -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt index 625e715e707..fbfc79d43bf 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt385.109.441.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-385 type inference does not work properly` // KT-109 Good code is red: type arguments are not inferred // KT-441 Exception in type inference when multiple overloads accepting an integer literal are accessible diff --git a/compiler/testData/diagnostics/tests/regressions/kt394.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt394.fir.kt deleted file mode 100644 index 53a666fc641..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt394.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// KT-394 Make companion object members visible inside the owning class - -class X() { -// class Y {} - - companion object{ - class Y() {} - } - - val y : Y = Y() -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt394.kt b/compiler/testData/diagnostics/tests/regressions/kt394.kt index 53a666fc641..0bd73aa81f8 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt394.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt394.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-394 Make companion object members visible inside the owning class class X() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt469.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt469.fir.kt deleted file mode 100644 index 716cda78433..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt469.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ - -package kt469 - -//KT-512 plusAssign() : Unit does not work properly -import java.util.* - -fun bar(list : MutableList) { - for (i in 1..10) { - list += i // error - } - System.out.println(list) -} - -operator fun MutableList.plusAssign(t : T) { - add(t) -} - -//KT-469 Allow val-reassignment when appropriate functions are defined -fun foo() { - val m = MyNumber(2) - m -= MyNumber(3) //should not be error here -} - -class MyNumber(var i: Int) { - operator fun minusAssign(m : MyNumber) { - i -= m.i - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt469.kt b/compiler/testData/diagnostics/tests/regressions/kt469.kt index 716cda78433..b0135979b24 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt469.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt469.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package kt469 diff --git a/compiler/testData/diagnostics/tests/regressions/kt4693.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt4693.fir.kt deleted file mode 100644 index a0b38e239f2..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt4693.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -enum class MyEnum { - K; - - inline fun doSmth(f: (MyEnum) -> String) : String { - // This function should be inline - return f(K) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt4693.kt b/compiler/testData/diagnostics/tests/regressions/kt4693.kt index a0b38e239f2..13fcf507515 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt4693.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt4693.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class MyEnum { K; diff --git a/compiler/testData/diagnostics/tests/regressions/kt549.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt549.fir.kt deleted file mode 100644 index 872ae3bc2a4..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt549.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -//KT-549 type inference failed - -package demo - - fun filter(list : Array, filter : (T) -> Boolean) : List { - val answer = java.util.ArrayList(); - for (l in list) { - if (filter(l)) answer.add(l) - } - return answer; - } - -fun main(args : Array) { - for (a in filter(args, {it.length > 1})) { - System.out.println("Hello, ${a}!") - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt549.kt b/compiler/testData/diagnostics/tests/regressions/kt549.kt index 872ae3bc2a4..4303c98f035 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt549.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt549.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-549 type inference failed package demo diff --git a/compiler/testData/diagnostics/tests/regressions/kt571.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt571.fir.kt deleted file mode 100644 index 9a6cfce30a6..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt571.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -//KT-571 Type inference failed -fun let(t : T, body : (T) -> R) = body(t) -private fun double(d : Int) : Int = let(d * 2) {it / 10 + it * 2 % 10} diff --git a/compiler/testData/diagnostics/tests/regressions/kt571.kt b/compiler/testData/diagnostics/tests/regressions/kt571.kt index 9a6cfce30a6..3fee61938d2 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt571.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt571.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-571 Type inference failed fun let(t : T, body : (T) -> R) = body(t) private fun double(d : Int) : Int = let(d * 2) {it / 10 + it * 2 % 10} diff --git a/compiler/testData/diagnostics/tests/regressions/kt575.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt575.fir.kt deleted file mode 100644 index 45c9def4f26..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt575.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// KT-575 Cannot ++ a companion object member - -package kt575 - -class Creature() { - companion object { - var numCreated : Int = 0 - private set - } - - object A { - var bbb : Int - - init { - bbb = 1 - } - } - - class C() { - var ccc : Int - - init { - ccc = 2 - } - } - - init { - Creature.numCreated++ // Error - A.bbb++ - C().ccc++ - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt575.kt b/compiler/testData/diagnostics/tests/regressions/kt575.kt index 45c9def4f26..682758bf43e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt575.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt575.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-575 Cannot ++ a companion object member package kt575 diff --git a/compiler/testData/diagnostics/tests/regressions/kt580.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt580.fir.kt deleted file mode 100644 index c85036ad700..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt580.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -//KT-580 Type inference failed - -package whats.the.difference - -import java.util.* - -fun iarray(vararg a : String) = a // BUG - -fun main() { - val vals = iarray("789", "678", "567") - val diffs = ArrayList() - for (i in vals.indices) { - for (j in i..vals.lastIndex()) // Type inference failed - diffs.add(vals[i].length - vals[j].length) - for (j in i..vals.lastIndex) // Type inference failed - diffs.add(vals[i].length - vals[j].length) - } -} - -fun Array.lastIndex() = size - 1 -val Array.lastIndex : Int get() = size - 1 -val Array.indices : IntRange get() = IntRange(0, lastIndex) diff --git a/compiler/testData/diagnostics/tests/regressions/kt580.kt b/compiler/testData/diagnostics/tests/regressions/kt580.kt index c85036ad700..f90b935d515 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt580.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt580.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-580 Type inference failed package whats.the.difference diff --git a/compiler/testData/diagnostics/tests/regressions/kt588.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt588.fir.kt deleted file mode 100644 index 4f6637a9eb5..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt588.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// JAVAC_EXPECTED_FILE -// KT-588 Unresolved static method - -class Test() : Thread("Test") { - companion object { - fun init2() { - - } - } - override fun run() { - init2() // unresolved - Test.init2() // ok - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt588.kt b/compiler/testData/diagnostics/tests/regressions/kt588.kt index 4f6637a9eb5..8b6f16f02d6 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt588.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt588.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE // KT-588 Unresolved static method diff --git a/compiler/testData/diagnostics/tests/regressions/kt604.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt604.fir.kt deleted file mode 100644 index 3d2d8f8f2cd..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt604.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// KT-604 Internal frontend error - -interface ChannelPipeline { - -} - -class DefaultChannelPipeline() : ChannelPipeline { -} - -interface ChannelPipelineFactory{ - fun getPipeline() : ChannelPipeline -} - -class StandardPipelineFactory(val config: ChannelPipeline.()->Unit) : ChannelPipelineFactory { - override fun getPipeline() : ChannelPipeline { - val pipeline = DefaultChannelPipeline() - pipeline.config () - return pipeline - } -} diff --git a/compiler/testData/diagnostics/tests/regressions/kt604.kt b/compiler/testData/diagnostics/tests/regressions/kt604.kt index 3d2d8f8f2cd..4a4e959b38d 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt604.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt604.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-604 Internal frontend error interface ChannelPipeline { diff --git a/compiler/testData/diagnostics/tests/regressions/kt630.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt630.fir.kt deleted file mode 100644 index 2cef7f519a8..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt630.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// KT-630 Bad type inference - -fun T?.sure() : T = this!! - -val x = "lala".sure() -val s : String = x diff --git a/compiler/testData/diagnostics/tests/regressions/kt630.kt b/compiler/testData/diagnostics/tests/regressions/kt630.kt index 2cef7f519a8..7d9e0a931e1 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt630.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt630.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-630 Bad type inference fun T?.sure() : T = this!! diff --git a/compiler/testData/diagnostics/tests/regressions/kt691.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt691.fir.kt deleted file mode 100644 index ae9df808ea1..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt691.fir.kt +++ /dev/null @@ -1,2 +0,0 @@ -// KT-691 Allow to create nested namespaces with dot delimiter -package foo.bar.buz diff --git a/compiler/testData/diagnostics/tests/regressions/kt691.kt b/compiler/testData/diagnostics/tests/regressions/kt691.kt index ae9df808ea1..29bf3440db7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt691.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt691.kt @@ -1,2 +1,3 @@ +// FIR_IDENTICAL // KT-691 Allow to create nested namespaces with dot delimiter package foo.bar.buz diff --git a/compiler/testData/diagnostics/tests/regressions/kt743.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt743.fir.kt deleted file mode 100644 index aec66570b8a..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt743.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -//KT-743 Wrong type inference -class List(val head: T, val tail: List? = null) - -fun T?.sure() : T = this!! - -fun List.map(f: (T)-> Q): List? = tail.sure>().map(f) -fun foo(t : T) : T = foo(t) diff --git a/compiler/testData/diagnostics/tests/regressions/kt743.kt b/compiler/testData/diagnostics/tests/regressions/kt743.kt index aec66570b8a..b019cdc3722 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt743.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt743.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-743 Wrong type inference class List(val head: T, val tail: List? = null) diff --git a/compiler/testData/diagnostics/tests/regressions/kt750.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt750.fir.kt deleted file mode 100644 index 8fc9cf40d2f..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt750.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -//KT-750 Type inference failed: Constraint violation -fun main() { - var i : Int? = Integer.valueOf(100) - var s : Int? = Integer.valueOf(100) - - val o = i.sure() + s.sure() - System.out.println(o) -} - -fun T?.sure() : T = this!! diff --git a/compiler/testData/diagnostics/tests/regressions/kt750.kt b/compiler/testData/diagnostics/tests/regressions/kt750.kt index 8fc9cf40d2f..a6bd970324f 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt750.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt750.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-750 Type inference failed: Constraint violation fun main() { var i : Int? = Integer.valueOf(100) diff --git a/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.fir.kt deleted file mode 100644 index 9c328541484..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -interface X { - fun foo(): Int = 42 -} - -interface Y - -class A: X, Y - -class B: X, Y - -class Out(val x: T) - -fun bar(a: Out, b: Out, f: Boolean): Int { - val x = if (f) a else b - return x.x.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.kt b/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.kt index 9c328541484..dec40a125dd 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt7585/twoparents.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface X { fun foo(): Int = 42 } diff --git a/compiler/testData/diagnostics/tests/regressions/kt847.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt847.fir.kt deleted file mode 100644 index 0f9ecd9fca0..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt847.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -fun T.mustBe(t : T) { - "$this must be$as$t" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt847.kt b/compiler/testData/diagnostics/tests/regressions/kt847.kt index 0f9ecd9fca0..e703d1c2ced 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt847.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt847.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION fun T.mustBe(t : T) { "$this must be$as$t" diff --git a/compiler/testData/diagnostics/tests/regressions/kt860.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt860.fir.kt deleted file mode 100644 index bcd42bc7ca5..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt860.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !DIAGNOSTICS: -NOTHING_TO_INLINE -// KT-860 ConcurrentModificationException in frontend - -package std.util - -import java.util.* - -fun > Iterator.to(container: U) : U { - while(hasNext()) - container.add(next()) - return container -} - -fun Iterator.toArrayList() = to(ArrayList()) diff --git a/compiler/testData/diagnostics/tests/regressions/kt860.kt b/compiler/testData/diagnostics/tests/regressions/kt860.kt index bcd42bc7ca5..6b4ff8c44fc 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt860.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt860.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -NOTHING_TO_INLINE // KT-860 ConcurrentModificationException in frontend diff --git a/compiler/testData/diagnostics/tests/regressions/kt9808.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt9808.fir.kt deleted file mode 100644 index 1e8ce4f51a1..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/kt9808.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// KT-9808 Extension function on object for new resolve -object O - -val foo: O.() -> Unit = null!! - -fun test() { - O.foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt9808.kt b/compiler/testData/diagnostics/tests/regressions/kt9808.kt index 1e8ce4f51a1..a219bcc55da 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt9808.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt9808.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-9808 Extension function on object for new resolve object O diff --git a/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.fir.kt b/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.fir.kt deleted file mode 100644 index e3b2daf88eb..00000000000 --- a/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -object X - -class Y { - fun f(op: X.() -> Unit) { - X.op() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt b/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt index e3b2daf88eb..32dab858598 100644 --- a/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt +++ b/compiler/testData/diagnostics/tests/regressions/propertyWithExtensionTypeInvoke.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object X class Y { diff --git a/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.fir.kt b/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.fir.kt deleted file mode 100644 index f3eb01d0944..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -interface IFoo { - fun foo() -} - -interface IBar - -private fun createAnonObject() = - object : IFoo, IBar { - override fun foo() {} - fun qux() {} - } - -private val propOfAnonObject = object : IFoo, IBar { - override fun foo() {} - fun qux() {} - } - -fun useAnonObject() { - createAnonObject().foo() - createAnonObject().qux() - - propOfAnonObject.foo() - propOfAnonObject.qux() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt b/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt index f3eb01d0944..b3d67c607fb 100644 --- a/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt +++ b/compiler/testData/diagnostics/tests/resolve/anonymousObjectFromTopLevelMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IFoo { fun foo() } diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.fir.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.fir.kt deleted file mode 100644 index 7dd88e1b21c..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -@DslMarker -annotation class MyDsl - -@MyDsl -interface Foo { - val x: Int -} - -val Foo<*>.bad: Int get() = x - -fun Foo<*>.badFun(): Int = x - -val Foo.good: Int get() = x - -fun test(foo: Foo<*>) { - foo.apply { - x - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.kt index 7dd88e1b21c..c6f80f0e1fd 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/kt29948.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @DslMarker annotation class MyDsl diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.fir.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.fir.kt deleted file mode 100644 index 9b3b0501a2b..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -@DslMarker -annotation class MyDsl - -@MyDsl -interface Scope { - val something: A - val value: B -} -fun scoped1(block: Scope.() -> Unit) {} -fun scoped2(block: Scope<*, String>.() -> Unit) {} - -val Scope<*, T>.property: T get() = value - -fun f() { - scoped1 { - value - property - } - scoped2 { - value - property - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.kt index 9b3b0501a2b..b7ffcc214e1 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/kt31360.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER @DslMarker diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.fir.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.fir.kt deleted file mode 100644 index 8349ec26541..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -@DslMarker -annotation class AnnMarker - -@AnnMarker -class Inv { - fun bar() {} -} - -fun Inv<*>.foo() { - bar() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.kt index 8349ec26541..61477631a52 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/markedReceiverWithCapturedTypeArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @DslMarker annotation class AnnMarker diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.fir.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.fir.kt deleted file mode 100644 index e67767e06d7..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !LANGUAGE: -DslMarkersSupport -// !DIAGNOSTICS: -UNUSED_PARAMETER -@DslMarker -annotation class Ann - -@Ann -class A { - fun a() = 1 -} - -@Ann -class B { - fun b() = 2 -} - -fun foo(x: A.() -> Unit) {} -fun bar(x: B.() -> Unit) {} - -fun test() { - foo { - a() - bar { - a() - this@foo.a() - b() - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.kt index e67767e06d7..4c2242ead75 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/unsupportedFeature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -DslMarkersSupport // !DIAGNOSTICS: -UNUSED_PARAMETER @DslMarker diff --git a/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.fir.kt b/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.fir.kt deleted file mode 100644 index 902ce7e49e1..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.fir.kt +++ /dev/null @@ -1,33 +0,0 @@ -// FILE: a.kt -package a - -class A(val b: String) { - companion object { - val c: String = "" - } - - fun mtd() = c.length -} - -// FILE: b.kt -package b - -// FILE: c.kt -package c - -// FILE: test.kt -package test - -import a.A - -fun T.with(f: T.() -> R) = f() - -fun A.extFun1() = b.length - -// fun A.extFun2() = c.length // TODO fix KT-9953 - -val x1 = A("").with { b.length } - -// val x2 = A("").with { c.length } // TODO fix KT-9953 - -val x3 = A.with { c.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.kt b/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.kt index 902ce7e49e1..a002ff420d4 100644 --- a/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.kt +++ b/compiler/testData/diagnostics/tests/resolve/implicitReceiverProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.fir.kt b/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.fir.kt deleted file mode 100644 index c342c179705..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun foo(f: () -> Collection, p: (T) -> Boolean): Collection = throw Exception() - -fun emptyList(): List = throw Exception() - -fun test(): Collection = foo({ emptyList() }, { x -> x > 0 }) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.kt b/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.kt index c342c179705..e3515b95b5c 100644 --- a/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.kt +++ b/compiler/testData/diagnostics/tests/resolve/inferenceInLinkedLambdasDependentOnExpectedType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo(f: () -> Collection, p: (T) -> Boolean): Collection = throw Exception() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.fir.kt deleted file mode 100644 index fcd8e258ada..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.fir.kt +++ /dev/null @@ -1,33 +0,0 @@ -class B - -class A { - operator fun B.invoke() = 4 -} - -class X { - operator fun invoke() = 3 -} - -fun test(a: A, b: B) { - with (a) { - b() - (b)() - } - - X()() - val x = X() - x() - (x)() -} - -fun test(c: () -> String, e: Int.() -> String) { - c() - (c)() - - 3.e() - 3.(e)() - with(3) { - e() - (e)() - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt index fcd8e258ada..1da074cab25 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvoke.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class B class A { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.fir.kt deleted file mode 100644 index f4f9bacf244..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.fir.kt +++ /dev/null @@ -1,61 +0,0 @@ -class Foo {} - -operator fun Foo.invoke() {} - -//no variable -fun test(foo: Foo) { - foo() -} - -//variable as member -interface A { - val foo: Foo -} - - -fun test(a: A) { - a.foo() - - with (a) { - foo() - } -} - -//variable as extension -interface B { -} -val B.foo: Foo - get() = Foo() - -fun test(b: B) { - b.foo() - - with (b) { - foo() - } -} - -//variable as member extension -interface C - -interface D { - val C.foo: Foo - - fun test(c: C) { - c.foo() - - with (c) { - foo() - } - } -} - -fun test(d: D, c: C) { - with (d) { - c.foo() - - with (c) { - foo() - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt index f4f9bacf244..20ca697c658 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo {} operator fun Foo.invoke() {} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.fir.kt deleted file mode 100644 index fd841f6fe7e..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.fir.kt +++ /dev/null @@ -1,60 +0,0 @@ -class Foo { - operator fun invoke() {} -} - -//no variable -fun test(foo: Foo) { - foo() -} - -//variable as member -interface A { - val foo: Foo -} - -fun test(a: A) { - a.foo() - - with (a) { - foo() - } -} - -//variable as extension -interface B {} -val B.foo: Foo - get() = Foo() - - -fun test(b: B) { - b.foo() - - with (b) { - foo() - } -} - -//variable as member extension -interface C - -interface D { - val C.foo: Foo - - fun test(c: C) { - c.foo() - - with (c) { - foo() - } - } -} - -fun test(d: D, c: C) { - with (d) { - c.foo() - - with (c) { - foo() - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt index fd841f6fe7e..9291de97d79 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo { operator fun invoke() {} } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.fir.kt deleted file mode 100644 index 803ee1c22b7..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.fir.kt +++ /dev/null @@ -1,123 +0,0 @@ -class Foo - -//no variable -interface A { - operator fun Foo.invoke() {} - - fun test(foo: Foo) { - foo() - } -} - -//variable as member -interface B { - val foo: Foo -} - -class C { - operator fun Foo.invoke() {} - - fun test(b: B) { - b.foo() - - with (b) { - foo() - } - } -} - -fun test(c: C, b: B) { - with (c) { - b.foo() - - with (b) { - foo() - } - } -} - - -//variable as extension, -interface D { -} -val D.foo: Foo - get() = Foo() - -class E { - operator fun Foo.invoke() {} - - fun test(d: D) { - d.foo() - - with (d) { - foo() - } - } -} - -fun test(e: E, d: D) { - with (e) { - d.foo() - - with (d) { - foo() - } - } -} - -//variable as member extension -interface F - -interface G { - val F.foo: Foo - operator fun Foo.invoke() - - fun test(f: F) { - f.foo() - - with (f) { - foo() - } - } -} - -fun test(g: G, f: F) { - with (g) { - f.foo() - - with (f) { - foo() - } - } -} - -//variable as member extension (2) -interface X - -interface U { - val X.foo: Foo -} - -interface V { - operator fun Foo.invoke() {} - - fun U.test(x: X) { - x.foo() - - with (x) { - foo() - } - } -} - -fun test(u: U, v: V, x: X) { - with (v) { - with (u) { - x.foo() - - with (x) { - foo() - } - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt index 803ee1c22b7..9a12cb1df4b 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Foo //no variable diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.fir.kt deleted file mode 100644 index 901f589de5d..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER - -class C { - fun f() {} -} - -fun C.g(f: (String) -> Unit = { s -> f() }) {} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.kt index 901f589de5d..302c8740390 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeNonExtensionLambdaInContext.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER class C { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.fir.kt deleted file mode 100644 index fb4cdeecaa0..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -//KT-3833 Invoke method not working inside companion object? -package m - -class Either1 { - class Left() { - fun match(left: () -> Unit) { - left() - } - } - - inner class Right() { - fun match(right: () -> Unit) { - right() - } - } -} - - -class X { - operator fun invoke() { - } -} - -object Foo{ - val v : X = X() -} - -class C{ - companion object { - fun f(){ - Foo.v() - } - } -} - diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt index fb4cdeecaa0..46894da1af8 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-3833 Invoke method not working inside companion object? package m diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.fir.kt deleted file mode 100644 index 8080c3fec3b..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -//KT-4321 invoke() on enum doesn't work - -import DOMElementTestClasses.cls2 - -// use case 1 -enum class DOMElementTestClasses { - cls1, cls2; - - operator fun invoke() {} -} - - -// use case 2 -interface EnumStyleClass { - operator fun invoke() {} -} -enum class TestClasses : EnumStyleClass { - cls -} - -// example -fun main() { - // Kotlin: Expression 'cls1' of type 'DOMElementTestClasses' cannot be invoked as a function - DOMElementTestClasses.cls1() - - // Kotlin: Expression 'cls2' of type 'DOMElementTestClasses' cannot be invoked as a function - cls2() - - // Kotlin: Expression 'cls' of type 'TestClasses' cannot be invoked as a function - TestClasses.cls() - - // All ok - val cls = DOMElementTestClasses.cls2 - cls() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt index 8080c3fec3b..fef0afb219c 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-4321 invoke() on enum doesn't work import DOMElementTestClasses.cls2 diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.fir.kt deleted file mode 100644 index 6ac2e1c5cbc..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -interface A - -fun foo(invoke: A.()->Unit, a: A) { - a.invoke() -} - -fun bar(invoke: Any.()->Any, a: Any) { - a.invoke() -} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.kt index 6ac2e1c5cbc..d3664c4d026 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/valNamedInvoke.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A fun foo(invoke: A.()->Unit, a: A) { diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.fir.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.fir.kt deleted file mode 100644 index 23ccbae857e..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -class A { - companion object { - - } -} - -fun use(vararg a: Any?) = a - -fun test() { - use(use(A, null).toString()) -} - diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.kt index 23ccbae857e..4694805cf51 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/analyzeArgsInFreeExpressionPosition.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { companion object { diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.fir.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.fir.kt deleted file mode 100644 index 9e8cb9218b1..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -interface Inv - -fun Inv.reduce2(): S = null!! - -fun test(a: Inv): Int { - val b = 1 + a.reduce2() - return b -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.kt index 9e8cb9218b1..74a37b9e66b 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/kt7597.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Inv fun Inv.reduce2(): S = null!! diff --git a/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.fir.kt b/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.fir.kt deleted file mode 100644 index 6fa99a95691..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -interface Base { - val parent: Base -} - -class Derived : Base { - override val parent: Base - get() = TODO() -} - -fun test(d: Derived) { - when { - d.parent is Derived -> d.parent.parent - } -} - -fun Any?.take() {} -class Something { - var prop: String? = null - - fun String.take() {} - - fun test() { - if (prop is String) { - prop.take() - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.kt b/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.kt index 6fa99a95691..e78c16843b2 100644 --- a/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.kt +++ b/compiler/testData/diagnostics/tests/resolve/noStopOnReceiverUnstableSmartCast.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Base { val parent: Base } diff --git a/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.fir.kt b/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.fir.kt deleted file mode 100644 index 9cae82ca8a4..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -//If this test hangs, it means something is broken. -object A { - val iii = 42 -} - -//inappropriate but participating in resolve functions -fun foo(s: String, a: Any) = s + a - -fun foo(a: Any, s: String) = s + a -fun foo(i: Int, j: Int) = i + j -fun foo(a: Any, i: Int) = "$a$i" -fun foo(f: (Int) -> Int, i: Int) = f(i) -fun foo(f: (String) -> Int, s: String) = f(s) -fun foo(f: (Any) -> Int, a: Any) = f(a) -fun foo(s: String, f: (String) -> Int) = f(s) -fun foo(a: Any, f: (Any) -> Int) = f(a) -//appropriate function -fun foo(i: Int, f: (Int) -> Int) = f(i) - -fun test() { - foo(1, object : (Int) -> Int { - override fun invoke(x1: Int) = foo( - 2, object : (Int) -> Int { - override fun invoke(x2: Int) = foo( - 3, object : (Int) -> Int { - override fun invoke(x3: Int): Int = foo( - 4, object : (Int) -> Int { - override fun invoke(x4: Int): Int = foo( - 5, object : (Int) -> Int { - override fun invoke(x5: Int): Int = x1 + x2 + x3 + x4 + x5 + A.iii - }) - }) - }) - }) - }) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.kt b/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.kt index 9cae82ca8a4..dc82a32456d 100644 --- a/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.kt +++ b/compiler/testData/diagnostics/tests/resolve/objectLiteralAsArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //If this test hangs, it means something is broken. object A { val iii = 42 diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.fir.kt deleted file mode 100644 index ef9bf7b8da9..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object Right -object Wrong - -interface IA -interface IB : IA -fun IA.foo(vararg x: Int) = Wrong -fun IB.foo(vararg x: Int) = Right -class CC : IB - -val test7 = CC().foo(1, 2, 3) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.kt index ef9bf7b8da9..b815d988835 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/extensionReceiverAndVarargs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object Right diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.fir.kt deleted file mode 100644 index 62c58aaf588..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object Right -object Wrong - -interface A -interface B : A - -fun foo(vararg t: T) = Wrong -fun foo(t: A) = Wrong -fun foo(t: B) = Right - -fun test(b: B): Right = foo(b) diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.kt index 62c58aaf588..8a03781eb42 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt10472.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object Right diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.fir.kt deleted file mode 100644 index 794be2d88fd..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object Right -object Wrong - -fun overloadedFun(c: Any = "", b: String = "", f: Any = "") = Right -fun overloadedFun(b: Any = "", c: Any = "", e: String = "", x: String = "", y: String = "") = Wrong - -val test: Right = overloadedFun(b = "") - diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt index 794be2d88fd..5d5d0edd6e3 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/numberOfDefaults.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object Right diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.fir.kt deleted file mode 100644 index 67aa60f2c80..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object Foo1 -object Foo2 - -fun foo(vararg ss: String) = Foo1 -fun foo(x: Any) = Foo2 - -val test1: Foo1 = foo("") \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.kt index 67aa60f2c80..4b1f2437fd6 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargWithMoreSpecificSignature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object Foo1 diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.fir.kt deleted file mode 100644 index 3991c9e26d9..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -object Right -object Wrong - -fun overloadedFun6(s1: String) = Right -fun overloadedFun6(s1: String, s2: String) = Wrong -fun overloadedFun6(s1: String, s2: String, s3: String) = Wrong -fun overloadedFun6(s: String, vararg ss: String) = Wrong - -val test6: Right = overloadedFun6("") diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.kt index 3991c9e26d9..40f55d1a7ab 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER object Right diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.fir.kt deleted file mode 100644 index 8414bfee2b6..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// FILE: J.java -import java.util.*; - -public class J { - public static > String foo(E1 e) { return ""; } - public static > String foo(E2 e1, E2 e2) { return ""; } - public static > String foo(E3 s1, E3 s2, E3 s3) { return ""; } - public static > int foo(E4... ss) { return 0; } -} - -// FILE: test.kt -enum class X { A } -val a = X.A - -val test0: Int = J.foo() -val test1: String = J.foo(a) -val test2: String = J.foo(a, a) -val test3: String = J.foo(a, a, a) -val test4: Int = J.foo(a, a, a, a) -val test5: Int = J.foo(a, a, a, a, a) diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.kt index 8414bfee2b6..52e08065bd2 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsWithRecursiveGenerics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: J.java import java.util.*; diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.fir.kt deleted file mode 100644 index aede07e6269..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -class A - -class B { - fun foo() = this -} - -fun test(foo: A.() -> Int) { - with(A()) { - foo() checkType { _() } - with(B()) { - foo() checkType { _() } - this.foo() checkType { _() } - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt index aede07e6269..629fb6faa30 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.fir.kt deleted file mode 100644 index ac7e7458842..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -class A { - fun foo() = this -} - -fun test(foo: A.() -> Int) { - with(A()) { - foo() checkType { _() } - this.foo() checkType { _() } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt index ac7e7458842..47bcc9df209 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/invokeExtensionVsOther2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt9810.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt9810.fir.kt deleted file mode 100644 index db63cc5e5bb..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt9810.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -// KT-9810 Local variable vs property from implicit receiver - -class A { - val foo = 2 -} - -fun test(foo: String) { - with(A()) { - val g: String = foo // locals win - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/priority/kt9810.kt b/compiler/testData/diagnostics/tests/resolve/priority/kt9810.kt index db63cc5e5bb..12debaea07f 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/kt9810.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/kt9810.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // KT-9810 Local variable vs property from implicit receiver diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.fir.kt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.fir.kt deleted file mode 100644 index 83c50b4bd1a..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE - -// FILE: A.java -public class A { - public A getFoo() { return 3; } -} - -// FILE: B.java -public class B { - public B getFoo() { return ""; } -} - -// FILE: 1.kt -class C(val foo: C) - -fun test(a: A, b: B, c: C) { - with(a) { - with(b) { - foo checkType { _() } - } - foo checkType { _() } - } - - with(a) { - with(c) { - foo checkType { _() } - } - } - - with(c) { - with(a) { - foo checkType { _() } - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt index 83c50b4bd1a..94529598419 100644 --- a/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt +++ b/compiler/testData/diagnostics/tests/resolve/priority/syntheticPropertiesVsMembers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.fir.kt b/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.fir.kt deleted file mode 100644 index 02d00521086..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -@Target(AnnotationTarget.EXPRESSION) -@Retention(AnnotationRetention.SOURCE) -@Repeatable -annotation class Ann - -fun bar(block: (T) -> Int) {} - -fun foo() { - bar @Ann @[Ann] { x -> x } - bar @Ann @[Ann] label@{ x -> x } -} diff --git a/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt b/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt index 02d00521086..78fe21b91a4 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveAnnotatedLambdaArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER @Target(AnnotationTarget.EXPRESSION) @Retention(AnnotationRetention.SOURCE) diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.fir.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.fir.kt deleted file mode 100644 index 514962d5bc0..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -object A { - val iii = 42 -} - -//inappropriate but participating in resolve functions -//fun foo(s: String, a: Any) = s + a -//fun foo(a: Any, s: String) = s + a -//fun foo(i: Int, j: Int) = i + j -//fun foo(a: Any, i: Int) = "$a$i" -//fun foo(f: (Int)->Int, i: Int) = f(i) -//fun foo(f: (String)->Int, s: String) = f(s) -//fun foo(f: (Any)->Int, a: Any) = f(a) -//fun foo(s: String, f: (String)->Int) = f(s) -//fun foo(a: Any, f: (Any)->Int) = f(a) -//appropriate function -fun foo(i: Int, f: (Int)->Int) = f(i) - -fun test() { - foo(1) { x1: Int -> - foo(2) { x2: Int -> - foo(3) { x3: Int -> - foo(4) { x4: Int -> - foo(5) { x5: Int -> - x1 + x2 + x3 + x4 + x5 + A.iii - } - } - } - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt index 514962d5bc0..66ac44028e4 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiterals.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object A { val iii = 42 } diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.fir.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.fir.kt deleted file mode 100644 index 7b6e982c94d..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -//If this test hangs, it means something is broken. -object A { - val iii = 42 -} - -//inappropriate but participating in resolve functions -fun foo(s: String, a: Any) = s + a -fun foo(a: Any, s: String) = s + a -fun foo(i: Int, j: Int) = i + j -fun foo(a: Any, i: Int) = "$a$i" -fun foo(f: (Int)->Int, i: Int) = f(i) -fun foo(f: (String)->Int, s: String) = f(s) -fun foo(f: (Any)->Int, a: Any) = f(a) -fun foo(s: String, f: (String)->Int) = f(s) -fun foo(a: Any, f: (Any)->Int) = f(a) -//appropriate function -fun foo(i: Int, f: (Int)->Int) = f(i) - -fun test() { - foo(1) { x1: Int -> - foo(2) { x2: Int -> - foo(3) { x3: Int -> - foo(4) { x4: Int -> - foo(5) { x5: Int -> - x1 + x2 + x3 + x4 + x5 + A.iii - } - } - } - } - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt index 7b6e982c94d..b15ca8741eb 100644 --- a/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt +++ b/compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralsOverload.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //If this test hangs, it means something is broken. object A { val iii = 42 diff --git a/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.fir.kt b/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.fir.kt deleted file mode 100644 index e08e089c0ad..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun foo() { - fun bar(x: List = listOf()) {} -} - -fun listOf(): List = TODO() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.kt b/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.kt index e08e089c0ad..002b38fbea8 100644 --- a/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.kt +++ b/compiler/testData/diagnostics/tests/resolve/typeParameterInDefaultValueInLocalFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo() { diff --git a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.fir.kt b/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.fir.kt deleted file mode 100644 index 85ccf5612eb..00000000000 --- a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionPerArgument -// !CHECK_TYPE -// FILE: J.java -public interface J { - void f_t(F f1, F f2); - void f_r(F f1, F f2); - void f_pr(F> f1, F> f2); -} - -// FILE: F.java -public interface F { - void apply(S s); -} - -// FILE: PR.java -public interface PR {} - -// FILE: 1.kt - -fun test( - j: J, - f_string: F, - f_int: F, - f_pr: F> -) { - j.f_t(f_string) { it checkType { _() } } - j.f_r(f_int) { it checkType { _() } } - j.f_pr(f_pr) { it checkType { _>() } } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.kt b/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.kt index 85ccf5612eb..18764bda928 100644 --- a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.kt +++ b/compiler/testData/diagnostics/tests/samConversions/GenericSubstitution.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionPerArgument // !CHECK_TYPE // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.fir.kt deleted file mode 100644 index 0bf63f43541..00000000000 --- a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument -// !CHECK_TYPE -// FILE: F.java -public interface F { - void apply(S s); -} - -// FILE: PR.java -public interface PR {} - -// FILE: 1.kt -interface K { - fun f_t(f1: F, f2: F) - fun f_r(f1: F, f2: F) - fun f_pr(f1: F>, f2: F>) -} - -fun test( - k: K, - f_string: F, - f_int: F, - f_pr: F> -) { - k.f_t(f_string) { it checkType { _() } } - k.f_r(f_int) { it checkType { _() } } - k.f_pr(f_pr) { it checkType { _>() } } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.kt b/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.kt index 0bf63f43541..6cac421e69a 100644 --- a/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.kt +++ b/compiler/testData/diagnostics/tests/samConversions/GenericSubstitutionKT.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument // !CHECK_TYPE // FILE: F.java diff --git a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.fir.kt b/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.fir.kt deleted file mode 100644 index 977da70c817..00000000000 --- a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.fir.kt +++ /dev/null @@ -1,34 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionPerArgument -// FILE: J.java -public interface J { - public void foo1(Runnable r); - - public void foo2(Runnable r1, Runnable r2); - - public void foo3(Runnable r1, Runnable r2, Runnable r3); -} - -// FILE: Runnable.java -public interface Runnable { - void run(); -} - -// FILE: 1.kt -fun test(j: J, r: Runnable) { - j.foo1(r) - j.foo1({}) - - j.foo2(r, r) - j.foo2({}, {}) - j.foo2(r, {}) - j.foo2({}, r) - - j.foo3(r, r, r) - j.foo3(r, r, {}) - j.foo3(r, {}, r) - j.foo3(r, {}, {}) - j.foo3({}, r, r) - j.foo3({}, r, {}) - j.foo3({}, {}, r) - j.foo3({}, {}, {}) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.kt b/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.kt index 977da70c817..49af1f72820 100644 --- a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.kt +++ b/compiler/testData/diagnostics/tests/samConversions/SimpleCorrect.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionPerArgument // FILE: J.java public interface J { diff --git a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.fir.kt deleted file mode 100644 index dfafa0c65a8..00000000000 --- a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument -// FILE: Runnable.java -public interface Runnable { - void run(); -} - -// FILE: 1.kt - -interface K { - fun foo1(r: Runnable) - fun foo2(r1: Runnable, r2: Runnable) - fun foo3(r1: Runnable, r2: Runnable, r3: Runnable) -} -fun test(k: K, r: Runnable) { - k.foo1(r) - k.foo1({}) - - k.foo2(r, r) - k.foo2({}, {}) - k.foo2(r, {}) - k.foo2({}, r) - - k.foo3(r, r, r) - k.foo3(r, r, {}) - k.foo3(r, {}, r) - k.foo3(r, {}, {}) - k.foo3({}, r, r) - k.foo3({}, r, {}) - k.foo3({}, {}, r) - k.foo3({}, {}, {}) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.kt b/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.kt index dfafa0c65a8..14639a2355a 100644 --- a/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.kt +++ b/compiler/testData/diagnostics/tests/samConversions/SimpleCorrectKT.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument // FILE: Runnable.java public interface Runnable { diff --git a/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.fir.kt b/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.fir.kt deleted file mode 100644 index 8f59ee27653..00000000000 --- a/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument -// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE - -// FILE: Action.java -public interface Action { - void execute(T t); -} - -// FILE: Other.java - -// It's important that this is Java -public interface Other { - void pluginManagement(Action pluginManagementSpec); -} - -// FILE: test.kt -interface B { - fun pluginManagement(block: Number.() -> Unit): Unit {} -} - -interface C : B, Other - -fun test(c: C) { - c.pluginManagement { - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.kt b/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.kt index 8f59ee27653..8e30068fd85 100644 --- a/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.kt +++ b/compiler/testData/diagnostics/tests/samConversions/sameCandidatesFromKotlinAndJavaInOneScope.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument // !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.fir.kt b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.fir.kt deleted file mode 100644 index e9597239b3a..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: root.kt -fun testFun() = "239" - -// FILE: otherPackage.kt -package test - -fun testFun() = 12 - -// FILE: using.kt -import test.* - -val t: String = testFun() diff --git a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt index e9597239b3a..0e7d033e20a 100644 --- a/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt +++ b/compiler/testData/diagnostics/tests/scopes/AmbiguityBetweenRootAndPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: root.kt fun testFun() = "239" diff --git a/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.fir.kt b/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.fir.kt deleted file mode 100644 index da8f87f823a..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: root.kt -fun testFun() = 12 - -// FILE: otherPackage.kt -package test - -fun testFun() = 12 - -// FILE: using.kt -package test - -val t = testFun() diff --git a/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.kt b/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.kt index da8f87f823a..66722f19a0a 100644 --- a/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.kt +++ b/compiler/testData/diagnostics/tests/scopes/NoAmbiguityBetweenRootAndPackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: root.kt fun testFun() = 12 diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.fir.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.fir.kt deleted file mode 100644 index 255ac8e7eb9..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface I - -class A : I by impl { - - companion object { - val impl = object : I {} - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.kt b/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.kt index 255ac8e7eb9..1e9632b0744 100644 --- a/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.kt +++ b/compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface I diff --git a/compiler/testData/diagnostics/tests/scopes/genericVsNested.fir.kt b/compiler/testData/diagnostics/tests/scopes/genericVsNested.fir.kt deleted file mode 100644 index afa0b31cac4..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/genericVsNested.fir.kt +++ /dev/null @@ -1,57 +0,0 @@ -class A { - class T - - object E { - init { - T() - } - } - - class F { - init { - T() - } - } - - inner class I { - init { - T() // todo: https://jetbrains.quip.com/hPM5AJcc1nca - } - } - - init { - T() - } -} - -class B { - companion object { - class T; - - init { - T() - } - } - - object E { - init { - T() - } - } - - class F { - init { - T() - } - } - - inner class I { - init { - T() - } - } - - init { - T() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt b/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt index afa0b31cac4..4007db23f92 100644 --- a/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt +++ b/compiler/testData/diagnostics/tests/scopes/genericVsNested.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { class T diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.fir.kt deleted file mode 100644 index ace81e1a17c..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -open class A { - companion object { - fun bar() = 1 - } - init { - val a: Int = foo() - val b: Int = bar() - } -} - -open class B: A() { - companion object { - fun bar() = "" - } - init { - val a: String = foo() - val b: String = bar() - } -} - -fun A.Companion.foo() = 1 -fun B.Companion.foo() = "" - -class C: A() { - init { - val a: Int = foo() - val b: Int = bar() - } -} - -class D: B() { - init { - val a: String = foo() - val b: String = bar() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.kt index ace81e1a17c..2bb2114e912 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/companionObjectsOrder.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE open class A { companion object { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.fir.kt deleted file mode 100644 index 875eb4cfbf8..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -open class A { - companion object { - fun foo() = 1 - fun bar(a: String) = a - } -} - -open class B: A() { - companion object { - fun foo() = "" - fun bar(a: Int) = a - } -} - -class C: B() { - init { - val a: String = foo() - val b: Int = bar(1) - val c: String = bar("") - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.kt index 875eb4cfbf8..8a0d4c0825e 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/severalCompanions.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE open class A { companion object { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.fir.kt deleted file mode 100644 index d5d11213a21..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -// FILE: I.java - -public interface I { - int a = 1; -} - -// FILE: C.java - -public class C implements I { - static int b = 1; - static void bar() {} -} - -// FILE: K.kt - -open class K : C() - -// FILE: D.java - -public class D extends K { - static int c = 1; - static void baz() {} -} - -// FILE: test.kt - -fun test() { - I.a - - C.a - C.b - C.bar() - - K.a - K.b - K.bar() - - D.a - D.b - D.c - D.bar() - D.baz() -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.kt index d5d11213a21..0c599f9079d 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/jjkj.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: I.java public interface I { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.fir.kt deleted file mode 100644 index cfda01f129f..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// FILE: K.kt - -open class K { - companion object { - fun foo() {} - } -} - -// FILE: D.java - -class D extends K { - static int b = 1; - static void bar() {} -} - -// FILE: K.kt - -class K2 { - companion object { - fun baz() {} - } -} - -// FILE: test.kt - -fun test() { - K.foo() - - D.b - D.bar() - D.foo() - - K2.b - K2.bar() - K2.foo() - K2.baz() -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.kt index cfda01f129f..3d6e11b5d29 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/kjk.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: K.kt open class K { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.fir.kt deleted file mode 100644 index c8de65ef916..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.fir.kt +++ /dev/null @@ -1,55 +0,0 @@ -// FILE: I.java - -public interface I { - int a = 1; -} - -// FILE: C.java - -public class C implements I { - static int b = 1; - static void bar() {} -} - -// FILE: K.kt - -open class K : C(), I - -// FILE: D.java - -public class D extends K implements I { - static int c = 1; - static void baz() {} -} - -// FILE: E.java - -public class E extends D implements I { - static int a = 1; -} - -// FILE: test.kt - -fun test() { - I.a - - C.a - C.b - C.bar() - - K.a - K.b - K.bar() - - D.a - D.b - D.c - D.bar() - D.baz() - - E.a - E.b - E.c - E.bar() - E.baz() -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.kt index c8de65ef916..0655974f244 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/oneInterfaceManyTimes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: I.java public interface I { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.fir.kt deleted file mode 100644 index a4111820f3f..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java -public class A { - static void foo() {} - static int bar() { return 1; } -} - -// FILE: B.java -public class B extends A { - static void foo() {} - static long bar() { return 1; } -} - -// FILE: 1.kt -class E: B() { - init { - foo() - val a: Long = bar() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.kt index a4111820f3f..be92fd4c2de 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/overloadStatic.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.fir.kt deleted file mode 100644 index 39dbe26c492..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.fir.kt +++ /dev/null @@ -1,50 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java -public class A { - static void foo() {} - static int bar() {return 1;} -} - -// FILE: B.java -public class B extends A {} - -// FILE: C.java -public class C { - static void bar() {} -} - -// FILE: 1.kt -import A.foo -import B.bar - -class E: A() { - init { - foo() - bar() - } -} - -class F: B() { - init { - foo() - bar() - } -} - -// FILE: 2.kt -import C.bar - -class Z: A() { - init { - val a: Int = bar() - } -} - -// FILE: 3.kt -import C.* - -class Q: A() { - init { - val a: Int = bar() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.kt index 39dbe26c492..7deb814c881 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticFunVsImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.fir.kt deleted file mode 100644 index f6e807ba3e2..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.fir.kt +++ /dev/null @@ -1,59 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java -public class A { - static byte foo = 1; - static int bar = 2; -} - -// FILE: B.java -public class B extends A {} - -// FILE: C.java -public class C { - static long bar = 3; -} - -// FILE: 1.kt -import A.foo -import B.bar - -class E: A() { - init { - foo - bar - } -} - -class F: B() { - init { - foo - bar - } -} - -// FILE: 2.kt -import C.bar - -class Z: A() { - init { - val a: Int = bar - } -} - -// FILE: 3.kt -import C.* - -class Q: A() { - init { - val a: Int = bar - } -} - -// FILE: 4.kt -val bar = "" - -class W: A() { - init { - val a: Int = bar - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.kt index f6e807ba3e2..672ee0edfa2 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticPropertyVsImport.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.fir.kt deleted file mode 100644 index 10b07d1924a..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: A.java -public class A { - static void foo() {} -} - -// FILE: 1.kt -open class B : A() { - companion object { - fun foo() = 1 - } - - init { - val a: Int = foo() - } -} - -class C: B() { - init { - val a: Int = foo() - } -} - -// FILE: X.java -public class X extends B { - static double foo() { - return 1.0; - } -} - -// FILE: 2.kt -class Y: X() { - init { - val a: Double = foo() - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt index 10b07d1924a..999367d0d18 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticVsCompanion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.fir.kt deleted file mode 100644 index fe4aa3fbd4a..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.fir.kt +++ /dev/null @@ -1,51 +0,0 @@ -// FILE: A.java -public class A { - public static void foo() {} -} - -// FILE: B.java -public class B extends A { - public static void bar() {} -} - -// FILE: 1.kt -open class X: A() { - init { - foo() - A.foo() - } -} - -open class Y: B() { - init { - foo() - A.foo() - B.foo() - - bar() - B.bar() - } -} - -class XN: X() { - init { - foo() - A.foo() - X.foo() - XN.foo() - } -} - -class YN: Y() { - init { - foo() - A.foo() - Y.foo() - YN.foo() - - bar() - B.bar() - Y.bar() - YN.bar() - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.kt index fe4aa3fbd4a..0a09f5de815 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { public static void foo() {} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.fir.kt deleted file mode 100644 index 461cba5b0f5..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// FILE: A.java -public class A { - public static void foo() {} -} - -// FILE: 1.kt -open class B: A() - -// FILE: C.java -public class C extends B { - public static void bar() {} -} - -// FILE: 2.kt -class D: C() { - init { - foo() - A.foo() - B.foo() - C.foo() - D.foo() - - bar() - C.bar() - D.bar() - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.kt index 461cba5b0f5..196b52c9e89 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/staticsFromjavaAfterKotlin.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { public static void foo() {} diff --git a/compiler/testData/diagnostics/tests/scopes/kt1078.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1078.fir.kt deleted file mode 100644 index aef363bfa9a..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt1078.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -//KT-1078 Problem with visibility in do-while - -package kt1078 - -fun test() : B { - do { - val x = foo() - } while(x.bar()) // x is not visible here! - return B() -} - -class B() { - fun bar() = true -} - -fun foo() = B() diff --git a/compiler/testData/diagnostics/tests/scopes/kt1078.kt b/compiler/testData/diagnostics/tests/scopes/kt1078.kt index aef363bfa9a..877e6d75dd5 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1078.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1078.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1078 Problem with visibility in do-while package kt1078 diff --git a/compiler/testData/diagnostics/tests/scopes/kt1579.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1579.fir.kt deleted file mode 100644 index 6c1ef8f6c63..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt1579.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -//FILE:a.kt -//KT-1579 Can't import nested class/interface -package lib -interface WithInner { - interface Inner { - } -} -//FILE:b.kt -package user -import lib.WithInner.Inner \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/kt1579.kt b/compiler/testData/diagnostics/tests/scopes/kt1579.kt index 6c1ef8f6c63..ba0694280d5 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1579.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1579.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:a.kt //KT-1579 Can't import nested class/interface package lib diff --git a/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.fir.kt deleted file mode 100644 index f9bb0d33c84..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -//FILE:a.kt -//+JDK -package a -import kotlin.collections.Map.* - -fun foo(b : Entry) = b - -//FILE:b.kt -//+JDK -package b - -import kotlin.collections.Map.Entry -fun bar(b : Entry) = b - -//FILE:c.kt -//+JDK -package c - -fun fff(b: Map.Entry) = b \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.kt b/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.kt index f9bb0d33c84..da2a774e00a 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1579_map_entry.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:a.kt //+JDK package a diff --git a/compiler/testData/diagnostics/tests/scopes/kt1642.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1642.fir.kt deleted file mode 100644 index 54819f5e0ae..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt1642.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -//FILE:a.kt -//KT-1642 kotlin subpackages hide Java's toplevel packages -package a.java - -//FILE:b.kt -//+JDK -package a - -import java.util.ArrayList \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/kt1642.kt b/compiler/testData/diagnostics/tests/scopes/kt1642.kt index 54819f5e0ae..cab283b099c 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1642.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1642.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //FILE:a.kt //KT-1642 kotlin subpackages hide Java's toplevel packages package a.java diff --git a/compiler/testData/diagnostics/tests/scopes/kt2262.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt2262.fir.kt deleted file mode 100644 index c78be35d876..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt2262.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -package kt2262 - -//KT-2262 Cannot access protected member from inner class of subclass - -abstract class Foo { - protected val color: String = "red" -} - -class Bar : Foo() { - protected val i: Int = 1 - - inner class Baz { - val copy = color // INVISIBLE_MEMBER: Cannot access 'color' in 'Bar' - val j = i - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/scopes/kt2262.kt b/compiler/testData/diagnostics/tests/scopes/kt2262.kt index c78be35d876..5f14e74c351 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt2262.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt2262.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package kt2262 //KT-2262 Cannot access protected member from inner class of subclass diff --git a/compiler/testData/diagnostics/tests/scopes/kt587.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt587.fir.kt deleted file mode 100644 index 9e4b325ea89..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt587.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// KT-587 Unresolved reference - -class Main { - companion object { - class States() { - companion object { - public val N: States = States() // : States unresolved - } - } - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/kt587.kt b/compiler/testData/diagnostics/tests/scopes/kt587.kt index 9e4b325ea89..7ca1eb36e8d 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt587.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt587.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-587 Unresolved reference class Main { diff --git a/compiler/testData/diagnostics/tests/scopes/kt939.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt939.fir.kt deleted file mode 100644 index 6abc2f93dfa..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/kt939.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -package kt939 - -//KT-939 CommonSupertypes erases scopes associated to types - -fun compare(o1 : String?, o2 : String?) : Int { - val l1 = o1?.length ?: 0 - val l2 = o2?.length ?: 0 - return l1 - l2 // '-' is unresolved, because the type of l1 is Int with an empty member scope -} - -//KT-1117 Unresolved reference to multiply sign - -fun test() { - (System.getProperty("path.separator")?.length ?: 4) * 55 + 5 - - val x = System.getProperty("path.separator")?.length ?: 4 - x * 55 + 5 -} diff --git a/compiler/testData/diagnostics/tests/scopes/kt939.kt b/compiler/testData/diagnostics/tests/scopes/kt939.kt index 6abc2f93dfa..1824a9e3468 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt939.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt939.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package kt939 //KT-939 CommonSupertypes erases scopes associated to types diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.fir.kt deleted file mode 100644 index ef6809e9dba..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: p1/BaseClass.java - -package p1; - -public class BaseClass { - protected class ProtSubClass { - public ProtSubClass() {} - } -} - -// FILE: k1/main.kt -package k1 - -import p1.BaseClass - -class Foo : BaseClass() { - - fun foo() { - ProtSubClass() - super.ProtSubClass() - } - - private val v1: BaseClass.ProtSubClass = ProtSubClass() -} diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.kt index ef6809e9dba..25294097533 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerClassInJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: p1/BaseClass.java package p1; diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.fir.kt deleted file mode 100644 index bf4789a773e..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: A.java -public class A { - protected A() {} - protected A(int x) {} - public A(double x) {} -} - -// FILE: main.kt - -class B4 : A(1) { - init { - A() - A(1) - A(5.0) - } - - fun foo() { - A() - A(1) - A(5.0) - - object : A() {} - object : A(1) {} - object : A(5.0) {} - - class Local : A() - } -} diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.kt index bf4789a773e..43efcd8be2f 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/nonSuperCallConstructorJavaSamePackage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: A.java diff --git a/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.fir.kt b/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.fir.kt deleted file mode 100644 index 79d3a50776a..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FILE: SameClassNameResolveTest.kt -package test - -open class Base -class SubBase: Base() - -// FILE: SameClassNameResolveRoot.kt - -open class Base -class SubBase: Base() diff --git a/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.kt b/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.kt index 79d3a50776a..b5a6ea0a52b 100644 --- a/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.kt +++ b/compiler/testData/diagnostics/tests/scopes/sameClassNameResolve.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: SameClassNameResolveTest.kt package test diff --git a/compiler/testData/diagnostics/tests/sealed/DoubleInner.fir.kt b/compiler/testData/diagnostics/tests/sealed/DoubleInner.fir.kt deleted file mode 100644 index a4be675f925..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/DoubleInner.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -sealed class Sealed(val x: Int) { - object First: Sealed(12) - open class NonFirst(x: Int, val y: Int): Sealed(x) { - object Second: NonFirst(34, 2) - object Third: NonFirst(56, 3) - // It's ALLOWED to inherit Sealed also here - object Fourth: Sealed(78) - } -} diff --git a/compiler/testData/diagnostics/tests/sealed/DoubleInner.kt b/compiler/testData/diagnostics/tests/sealed/DoubleInner.kt index a4be675f925..ed9754c67d3 100644 --- a/compiler/testData/diagnostics/tests/sealed/DoubleInner.kt +++ b/compiler/testData/diagnostics/tests/sealed/DoubleInner.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { object First: Sealed(12) open class NonFirst(x: Int, val y: Int): Sealed(x) { diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.fir.kt deleted file mode 100644 index cd9a104257f..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -sealed class Sealed(val x: Int) { - object First: Sealed(12) - open class NonFirst(x: Int, val y: Int): Sealed(x) { - object Second: NonFirst(34, 2) - object Third: NonFirst(56, 3) - } -} - -fun foo(s: Sealed): Int { - return when(s) { - is Sealed.First -> 1 - is Sealed.NonFirst -> 0 - // no else required - } -} - diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.kt index cd9a104257f..2830f415e37 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { object First: Sealed(12) open class NonFirst(x: Int, val y: Int): Sealed(x) { diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.fir.kt deleted file mode 100644 index 1a4fc73d191..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -sealed class Sealed() { - object First: Sealed() - open class NonFirst: Sealed() { - object Second: NonFirst() - object Third: NonFirst() - // It's ALLOWED to inherit Sealed also from here - object Fourth: Sealed() - } -} - -fun foo(s: Sealed) = when(s) { - Sealed.First -> 1 - is Sealed.NonFirst -> 2 - Sealed.NonFirst.Fourth -> 4 - // no else required -} diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.kt index 1a4fc73d191..4783dcfb7ac 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed() { object First: Sealed() open class NonFirst: Sealed() { diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.fir.kt deleted file mode 100644 index 1e0f78ef81c..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -sealed class Sealed(val x: Int) { - object First: Sealed(12) - open class NonFirst(x: Int, val y: Int): Sealed(x) { - object Second: NonFirst(34, 2) - object Third: NonFirst(56, 3) - } -} - -fun foo(s: Sealed): Int { - return when(s) { - is Sealed.First -> 1 - !is Sealed.First -> 0 - // no else required - } -} - diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.kt index 1e0f78ef81c..1b0fa29bc8e 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { object First: Sealed(12) open class NonFirst(x: Int, val y: Int): Sealed(x) { diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.fir.kt deleted file mode 100644 index 949ccc9b67c..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -sealed class Sealed(val x: Int) { - object First: Sealed(12) - open class NonFirst(x: Int, val y: Int): Sealed(x) { - object Second: NonFirst(34, 2) - object Third: NonFirst(56, 3) - } - object Last: Sealed(78) -} - -fun foo(s: Sealed): Int { - return when(s) { - !is Sealed.First -> 1 - !is Sealed.Last -> 0 - // no else required - } -} - diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.kt index 949ccc9b67c..68ea1da22c7 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { object First: Sealed(12) open class NonFirst(x: Int, val y: Int): Sealed(x) { diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.fir.kt deleted file mode 100644 index 38c493ca263..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -sealed class Sealed(val x: Int) { - object First: Sealed(12) - open class NonFirst(x: Int, val y: Int): Sealed(x) { - object Second: NonFirst(34, 2) - object Third: NonFirst(56, 3) - } -} - -fun foo(s: Sealed?): Int { - return when(s) { - is Sealed.First -> 1 - is Sealed.NonFirst -> 0 - null -> -1 - // no else required - } -} - diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.kt index 38c493ca263..5e49c608994 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { object First: Sealed(12) open class NonFirst(x: Int, val y: Int): Sealed(x) { diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.fir.kt deleted file mode 100644 index 1f12821e8ba..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -sealed class Sealed(val x: Int) { - data class Tuple(val x: Int, val y: Int) - object First: Sealed(12) - open class NonFirst(tuple: Tuple): Sealed(tuple.x) { - val y: Int = tuple.y - object Second: NonFirst(Tuple(34, 2)) - object Third: NonFirst(Tuple(56, 3)) - } -} - -fun foo(s: Sealed): Int { - return when(s) { - is Sealed.First -> 1 - is Sealed.NonFirst -> 0 - // no else required - } -} - diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.kt index 1f12821e8ba..481e4210931 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { data class Tuple(val x: Int, val y: Int) object First: Sealed(12) diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.fir.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.fir.kt deleted file mode 100644 index 711f599a637..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -sealed class Sealed(val x: Int) { - object First: Sealed(12) - open class NonFirst(x: Int, val y: Int): Sealed(x) { - object Second: NonFirst(34, 2) - object Third: NonFirst(56, 3) - } -} - -fun foo(s: Sealed): Int { - return when(s) { - is Sealed.NonFirst -> 0 - else -> -1 - } -} - diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.kt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.kt index 711f599a637..4b374c89949 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.kt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Sealed(val x: Int) { object First: Sealed(12) open class NonFirst(x: Int, val y: Int): Sealed(x) { diff --git a/compiler/testData/diagnostics/tests/sealed/NotFinal.fir.kt b/compiler/testData/diagnostics/tests/sealed/NotFinal.fir.kt deleted file mode 100644 index 0cf7cf13a5b..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/NotFinal.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// See KT-9244 - -sealed class Foo { - class Bar : Foo() - class Baz : Foo() -} - -// The following warning seems incorrect here -// "Foo is a final type, and thus a value of the type parameter is predetermined" -fun doit(arg: T): T = arg \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/sealed/NotFinal.kt b/compiler/testData/diagnostics/tests/sealed/NotFinal.kt index 0cf7cf13a5b..329ffb1d013 100644 --- a/compiler/testData/diagnostics/tests/sealed/NotFinal.kt +++ b/compiler/testData/diagnostics/tests/sealed/NotFinal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-9244 sealed class Foo { diff --git a/compiler/testData/diagnostics/tests/sealed/OperationWhen.fir.kt b/compiler/testData/diagnostics/tests/sealed/OperationWhen.fir.kt deleted file mode 100644 index c45fa8412f7..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/OperationWhen.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -sealed class Operation(val left: Int, val right: Int) { - abstract fun exec(): Int - class Plus(left: Int, right: Int): Operation(left, right) { - override fun exec(): Int = left + right - } - class Minus(left: Int, right: Int): Operation(left, right) { - override fun exec(): Int = left - right - } - class Times(left: Int, right: Int): Operation(left, right) { - override fun exec(): Int = left * right - } - class Slash(left: Int, right: Int): Operation(left, right) { - override fun exec(): Int = left / right - } -} - -fun priority(op: Operation) = when(op) { - is Operation.Plus, is Operation.Minus -> 1 - is Operation.Times, is Operation.Slash -> 2 -} diff --git a/compiler/testData/diagnostics/tests/sealed/OperationWhen.kt b/compiler/testData/diagnostics/tests/sealed/OperationWhen.kt index c45fa8412f7..594d24858ef 100644 --- a/compiler/testData/diagnostics/tests/sealed/OperationWhen.kt +++ b/compiler/testData/diagnostics/tests/sealed/OperationWhen.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL sealed class Operation(val left: Int, val right: Int) { abstract fun exec(): Int class Plus(left: Int, right: Int): Operation(left, right) { diff --git a/compiler/testData/diagnostics/tests/sealed/WithInterface.fir.kt b/compiler/testData/diagnostics/tests/sealed/WithInterface.fir.kt deleted file mode 100644 index d1b2b3641d0..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/WithInterface.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -interface Parent -interface Child : Parent - -sealed class Page : Parent { - object One : Page(), Child - object Two : Page(), Child -} - -// Ok: page is a Parent so it can be easily a Child -fun test(page: Page): Boolean = page is Child diff --git a/compiler/testData/diagnostics/tests/sealed/WithInterface.kt b/compiler/testData/diagnostics/tests/sealed/WithInterface.kt index d1b2b3641d0..54b4bb03ffa 100644 --- a/compiler/testData/diagnostics/tests/sealed/WithInterface.kt +++ b/compiler/testData/diagnostics/tests/sealed/WithInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Parent interface Child : Parent diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.fir.kt deleted file mode 100644 index 30c8fe5f432..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class A { - constructor() - init {} -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.kt index 30c8fe5f432..63d6075cb81 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/classInitializersWithoutPrimary.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { constructor() init {} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.fir.kt deleted file mode 100644 index 2ae3abd1d32..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -fun foo(x: Outer) = 1 -class Outer { - inner class Inner { - constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + foo(this@Outer)) : this(x + foo(this@Outer)) - } -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.kt index 2ae3abd1d32..1fec2acdf2f 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterInstance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo(x: Outer) = 1 class Outer { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.fir.kt deleted file mode 100644 index f429be3cf36..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -class Outer { - val prop = 1 - inner class Inner { - constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + prop + this@Outer.prop) : this(x + prop + this@Outer.prop) - } -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.kt index f429be3cf36..50892b71313 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/usingOuterProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class Outer { val prop = 1 diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.fir.kt deleted file mode 100644 index 783a39e61ab..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -class A { - val x: Int - val y: Int - constructor(x: Int, y: Int) { - this.x = x - this.y = y - } - constructor(other: A) { - x = other.x - y = other.y - } -} -class A1(val x: Int, val y: Int) { - constructor(other: A1): this(other.x, other.y) -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.kt index 783a39e61ab..74ae703c7c2 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/initializationFromOtherInstance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A { val x: Int val y: Int diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.fir.kt deleted file mode 100644 index c89b547890c..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -class A { - constructor(block: (T1) -> T2) - constructor(x: T2): this({ x }) -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.kt index c89b547890c..c6a20f43478 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/lambdaInDelegation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class A { constructor(block: (T1) -> T2) diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.fir.kt deleted file mode 100644 index 8cacea8d87e..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -// do not report generate empty synthetic constructor by primary as it leads to CONFLICTING_JVM_DECLARATIONS -class A(val x: Int = 1, val y: Int = 2) { - constructor(): this(0, 0) -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.kt index 8cacea8d87e..54954072a01 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/noDefaultIfEmptySecondary.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // do not report generate empty synthetic constructor by primary as it leads to CONFLICTING_JVM_DECLARATIONS class A(val x: Int = 1, val y: Int = 2) { constructor(): this(0, 0) diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.fir.kt deleted file mode 100644 index 7b5fe15c5e8..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -open class B -interface C -interface D -class A : C, B, D { - constructor() -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.kt index 7b5fe15c5e8..af9e7314c4d 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/noSupertypeInitWithSecondaryConstructors.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class B interface C interface D diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.fir.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.fir.kt deleted file mode 100644 index 6490b74f72d..00000000000 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -val i = 17 - -val f: () -> Int = { var i = 17; i } diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.kt index 6490b74f72d..29b87b13fe2 100644 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.kt +++ b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInClosure.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val i = 17 val f: () -> Int = { var i = 17; i } diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.fir.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.fir.kt deleted file mode 100644 index e0d4766e89f..00000000000 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class RedefinePropertyInFor() { - - var i = 1 - - fun ff() { - for (i in 0..10) { - } - } - -} - diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.kt index e0d4766e89f..8dbd7c4a0f7 100644 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.kt +++ b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class RedefinePropertyInFor() { var i = 1 diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.fir.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.fir.kt deleted file mode 100644 index cacf415e65e..00000000000 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -class RedefinePropertyInFunction() { - - var i = 17 - - fun f(): Int { - var i = 18 - return i - } - -} diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.kt index cacf415e65e..9e0f0abf602 100644 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.kt +++ b/compiler/testData/diagnostics/tests/shadowing/ShadowPropertyInFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class RedefinePropertyInFunction() { var i = 17 diff --git a/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.fir.kt b/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.fir.kt deleted file mode 100644 index bb390470e40..00000000000 --- a/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_ANONYMOUS_PARAMETER - -open class Base { - open fun foo(name: String) {} -} - -fun test1(name: String) { - class Local : Base() { - override fun foo(name: String) { - } - } -} - -fun test2(param: String) { - fun local(param: String) {} -} - -fun test3(param: String) { - fun local() { - fff { param -> } - } -} - -fun fff(x: (y: String) -> Unit) {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.kt b/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.kt index bb390470e40..5a3c5ee36ea 100644 --- a/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.kt +++ b/compiler/testData/diagnostics/tests/shadowing/noNameShadowingForSimpleParameters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_ANONYMOUS_PARAMETER open class Base { diff --git a/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.fir.kt deleted file mode 100644 index 90df45ae42b..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// See KT-10276 - -class Bar() { - var test: String? = null - fun foo() { - if (test != null) { - // No warning: test is a mutable property - test?.hashCode() - } - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.kt b/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.kt index 90df45ae42b..11757ef81fb 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/falseUnnecessaryCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-10276 class Bar() { diff --git a/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.fir.kt deleted file mode 100644 index 9dae20755e2..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// See also KT-7801 -class A - -fun test(v: T): T { - val a: T = if (v !is A) v else v - return a -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.kt b/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.kt index 9dae20755e2..98164781118 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/genericIntersection.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See also KT-7801 class A diff --git a/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.fir.kt deleted file mode 100644 index aa90fc31447..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -open class A { - open fun foo() = "FAIL" - - fun bar() = if (this is C) foo() else "FAIL" -} - -open class B : A() - -open class C : B() { - override fun foo() = "OK" -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.kt b/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.kt index aa90fc31447..f1ed735688f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/implicitToGrandSon.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class A { open fun foo() = "FAIL" diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.fir.kt deleted file mode 100644 index 7ef7f5b09b0..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_LAMBDA_EXPRESSION -VARIABLE_WITH_REDUNDANT_INITIALIZER -UNUSED_EXPRESSION - -object Test { - fun foo(actual: T) {} - fun foo(actual: T) {} -} - -fun main() { - var y: Number? = null - y = 2 - { y = 1 } - Test.foo(y) -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt index 66555836e54..d367eac1d3b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/stabilityOfSmartcastsAgainstGenericFunctions.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_LAMBDA_EXPRESSION -VARIABLE_WITH_REDUNDANT_INITIALIZER -UNUSED_EXPRESSION object Test { diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.fir.kt deleted file mode 100644 index 27b0b8f0f0f..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -interface A { - fun foo() -} - -interface C: A -interface B: A - -fun test(c: C) { - if (c is B) { - c.foo() // OVERLOAD_RESOLUTION_AMBIGUITY: B.foo() and C.foo() - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.kt index 27b0b8f0f0f..702681611ed 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/simple.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun foo() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.fir.kt deleted file mode 100644 index d17eaa3f9a1..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !CHECK_TYPE - -interface A { - fun foo(): E -} - -interface B : A { - override fun foo(): W -} - -fun test(a: A) { - if (a is B) { - a.foo().checkType { _() } - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.kt index d17eaa3f9a1..89e565a9f51 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/validTypeParametersNoSmartCast.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE interface A { diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt3244.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt3244.fir.kt deleted file mode 100644 index a8d568a972e..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/kt3244.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// Should work already in M11 - -open class A(val s : String) -class B(s : String) : A(s) - -fun test(a : A): String? { - if (a is B) { - // Earlier (14.01.2013) reported overload ambiguity over s - return a.s - } - return null -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt3244.kt b/compiler/testData/diagnostics/tests/smartCasts/kt3244.kt index a8d568a972e..5109317f44c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt3244.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt3244.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Should work already in M11 open class A(val s : String) diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt3572.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt3572.fir.kt deleted file mode 100644 index fc792d1ca81..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/kt3572.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -interface Printer { - fun print() -} - -class OKPrinter : Printer { - override fun print() { } -} - -class MyClass(var printer: Printer) - - -fun main(m: MyClass) { - if (m.printer is OKPrinter) { - // We do not need smart cast here, so we should not get SMARTCAST_IMPOSSIBLE - m.printer.print() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt3572.kt b/compiler/testData/diagnostics/tests/smartCasts/kt3572.kt index fc792d1ca81..69d77a5b4b9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt3572.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt3572.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Printer { fun print() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.fir.kt deleted file mode 100644 index fcb5ef96cc1..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -class Indexed(val x: T, val y: Int) - -class Value(val x: T) - -interface WithValue { - fun value(): Value -} - -class Singleton(val x: T) : WithValue { - override fun value() = Value(x) -} - -class WithValueIndexed(val f: () -> Value) : WithValue> { - override fun value() = Value(Indexed(f().x, 0)) -} - -fun Singleton.indexed(): WithValue> { - return WithValueIndexed { value() } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.kt index fcb5ef96cc1..5d9ffe6882c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaArgumentNoSubstitutedReturn.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Indexed(val x: T, val y: Int) class Value(val x: T) diff --git a/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.fir.kt deleted file mode 100644 index 9a38cbf1172..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -fun Any?.foo() {} - -fun test(a: Any?) { - if (a != null) { - a.foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.kt b/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.kt index 9a38cbf1172..3a93386340e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/noUnnecessarySmartCastForReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun Any?.foo() {} fun test(a: Any?) { diff --git a/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.fir.kt deleted file mode 100644 index 8431470f568..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -open class VeryBase - -open class Base : VeryBase() - -class Derived : Base() { - fun original(): VeryBase = this -} - -class Another : Base() - -fun foo(d: Derived, a: Another?): Base? { - // d is compared with d.original(): VeryBase but should retain its own type - if (d.original() != d) return null - // ad should be of type Base, not VeryBase - val ad = a ?: d - return ad -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.kt b/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.kt index 8431470f568..e0117a0656f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/typeDegradation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class VeryBase open class Base : VeryBase() diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.fir.kt deleted file mode 100644 index 95a78781df3..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -fun x(): Boolean { return true } - -public fun foo(pp: Any): Int { - var p = pp - do { - (p as String).length - if (p == "abc") break - p = 42 - } while (!x()) - // Smart cast is NOT possible here - return p.length() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.kt index 95a78781df3..3b6cf27a408 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/doWhileWithMiddleBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } public fun foo(pp: Any): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.fir.kt deleted file mode 100644 index 3c3b0d72337..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -fun foo() { - var v: Any = "xyz" - // It is possible in principle to provide smart cast here - // but now we decide that v is Any - v.length() - v = 42 - v.length() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.kt index 3c3b0d72337..a3b26d1c32b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/initialization.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo() { var v: Any = "xyz" // It is possible in principle to provide smart cast here diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.fir.kt deleted file mode 100644 index 7bd807aadbc..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -interface A { - fun ok(): Boolean -} - -class B: A { - override fun ok(): Boolean { return true } -} - -class C: A { - override fun ok(): Boolean { return false } -} - -fun foo(): Boolean { - var v: A - v = B() - // No smart cast needed, but not a problem if ever - if (v.ok()) { - v = C() - } - // No smart cast needed, and no smart cast possible! - // We cannot choose between B and C - return v.ok() -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.kt index 7bd807aadbc..31ef5078431 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/kt7599.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun ok(): Boolean } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.fir.kt deleted file mode 100644 index 631449c8f14..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -class MyClass(var p: String?) - -fun bar(s: String?): Int { - return s?.length ?: -1 -} - -fun foo(m: MyClass): Int { - m.p = "xyz" - return bar(m.p) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt index 631449c8f14..2911f1df422 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/propertyNotNeeded.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class MyClass(var p: String?) fun bar(s: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.fir.kt deleted file mode 100644 index 2563e8c449f..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -class MyClass(var p: Any) - -fun bar(s: Any): Int { - return s.hashCode() -} - -fun foo(m: MyClass): Int { - m.p = "xyz" - return bar(m.p) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.kt index 2563e8c449f..e8547824fb9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class MyClass(var p: Any) fun bar(s: Any): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.fir.kt deleted file mode 100644 index a47fce835c2..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun bar(s: Any): Int { - return s.hashCode() -} - -class MyClass(var p: Any) { - fun foo(): Int { - p = "xyz" - return bar(p) - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.kt index a47fce835c2..2f38196b562 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(s: Any): Int { return s.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.fir.kt deleted file mode 100644 index 1575866e196..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -fun bar(s: Any): Int { - return s.hashCode() -} - -class MyClass(var p: Any) { - fun foo(): Int { - p = "xyz" - if (p is String) { - return bar(p) - } - return -1 - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.kt index 1575866e196..4bb867ba9d8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/propertySubtypeInMemberCheck.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(s: Any): Int { return s.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.fir.kt deleted file mode 100644 index 3bbf2191c1f..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -fun x(): Boolean { return true } - -public fun foo(pp: Any): Int { - var p = pp - while(true) { - (p as String).length - if (x()) break - p = 42 - } - // Smart cast is NOT possible here - // (we could provide it but p = 42 makes it difficult to understand) - return p.length() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.kt index 3bbf2191c1f..d92f607130a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/whileTrue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } public fun foo(pp: Any): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.fir.kt deleted file mode 100644 index d996a398daa..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -fun String?.foo(): String { - return this ?: "" -} - -class MyClass { - private var s: String? = null - - fun bar(): String { - s = "42" - return s.foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.kt index d996a398daa..527a66cd24b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessary.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun String?.foo(): String { return this ?: "" } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.fir.kt deleted file mode 100644 index 5827bba34e2..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -fun String?.foo(): String { - return this ?: "" -} - -class MyClass { - fun bar(): String { - var s: String? = null - if (4 < 2) - s = "42" - return s.foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.kt index 5827bba34e2..e750ea4ef21 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithBranch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun String?.foo(): String { return this ?: "" } diff --git a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.fir.kt deleted file mode 100644 index a679b102d71..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// See KT-10061 - -class My { - val x: Int? get() = 42 -} - -fun foo(my: My) { - my.x!! - when (my.x) { } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.kt b/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.kt index a679b102d71..00a7eec0622 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossible.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-10061 class My { diff --git a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.fir.kt deleted file mode 100644 index 955e071a1d8..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// See KT-10061 -// FILE: My.java -public class My { - String getSomething() { return "xyz"; } -} - -// FILE: My.kt -fun foo(my: My) { - my.something!! - when (my.something) { } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.kt b/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.kt index 955e071a1d8..d0a7d05744b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/whenSubjectImpossibleJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-10061 // FILE: My.java public class My { diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.fir.kt deleted file mode 100644 index 6d35fbdbbb6..00000000000 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !API_VERSION: 1.1 - -@SinceKotlin("0.9") -fun ok1() {} - -@SinceKotlin("1.0") -fun ok2() {} - -@SinceKotlin("1.1") -fun ok3() {} - -@SinceKotlin("0.9.9") -fun ok4() {} - -fun t1() = ok1() -fun t2() = ok2() -fun t3() = ok3() -fun t4() = ok4() diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.kt index 6d35fbdbbb6..9b7f6c37a8a 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/sinceOldVersionIsOK.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !API_VERSION: 1.1 @SinceKotlin("0.9") diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.fir.kt deleted file mode 100644 index c6d1216532e..00000000000 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !DIAGNOSTICS: -NOTHING_TO_INLINE -// !LANGUAGE: -InlineProperties - -inline fun String.test() { -} - -inline fun test() { -} - -class A { - inline fun String.test() { - } - - inline fun test() { - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.kt index c6d1216532e..e4a80e66059 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/inlineFunctionAlways.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -NOTHING_TO_INLINE // !LANGUAGE: -InlineProperties diff --git a/compiler/testData/diagnostics/tests/substitutions/kt1558-short.fir.kt b/compiler/testData/diagnostics/tests/substitutions/kt1558-short.fir.kt deleted file mode 100644 index daee244f735..00000000000 --- a/compiler/testData/diagnostics/tests/substitutions/kt1558-short.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun List<*>.toArray(ar: Array): Array = ar - -fun testArrays(ci : List) { - ci.toArray(x) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/substitutions/kt1558-short.kt b/compiler/testData/diagnostics/tests/substitutions/kt1558-short.kt index daee244f735..2f59c9e1577 100644 --- a/compiler/testData/diagnostics/tests/substitutions/kt1558-short.kt +++ b/compiler/testData/diagnostics/tests/substitutions/kt1558-short.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun List<*>.toArray(ar: Array): Array = ar fun testArrays(ci : List) { diff --git a/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.fir.kt b/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.fir.kt deleted file mode 100644 index c52250c1c84..00000000000 --- a/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.fir.kt +++ /dev/null @@ -1,45 +0,0 @@ -class A : () -> Unit { - override fun invoke() {} -} - -class AA : Function0 { - override fun invoke() {} -} - -class B : (Double) -> Unit { - override fun invoke(p1: Double) {} -} - -class BB : Function1 { - override fun invoke(p1: Double) {} -} - -open class C {} - -abstract class A0 : (C) -> Int -abstract class A1 : Function1 - -abstract class A2 : (C, Int) -> Int -abstract class A3 : Function2 - -abstract class A4 : (Int, C, String) -> Int -abstract class A5 : Function3 - -open class D {} - -abstract class B0 : (D) -> Int -abstract class B1 : Function1, Int> - -abstract class B2 : (D, C) -> Int -abstract class B3 : Function2, C, Int> - -abstract class B4 : (D, C) -> T -abstract class B5 : Function2, C, T> - -interface E {} - -abstract class C0: C(), (Int) -> Double -abstract class C1: C(), Function1 - -abstract class C2: C(), E, (Int, C) -> Double -abstract class C3: C(), E, Function2 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.kt b/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.kt index c52250c1c84..bd920753d17 100644 --- a/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.kt +++ b/compiler/testData/diagnostics/tests/subtyping/functionTypeAsSuperType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A : () -> Unit { override fun invoke() {} } diff --git a/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.fir.kt b/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.fir.kt deleted file mode 100644 index 1f48345b327..00000000000 --- a/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -import java.io.Serializable - -class A where T : Cloneable, T : Serializable - -interface CS1 : Cloneable, Serializable -interface CS2 : CS1 - -interface I1 { - fun foo(): A -} - -interface I2 : I1 { - override fun foo(): A -} - -interface I3 : I1 { - override fun foo(): A -} diff --git a/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.kt b/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.kt index 1f48345b327..1a4d34cd73d 100644 --- a/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.kt +++ b/compiler/testData/diagnostics/tests/subtyping/invariantArgumentForTypeParameterWithMultipleBounds.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import java.io.Serializable class A where T : Cloneable, T : Serializable diff --git a/compiler/testData/diagnostics/tests/subtyping/kt-1457.fir.kt b/compiler/testData/diagnostics/tests/subtyping/kt-1457.fir.kt deleted file mode 100644 index 7c0768cc801..00000000000 --- a/compiler/testData/diagnostics/tests/subtyping/kt-1457.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !CHECK_TYPE -// JAVAC_EXPECTED_FILE - -import java.util.ArrayList - -class Pair(val a: A, val b: B) - -class MyListOfPairs : ArrayList>() { } - -fun test() { - checkSubtype>>(MyListOfPairs()) -} diff --git a/compiler/testData/diagnostics/tests/subtyping/kt-1457.kt b/compiler/testData/diagnostics/tests/subtyping/kt-1457.kt index 7c0768cc801..78de0369811 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt-1457.kt +++ b/compiler/testData/diagnostics/tests/subtyping/kt-1457.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // JAVAC_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/tests/subtyping/kt2069.fir.kt b/compiler/testData/diagnostics/tests/subtyping/kt2069.fir.kt deleted file mode 100644 index c2c70d7bcb8..00000000000 --- a/compiler/testData/diagnostics/tests/subtyping/kt2069.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -//KT-2069 Cannot call super method when superclass has type parameters -package kt2069 - -interface T1 { - fun foo() {} -} - -class T : T1 { - fun bar() { - super.foo() - } - - companion object {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/kt2069.kt b/compiler/testData/diagnostics/tests/subtyping/kt2069.kt index c2c70d7bcb8..a895be81d0d 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt2069.kt +++ b/compiler/testData/diagnostics/tests/subtyping/kt2069.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2069 Cannot call super method when superclass has type parameters package kt2069 diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.fir.kt deleted file mode 100644 index d623e09277f..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -@Suppress("warnings") -val anonymous = object { - fun foo(p: String?? = "" as String) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.kt index d623e09277f..a0ddddd6877 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Suppress("warnings") val anonymous = object { fun foo(p: String?? = "" as String) {} diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.fir.kt deleted file mode 100644 index 5ada7c89028..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class C { - @Suppress("warnings") - companion object { - val foo: String?? = null as Nothing? - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt index 5ada7c89028..d029e19972d 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClassObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { @Suppress("warnings") companion object { diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.fir.kt deleted file mode 100644 index 609b38cd708..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -fun foo() { - @Suppress("warnings") - ("" as String??) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt index 609b38cd708..3f64fd29bc5 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo() { @Suppress("warnings") ("" as String??) diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.fir.kt deleted file mode 100644 index 463e8a93fa4..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -@file:Suppress("warnings") - -class C { - companion object { - val foo: String?? = null as Nothing? - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.kt index 463e8a93fa4..dc56599eccd 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @file:Suppress("warnings") class C { diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.fir.kt deleted file mode 100644 index e3417c31183..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class C { - @Suppress("warnings") - fun foo(p: String??) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt index e3417c31183..f26b9636d29 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { @Suppress("warnings") fun foo(p: String??) {} diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.fir.kt deleted file mode 100644 index e7a06b4fbc5..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -@Suppress("warnings") -object C { - fun foo(p: String??) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt index e7a06b4fbc5..3e01a506ddb 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Suppress("warnings") object C { fun foo(p: String??) {} diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.fir.kt deleted file mode 100644 index de0d798413e..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class C { - fun foo(@Suppress("warnings") p: String?? = "" as String) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt index de0d798413e..565feab0f61 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnParameter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { fun foo(@Suppress("warnings") p: String?? = "" as String) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.fir.kt deleted file mode 100644 index d3bbb1f20b1..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -class C { - @Suppress("warnings") - val foo: String?? = null as Nothing? -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt index d3bbb1f20b1..24c1a7eca14 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { @Suppress("warnings") val foo: String?? = null as Nothing? diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.fir.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.fir.kt deleted file mode 100644 index c79c536c4f8..00000000000 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -class C { - val foo: String? - @Suppress("warnings") - get(): String?? = null as Nothing? -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt index c79c536c4f8..adb190924dd 100644 --- a/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt +++ b/compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnPropertyAccessor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { val foo: String? @Suppress("warnings") diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.fir.kt deleted file mode 100644 index 2c812f9d52b..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.url = javaClass.url + "/" - javaClass.htmlFile += "1" - - javaClass.URL - javaClass.uRL - javaClass.HTMLFile - javaClass.hTMLFile - javaClass.htmlfile -} - -// FILE: JavaClass.java -public class JavaClass { - public String getURL() { return true; } - public void setURL(String value) { } - - public String getHTMLFile() { return true; } - public void setHTMLFile(String value) { } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.kt index 2c812f9d52b..b39857b5aeb 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/AbbreviationName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.url = javaClass.url + "/" diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.fir.kt deleted file mode 100644 index 5415a21cea7..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// FILE: KotlinFile.kt -import java.io.File - -fun foo(file: File) { - file.absolutePath.length -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.kt index 5415a21cea7..23ad9dd4341 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/CompiledClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt import java.io.File diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.fir.kt deleted file mode 100644 index 859abe3f688..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.something1 - javaClass.something2 - javaClass.somethingStatic - javaClass.somethingVoid - javaClass.ter -} - -// FILE: JavaClass.java -public class JavaClass { - public int getSomething1(int p) { return p; } - - public T getSomething2() { return null; } - - public static int getSomethingStatic() { return 1; } - - public void getSomethingVoid() { } - - public int getter() { return 1; } -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.kt index 859abe3f688..693934635bd 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FalseGetters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.something1 diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.fir.kt deleted file mode 100644 index d329ecc0d80..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: KotlinFile.kt - -interface C : A, B - -fun foo(c: C) { - c.setSomething(c.getSomething() + 1) - c.something++ -} - -// FILE: A.java -public interface A { - int getSomething(); -} - -// FILE: B.java -public interface B { - int getSomething(); - void setSomething(int value); -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.kt index d329ecc0d80..c3a810223fa 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/FromTwoBases.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt interface C : A, B diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.fir.kt deleted file mode 100644 index 71a600c59a2..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.something += "x" -} - -// FILE: JavaClass.java -public class JavaClass { - public T getSomething() { return null; } - public void setSomething(T value) { } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.kt index 71a600c59a2..5c33f037591 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GenericClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.something += "x" diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.fir.kt deleted file mode 100644 index cd35f02613d..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.a - javaClass.A -} - -// FILE: JavaClass.java -public class JavaClass { - public int getA() { return 1; } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.kt index cd35f02613d..7c275907316 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetA.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.a diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.fir.kt deleted file mode 100644 index 3bc634c4e43..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.something1++ - javaClass.something2++ -} - -// FILE: JavaClass.java -public class JavaClass { - public int getSomething1() { return 1; } - public void setSomething1(int value) { } - - public int getSomething2() { return 1; } - public JavaClass setSomething2(int value) { return this; } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.kt index 3bc634c4e43..bf17245c833 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/GetterAndSetter.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.something1++ diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.fir.kt deleted file mode 100644 index 182df416a0f..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.КакоеТоСвойство = javaClass.КакоеТоСвойство + 1 - javaClass.какоеТоСвойство - - javaClass.КУ - javaClass.ку -} - -// FILE: JavaClass.java -public class JavaClass { - public int getКакоеТоСвойство() { - return 0; - } - - public void setКакоеТоСвойство(int value) { - } - - public int getКУ() { - return 0; - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.kt index 182df416a0f..9c0e80f41e8 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyAscii.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.КакоеТоСвойство = javaClass.КакоеТоСвойство + 1 diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.fir.kt deleted file mode 100644 index 9d3bef5eabe..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.something = 1 -} - -// FILE: JavaClass.java -public class JavaClass { - public void setSomething(int value) { } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.kt index 9d3bef5eabe..80fa20c67a0 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterOnly.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.something = 1 diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.fir.kt deleted file mode 100644 index c106a07c6da..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: KotlinFile.kt - -fun foo(t: T) { - t.setSomething(t.getSomething() + 1) - t.something++ -} - -// FILE: A.java -public interface A { - int getSomething(); -} - -// FILE: B.java -public interface B extends A { - void setSomething(int value); -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.kt index c106a07c6da..377b4ec71a9 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeParameterReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(t: T) { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.fir.kt deleted file mode 100644 index 1bda1a5b3c0..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaInterface: JavaInterface) { - javaInterface.doIt(null, null) { } - javaInterface.doIt("", { }, null) -} - -// FILE: JavaInterface.java -public interface JavaInterface { - void doIt(String s, Runnable runnable1, Runnable runnable2); -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.kt index 1bda1a5b3c0..222676b147a 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PassNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaInterface: JavaInterface) { javaInterface.doIt(null, null) { } diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.fir.kt deleted file mode 100644 index fbff5e5273d..00000000000 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -PLATFORM_CLASS_MAPPED_TO_KOTLIN - -interface IBase : Map - -interface TestDerivedInterfaceHiding : IBase { - fun replace(key: String, value: String): String? -} - -interface TestDerivedInterfaceDefault : IBase { - fun replace(key: String, value: String): String? = TODO() -} - - diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.kt index fbff5e5273d..6e73d23001c 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/derivedInterfaces.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -PLATFORM_CLASS_MAPPED_TO_KOTLIN interface IBase : Map diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.fir.kt deleted file mode 100644 index a9199de4138..00000000000 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.fir.kt +++ /dev/null @@ -1,4 +0,0 @@ -// JAVAC_EXPECTED_FILE -class ControlFlowException : Exception("") { - fun fillInStackTrace() = this -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.kt index a9199de4138..34fc5a07f6b 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/fillInStackTrace.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JAVAC_EXPECTED_FILE class ControlFlowException : Exception("") { fun fillInStackTrace() = this diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.fir.kt deleted file mode 100644 index a06d4279cce..00000000000 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -PLATFORM_CLASS_MAPPED_TO_KOTLIN -// JAVAC_EXPECTED_FILE - -class MyHashMap : java.util.HashMap() { - fun getOrDefault(key: String, defaultValue: String): String = TODO() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.kt index a06d4279cce..56bffae9b0c 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/backwardCompatibility/hashMapGetOrDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -PLATFORM_CLASS_MAPPED_TO_KOTLIN // JAVAC_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.fir.kt deleted file mode 100644 index 9d060661f41..00000000000 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FULL_JDK - -import java.util.stream.* - -interface A : MutableCollection { - override fun removeIf(x: java.util.function.Predicate) = false -} - -fun foo(x: MutableList, y: A) { - x.removeIf { it.length > 0 } - y.removeIf { it.length > 0 } -} diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.kt index 9d060661f41..6b9bd90e2e7 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/removeIf.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK import java.util.stream.* diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.fir.kt deleted file mode 100644 index 11485e6d46e..00000000000 --- a/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// FILE: test.kt - -public interface Test { - fun test(): String { - return "123"; - } -} - -interface KTrait : Test { - fun ktest() { - super.test() - - test() - } -} - -class A : KTrait { - fun b() { - super.test() - - test() - } -} - diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.kt b/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.kt index 11485e6d46e..381c2e010f2 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/traitSuperCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: test.kt public interface Test { diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.fir.kt deleted file mode 100644 index a0eebd4d95f..00000000000 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.fir.kt +++ /dev/null @@ -1,51 +0,0 @@ -// Check that it works with inherited members -// -// DeeperBase DeeperInterface -// | | -// DeepBase DeepInterface -// \ / -// \/ -// DeepDerived -// - -open class DeeperBase { - open fun deeperBaseFun() {} - - open val deeperBaseProp: Int - get() = 333 -} - -open class DeepBase : DeeperBase() { -} - -interface DeeperInterface { - fun deeperInterfaceFun() {} -} - -interface DeepInterface : DeeperInterface { - fun deepInterfaceFun() {} -} - -class DeepDerived : DeepBase(), DeepInterface { - override fun deeperBaseFun() {} - - override val deeperBaseProp: Int - get() = 444 - - override fun deeperInterfaceFun() {} - override fun deepInterfaceFun() {} - - fun callsSuperDeeperBaseFun() { - super.deeperBaseFun() - } - - fun getsSuperDeeperBaseProp(): Int = - super.deeperBaseProp - - fun callsSuperInterfaceFuns() { - super.deeperInterfaceFun() - super.deepInterfaceFun() - super.deeperInterfaceFun() - super.deepInterfaceFun() - } -} diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.kt index a0eebd4d95f..a46ad6c88e4 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithDeeperHierarchies.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Check that it works with inherited members // // DeeperBase DeeperInterface diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.fir.kt deleted file mode 100644 index 5291a7dad0e..00000000000 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -open class GenericBaseClass { - open fun foo(x: T): T = x -} - -interface GenericBaseInterface { - fun bar(x: T): T = x -} - -class GenericDerivedClass : GenericBaseClass(), GenericBaseInterface { - override fun foo(x: T): T = super.foo(x) - override fun bar(x: T): T = super.bar(x) -} - -class SpecializedDerivedClass : GenericBaseClass(), GenericBaseInterface { - override fun foo(x: Int): Int = super.foo(x) - override fun bar(x: String): String = super.bar(x) -} - -class MixedDerivedClass : GenericBaseClass(), GenericBaseInterface { - override fun foo(x: Int): Int = super.foo(x) - override fun bar(x: T): T = super.bar(x) -} diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.kt index 5291a7dad0e..b69d5da87c6 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/unqualifiedSuperWithGenerics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class GenericBaseClass { open fun foo(x: T): T = x } diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.fir.kt deleted file mode 100644 index ba5f4f70298..00000000000 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -interface IWithToString { - override fun toString(): String -} - -class A : IWithToString { - // Should be Any#toString(), even though IWithToString defines an abstract toString. - override fun toString(): String = super.toString() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.kt index ba5f4f70298..38c2975daef 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodOfAnyOverridenInInterface.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IWithToString { override fun toString(): String } diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.fir.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.fir.kt deleted file mode 100644 index e61f5a4f19a..00000000000 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -interface IFoo - -interface IBar - -class A : IFoo, IBar { - // Unqualified 'super' should be resolved to 'Any'. - override fun equals(other: Any?): Boolean = super.equals(other) - override fun hashCode(): Int = super.hashCode() - override fun toString(): String = super.toString() -} diff --git a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.kt b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.kt index e61f5a4f19a..afa3f85d4f1 100644 --- a/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.kt +++ b/compiler/testData/diagnostics/tests/thisAndSuper/unqualifiedSuper/withMethodsOfAny.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IFoo interface IBar diff --git a/compiler/testData/diagnostics/tests/typealias/aliasesOnly.fir.kt b/compiler/testData/diagnostics/tests/typealias/aliasesOnly.fir.kt deleted file mode 100644 index 6d283e0cf15..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/aliasesOnly.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY - -typealias S = String - -class C { - typealias SS = String - typealias SF = (T) -> String -} diff --git a/compiler/testData/diagnostics/tests/typealias/aliasesOnly.kt b/compiler/testData/diagnostics/tests/typealias/aliasesOnly.kt index 6d283e0cf15..ca50ad796e0 100644 --- a/compiler/testData/diagnostics/tests/typealias/aliasesOnly.kt +++ b/compiler/testData/diagnostics/tests/typealias/aliasesOnly.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY typealias S = String diff --git a/compiler/testData/diagnostics/tests/typealias/classReference.fir.kt b/compiler/testData/diagnostics/tests/typealias/classReference.fir.kt deleted file mode 100644 index 33c74a0eb4a..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/classReference.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -typealias S = String - -val s = S::class diff --git a/compiler/testData/diagnostics/tests/typealias/classReference.kt b/compiler/testData/diagnostics/tests/typealias/classReference.kt index 33c74a0eb4a..a3cc2de70b4 100644 --- a/compiler/testData/diagnostics/tests/typealias/classReference.kt +++ b/compiler/testData/diagnostics/tests/typealias/classReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL typealias S = String val s = S::class diff --git a/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.fir.kt b/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.fir.kt deleted file mode 100644 index cc49eb2ad50..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -enum class MyEnum { A } - -typealias TestAlias = MyEnum - -val test1 = MyEnum.A -val test2 = TestAlias.A \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.kt b/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.kt index cc49eb2ad50..8048c1b31cc 100644 --- a/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.kt +++ b/compiler/testData/diagnostics/tests/typealias/enumEntryQualifier.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL enum class MyEnum { A } typealias TestAlias = MyEnum diff --git a/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.fir.kt deleted file mode 100644 index d1b1e45332e..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -val f: () -> Unit = {} - -typealias F = () -> Unit diff --git a/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.kt index d1b1e45332e..db7b1ac1e81 100644 --- a/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/functionTypeInTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val f: () -> Unit = {} typealias F = () -> Unit diff --git a/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.fir.kt b/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.fir.kt deleted file mode 100644 index fd683ffa156..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -class C(val x: T, val y: String) { - constructor(x: T): this(x, "") -} - -typealias GTC = C - -val test1 = GTC("", "") -val test2 = GTC("", "") -val test3 = GTC("") -val test4 = GTC("") diff --git a/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.kt index fd683ffa156..aba06bfe409 100644 --- a/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/genericTypeAliasConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C(val x: T, val y: String) { constructor(x: T): this(x, "") } diff --git a/compiler/testData/diagnostics/tests/typealias/import.fir.kt b/compiler/testData/diagnostics/tests/typealias/import.fir.kt deleted file mode 100644 index d370c3d0978..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/import.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY -// FILE: file1.kt -package package1 - -typealias S = String - -// FILE: file2.kt -package package2 - -typealias I = Int - -class Outer { - typealias A = Any -} - -// FILE: test.kt -package package3 - -import package1.* -import package2.I -import package2.Outer.A - -val testS: S = "" -val testI: I = 42 -val testA: A = Any() diff --git a/compiler/testData/diagnostics/tests/typealias/import.kt b/compiler/testData/diagnostics/tests/typealias/import.kt index d370c3d0978..933c64c6092 100644 --- a/compiler/testData/diagnostics/tests/typealias/import.kt +++ b/compiler/testData/diagnostics/tests/typealias/import.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY // FILE: file1.kt package package1 diff --git a/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.fir.kt b/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.fir.kt deleted file mode 100644 index a02955adc61..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: 1.kt -package something - -object N - -class WC { - companion object -} - -typealias T = N -typealias TWC = WC - -// FILE: 2.kt -import something.T -import something.TWC - -val test1 = T.hashCode() -val test2 = TWC.hashCode() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.kt b/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.kt index a02955adc61..7ee8615a494 100644 --- a/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.kt +++ b/compiler/testData/diagnostics/tests/typealias/importForTypealiasObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: 1.kt package something diff --git a/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.fir.kt b/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.fir.kt deleted file mode 100644 index 9486785b750..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: 1.kt -package bar - -typealias HostAlias = Host - -object Host { - fun foo() {} -} - -// FILE: 2.kt -import bar.HostAlias.foo - -fun test() { - foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.kt b/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.kt index 9486785b750..eb29413f66a 100644 --- a/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.kt +++ b/compiler/testData/diagnostics/tests/typealias/importFromTypeAliasObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: 1.kt package bar diff --git a/compiler/testData/diagnostics/tests/typealias/inGenerics.fir.kt b/compiler/testData/diagnostics/tests/typealias/inGenerics.fir.kt deleted file mode 100644 index 6ba006782bd..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/inGenerics.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -typealias MyString = String - -class Container(val x: T) - -typealias MyStringContainer = Container - -val ms: MyString = "MyString" - -val msn: MyString? = null - -val msc: MyStringContainer = Container(ms) -val msc1 = MyStringContainer(null) diff --git a/compiler/testData/diagnostics/tests/typealias/inGenerics.kt b/compiler/testData/diagnostics/tests/typealias/inGenerics.kt index f13914ae8b8..6c0136ab553 100644 --- a/compiler/testData/diagnostics/tests/typealias/inGenerics.kt +++ b/compiler/testData/diagnostics/tests/typealias/inGenerics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL typealias MyString = String class Container(val x: T) diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt deleted file mode 100644 index d0e84053c88..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY - -interface ICell { - val x: T -} - -class Cell(override val x: T): ICell - -open class Base { - typealias CT = Cell - inner class InnerCell(override val x: T): ICell -} - -class Derived : Base() { - val x1: InnerCell = InnerCell(42) - val x2: Base.InnerCell = InnerCell(42) - - val test1: CT = Cell(42) - val test2: Base.CT = Cell(42) -} diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt index d0e84053c88..e8236f87a47 100644 --- a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY interface ICell { diff --git a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.fir.kt b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.fir.kt deleted file mode 100644 index f1a2018e98d..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY - -class C { - inner class D - - typealias DA = D - typealias SDA = C.D - typealias TSDA = C.D - typealias TC = C - typealias SSDA = C<*>.D - typealias SSC = C<*> -} - -fun test1(x: C.DA) = x -fun test2(x: C.SDA) = x -fun test3(x: C.TSDA) = x -fun test4(x: C.TC) = x - -fun test5(x: C<*>.DA) = x -fun test6(x: C<*>.TSDA) = x -fun test7(x: C<*>.TC) = x - -fun test8(x: C.SSDA) = x -fun test9(x: C.SSC) = x \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.kt b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.kt index f1a2018e98d..b395df6be23 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerTypeAliasAsType2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY class C { diff --git a/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.fir.kt deleted file mode 100644 index bf998f4817c..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -typealias S = String - -fun test1(x: Any) = x is S -fun test2(x: Any) = x as S -fun test3(x: Any) = x as? S diff --git a/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.kt index bf998f4817c..480ecac60c2 100644 --- a/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL typealias S = String fun test1(x: Any) = x is S diff --git a/compiler/testData/diagnostics/tests/typealias/localTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/localTypeAlias.fir.kt deleted file mode 100644 index a7c55d93331..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/localTypeAlias.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY - -fun emptyList(): List = null!! - -fun foo() { - typealias LT = List - - val a: LT = emptyList() - - fun localFun(): LT { - typealias LLT = List - - val b: LLT = a - - return b - } - - localFun() -} diff --git a/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt index a7c55d93331..b82a38dc66a 100644 --- a/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/localTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY fun emptyList(): List = null!! diff --git a/compiler/testData/diagnostics/tests/typealias/methodReference.fir.kt b/compiler/testData/diagnostics/tests/typealias/methodReference.fir.kt deleted file mode 100644 index c0914863e45..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/methodReference.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -class C { - fun foo() {} -} - -typealias CA = C - -val cf = CA::foo diff --git a/compiler/testData/diagnostics/tests/typealias/methodReference.kt b/compiler/testData/diagnostics/tests/typealias/methodReference.kt index c0914863e45..630852a02f6 100644 --- a/compiler/testData/diagnostics/tests/typealias/methodReference.kt +++ b/compiler/testData/diagnostics/tests/typealias/methodReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { fun foo() {} } diff --git a/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.fir.kt b/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.fir.kt deleted file mode 100644 index e5ec2fb2f50..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY - -class Pair(val x1: T1, val x2: T2) - -class C { - typealias P2 = Pair -} - -val p1: C.P2 = Pair("", 1) diff --git a/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.kt b/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.kt index e5ec2fb2f50..cf159437453 100644 --- a/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.kt +++ b/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY class Pair(val x1: T1, val x2: T2) diff --git a/compiler/testData/diagnostics/tests/typealias/noRHS.fir.kt b/compiler/testData/diagnostics/tests/typealias/noRHS.fir.kt deleted file mode 100644 index f2598266905..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/noRHS.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -typealias - -typealias A1 - -typealias A2 = - \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/noRHS.kt b/compiler/testData/diagnostics/tests/typealias/noRHS.kt index f2598266905..6cb972210ab 100644 --- a/compiler/testData/diagnostics/tests/typealias/noRHS.kt +++ b/compiler/testData/diagnostics/tests/typealias/noRHS.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL typealias typealias A1 diff --git a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.fir.kt b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.fir.kt deleted file mode 100644 index 35fd6a5dd58..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -class C - -typealias CA = C - -val ca1: CA = C() -val ca2: CA> = C>() -val ca3: CA> = C>() -val ca4: CA = C() diff --git a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt index 35fd6a5dd58..6055989f76b 100644 --- a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C typealias CA = C diff --git a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.fir.kt b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.fir.kt deleted file mode 100644 index 65b7bc9ff00..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -typealias S = String -typealias SS = S -typealias SSS = SS - -val s1: SSS = "" -val s2: SSS? = null -val s3: List? = null -val s4: List?>? = null diff --git a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt index 65b7bc9ff00..b178ee34a62 100644 --- a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL typealias S = String typealias SS = S typealias SSS = SS diff --git a/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.fir.kt b/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.fir.kt deleted file mode 100644 index 4f98fe9a121..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -class NumCharSeq(val n: N, val m: M) - -typealias Test = NumCharSeq - -fun getN(t: Test<*, *>) = t.n -fun getM(t: Test<*, *>) = t.m diff --git a/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.kt b/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.kt index 4f98fe9a121..32fb9d2a7f8 100644 --- a/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.kt +++ b/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class NumCharSeq(val n: N, val m: M) typealias Test = NumCharSeq diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.fir.kt deleted file mode 100644 index 8945b180940..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class Pair(val x1: T1, val x2: T2) - -typealias P2 = Pair - -val test1: Pair = P2("", "") -val test1x1: String = test1.x1 -val test1x2: String = test1.x2 - -val test2: P2 = P2("", "") -val test2x1: String = test2.x1 -val test2x2: String = test2.x2 diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.kt index 8945b180940..7ed5cf84252 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Pair(val x1: T1, val x2: T2) typealias P2 = Pair diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.fir.kt deleted file mode 100644 index e6a4d0eae5b..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -class Cell(val x : T) -class Pair(val x1: T1, val x2: T2) - -typealias CIntA = Cell -typealias CA = Cell -typealias PIntIntA = Pair -typealias PA = Pair -typealias P2A = Pair - -val test1 = CIntA(10) -val test2 = CA(10) -val test3 = CA(10) -val test4 = PIntIntA(10, 20) -val test5 = PA(10, 20) -val test6 = PA(10, 20) -val test7 = P2A(10, 20) -val test8 = P2A(10, 20) - diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.kt index e6a4d0eae5b..78d88ce75c9 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Cell(val x : T) class Pair(val x1: T1, val x2: T2) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.fir.kt deleted file mode 100644 index 7567522a5b3..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -open class Foo - -typealias FooStr = Foo - -val test = object : FooStr() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.kt index 7567522a5b3..180430f24e4 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasInAnonymousObjectType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Foo typealias FooStr = Foo diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.fir.kt deleted file mode 100644 index 285064d139a..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -typealias Processor = (number: Int) -> Unit -typealias Handler = (String) -> Processor? - -fun x(handler: Handler) { - return handler("a")!!(1) -} diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.kt index 285064d139a..d461c8d5d4d 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasNotNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL typealias Processor = (number: Int) -> Unit typealias Handler = (String) -> Processor? diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasObject.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasObject.fir.kt deleted file mode 100644 index db2a3b2a800..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasObject.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -object AnObject { - val ok = "OK" - fun foo() = "OK" -} - -typealias TestObject = AnObject - -val test11: AnObject = TestObject -val test12: TestObject = TestObject -val test13: String = TestObject.ok -val test14: String = TestObject.foo() - -typealias TestObject2 = TestObject - -val test21: AnObject = TestObject2 -val test22: TestObject2 = TestObject2 -val test23: String = TestObject2.ok -val test24: String = TestObject2.foo() - -class ClassWithCompanion { - companion object { - val ok = "OK" - fun foo() = "OK" - } -} - -typealias TestCWC = ClassWithCompanion - -val test35: ClassWithCompanion.Companion = TestCWC -val test36 = TestCWC -val test37: String = TestCWC.ok -val test38: String = TestCWC.foo() diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasObject.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasObject.kt index db2a3b2a800..9dca25494ff 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasObject.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasObject.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL object AnObject { val ok = "OK" fun foo() = "OK" diff --git a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.fir.kt b/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.fir.kt deleted file mode 100644 index 5d30894a70d..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -@Target(AnnotationTarget.TYPE) -annotation class Ann1 - -@Target(AnnotationTarget.TYPE) -annotation class Ann2 - -typealias Alias1 = @Ann1 String -typealias Alias2 = @Ann2 Alias1 -fun test1(a: Alias2) = a - -// NB @ExtensionFunctionType on non-functional type is not an error -typealias Alias3 = @ExtensionFunctionType Alias1 -fun test2(a: Alias3) = a - -typealias LA1 = List<@Ann2 Alias1> -fun test3(la1: LA1) = la1 diff --git a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.kt b/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.kt index 5d30894a70d..1b617caffd1 100644 --- a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.kt +++ b/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.TYPE) annotation class Ann1 diff --git a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.fir.kt b/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.fir.kt deleted file mode 100644 index 1f635bb621a..00000000000 --- a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -@Target(AnnotationTarget.TYPE) -annotation class Ann1 - -@Target(AnnotationTarget.TYPE) -annotation class Ann2 - -class C - -typealias CA = C<@Ann1 T> - -fun test(x: CA<@Ann2 Int>) = x \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.kt b/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.kt index 1f635bb621a..003d7512657 100644 --- a/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.kt +++ b/compiler/testData/diagnostics/tests/typealias/typealiasRhsAnnotationsInArguments.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.TYPE) annotation class Ann1 diff --git a/compiler/testData/diagnostics/tests/varargs/kt1781.fir.kt b/compiler/testData/diagnostics/tests/varargs/kt1781.fir.kt deleted file mode 100644 index f34215e5342..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/kt1781.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: kotlin.kt -fun foo() { - JavaClass() - JavaClass("") -} - -// FILE: JavaClass.java - -public class JavaClass { - public JavaClass() { } - - public JavaClass(String... ss) { } -} diff --git a/compiler/testData/diagnostics/tests/varargs/kt1781.kt b/compiler/testData/diagnostics/tests/varargs/kt1781.kt index f34215e5342..12d9edf68c0 100644 --- a/compiler/testData/diagnostics/tests/varargs/kt1781.kt +++ b/compiler/testData/diagnostics/tests/varargs/kt1781.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: kotlin.kt fun foo() { JavaClass() diff --git a/compiler/testData/diagnostics/tests/varargs/kt1835.fir.kt b/compiler/testData/diagnostics/tests/varargs/kt1835.fir.kt deleted file mode 100644 index f55f90935aa..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/kt1835.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: JavaClass.java -public class JavaClass { - void from(String s) {} - void from(String... s) {} -} - -// FILE: kotlin.kt -fun main() { - JavaClass().from() - JavaClass().from("") - JavaClass().from("", "") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/kt1835.kt b/compiler/testData/diagnostics/tests/varargs/kt1835.kt index f55f90935aa..48dfc5668d3 100644 --- a/compiler/testData/diagnostics/tests/varargs/kt1835.kt +++ b/compiler/testData/diagnostics/tests/varargs/kt1835.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: JavaClass.java public class JavaClass { void from(String s) {} diff --git a/compiler/testData/diagnostics/tests/varargs/kt2163.fir.kt b/compiler/testData/diagnostics/tests/varargs/kt2163.fir.kt deleted file mode 100644 index de27add96ab..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/kt2163.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun printAll(vararg a : Any) {} - -fun main(args: Array) { - printAll(*args) // Shouldn't be an error -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/kt2163.kt b/compiler/testData/diagnostics/tests/varargs/kt2163.kt index de27add96ab..4c61e24dbdd 100644 --- a/compiler/testData/diagnostics/tests/varargs/kt2163.kt +++ b/compiler/testData/diagnostics/tests/varargs/kt2163.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun printAll(vararg a : Any) {} diff --git a/compiler/testData/diagnostics/tests/varargs/kt422.fir.kt b/compiler/testData/diagnostics/tests/varargs/kt422.fir.kt deleted file mode 100644 index fa5791cae47..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/kt422.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// KT-422 Tune literal typing rules so that varargs overloaded by primitive types work - -fun foo(vararg t : T) = t -fun foo(vararg a: Int) = a -fun foo(vararg a: Long) = a - -fun test() { - foo(1, 2, 3) // Error, but should be foo of ints -} - -fun array(vararg elements : T) = elements -fun array(vararg elements : Int) = elements - -fun test1() { - array("A", "A") - array(1, 1) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/kt422.kt b/compiler/testData/diagnostics/tests/varargs/kt422.kt index fa5791cae47..df2d3c49ad5 100644 --- a/compiler/testData/diagnostics/tests/varargs/kt422.kt +++ b/compiler/testData/diagnostics/tests/varargs/kt422.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-422 Tune literal typing rules so that varargs overloaded by primitive types work fun foo(vararg t : T) = t diff --git a/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.fir.kt b/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.fir.kt deleted file mode 100644 index 95fc2e692d3..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun bar(vararg a: String) {} - -fun test2(a: Array, b: Array) { - bar(*a) - bar(*b) - bar("", *a, *b, "") -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.kt b/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.kt index 95fc2e692d3..ae0d7cda8e1 100644 --- a/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.kt +++ b/compiler/testData/diagnostics/tests/varargs/varargsAndOut2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun bar(vararg a: String) {} diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.fir.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.fir.kt deleted file mode 100644 index d46d0e62dc8..00000000000 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -internal abstract class Test { - private/*private to this*/ final fun foo(): I { - throw Exception() - } - - private/*private to this*/ final val i: I get() = foo() -} diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.kt index d46d0e62dc8..f10391fd5d1 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/Abstract.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL internal abstract class Test { private/*private to this*/ final fun foo(): I { throw Exception() diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.fir.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.fir.kt deleted file mode 100644 index 486f11c43f1..00000000000 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -fun getT(): T = null!! - -class A(init: I) { - private val i: I - - init { - i = getT() - } - - private var i2 = i - private val i3: I - - private var i4 = getT() - - init { - i2 = getT() - i3 = init - i4 = i3 - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.kt index 486f11c43f1..e2e6c3e92a8 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/ValReassigned.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun getT(): T = null!! class A(init: I) { diff --git a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.fir.kt b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.fir.kt deleted file mode 100644 index cc1c5c9db55..00000000000 --- a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -fun foo(a: Int) { - @ann - when (a) { - 1 -> {} - } -} - -annotation class ann diff --git a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt index cc1c5c9db55..9b4ffaea195 100644 --- a/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt +++ b/compiler/testData/diagnostics/tests/when/AnnotatedWhenStatement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(a: Int) { @ann when (a) { diff --git a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.fir.kt b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.fir.kt deleted file mode 100644 index 4683fbbb7b2..00000000000 --- a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// EA-68871: empty when condition -fun foo(arg: Int): Int { - when (arg) { - 0 -> return 0 - -> return 4 - else -> return -1 - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt index 4683fbbb7b2..ee037778742 100644 --- a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt +++ b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // EA-68871: empty when condition fun foo(arg: Int): Int { when (arg) { diff --git a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.fir.kt b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.fir.kt deleted file mode 100644 index 9746ea53b58..00000000000 --- a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// EA-68871: empty when condition -enum class My { FIRST, SECOND } -fun foo(arg: My): Int { - when (arg) { - My.FIRST -> return 0 - -> return 4 - else -> return -1 - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt index 9746ea53b58..5f76624fbbc 100644 --- a/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt +++ b/compiler/testData/diagnostics/tests/when/EmptyConditionWithExpressionEnum.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // EA-68871: empty when condition enum class My { FIRST, SECOND } fun foo(arg: My): Int { diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.fir.kt deleted file mode 100644 index fc65d061fce..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// See also: KT-3743 -fun foo(arg: Boolean): String { - // Must be exhaustive - return when(arg) { - true -> "truth" - false -> "falsehood" - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt index fc65d061fce..48908f00e38 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBoolean.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See also: KT-3743 fun foo(arg: Boolean): String { // Must be exhaustive diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.fir.kt deleted file mode 100644 index 3ac5e9812b7..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -fun foo(arg: Boolean): String { - // Must be exhaustive - return when(arg) { - (true) -> "truth" - ((false)) -> "falsehood" - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt index 3ac5e9812b7..32fcf43d05f 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanBrackets.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(arg: Boolean): String { // Must be exhaustive return when(arg) { diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.fir.kt deleted file mode 100644 index 43d4890652b..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// See also: KT-3743 -fun foo(arg: Boolean): String { - // Must be exhaustive - return when(arg) { - 2 == 2 -> "truth" - 2 == 1 -> "falsehood" - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt index 43d4890652b..a74eac28612 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanComplex.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See also: KT-3743 fun foo(arg: Boolean): String { // Must be exhaustive diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.fir.kt deleted file mode 100644 index dfb530e9641..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// See also: KT-3743 -fun foo(arg: Boolean?): String { - // Must be exhaustive - return when(arg) { - true -> "truth" - false -> "falsehood" - null -> "unknown" - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt index dfb530e9641..8a757837941 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustiveBooleanNullable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See also: KT-3743 fun foo(arg: Boolean?): String { // Must be exhaustive diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.fir.kt deleted file mode 100644 index 6820a883e59..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// See KT-6399: exhaustive whens on platform enums - -// FILE: J.java - -import org.jetbrains.annotations.*; - -public enum J { - A, B; - - @NotNull public static J create() { - return J.A; - } -} - -// FILE: K.kt - -fun foo(): Int { - // When is exhaustive (count a platform enum as a special case) - return when (J.create()) { - J.A -> 1 - J.B -> 2 - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt index 6820a883e59..c8c063e5548 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumAnnotated.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-6399: exhaustive whens on platform enums // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.fir.kt deleted file mode 100644 index bd311096cf2..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// See KT-6399: exhaustive whens on platform enums - -// FILE: J.java - -public enum J { - A, B; - - public static J create() { - return J.A; - } -} - -// FILE: K.kt - -fun foo(): Int { - return when (J.create()) { - J.A -> 1 - J.B -> 2 - else -> 0 - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt index bd311096cf2..ae4fe9423c9 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumElse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-6399: exhaustive whens on platform enums // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.fir.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.fir.kt deleted file mode 100644 index c809bee2c2b..00000000000 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// See KT-6399: exhaustive whens on platform enums - -// FILE: J.java - -public enum J { - A, B; - - public static J create() { - return J.A; - } -} - -// FILE: K.kt - -fun foo(): Int { - // When is exhaustive including null - return when (J.create()) { - J.A -> 1 - J.B -> 2 - null -> 0 - } -} diff --git a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt index c809bee2c2b..1fcd73bf120 100644 --- a/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt +++ b/compiler/testData/diagnostics/tests/when/ExhaustivePlatformEnumNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-6399: exhaustive whens on platform enums // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.fir.kt b/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.fir.kt deleted file mode 100644 index 000a829fa71..00000000000 --- a/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun foo(x: Int) { - when (x) { - 2 -> {} - 3 -> {} - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt b/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt index 000a829fa71..54e19bc0930 100644 --- a/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt +++ b/compiler/testData/diagnostics/tests/when/NoElseWhenStatement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(x: Int) { when (x) { 2 -> {} diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.fir.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.fir.kt deleted file mode 100644 index 673943fa385..00000000000 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// Base for KT-6227 -enum class X { A, B, C, D } - -fun foo(arg: X): String { - val res: String - when (arg) { - X.A -> res = "A" - X.B -> res = "B" - else -> res = "CD" - } - return res -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt index 673943fa385..cdf60606abc 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningElse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Base for KT-6227 enum class X { A, B, C, D } diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.fir.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.fir.kt deleted file mode 100644 index a71a3c99564..00000000000 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// Base for KT-6227 -enum class X { A, B, C, D } - -fun foo(arg: X?): String { - var res = "XXX" - // Should we report something here? Probably not, null is not an enum entry - when (arg) { - X.A -> res = "A" - X.B -> res = "B" - X.C -> res = "C" - X.D -> res = "D" - } - return res -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt index a71a3c99564..674565a60b0 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Base for KT-6227 enum class X { A, B, C, D } diff --git a/compiler/testData/diagnostics/tests/when/kt10811.fir.kt b/compiler/testData/diagnostics/tests/when/kt10811.fir.kt deleted file mode 100644 index e99415e09a4..00000000000 --- a/compiler/testData/diagnostics/tests/when/kt10811.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -interface Maybe -class Some(val value: T) : Maybe -class None : Maybe - -fun none() : None = TODO() - -fun test1() : Maybe = if (true) none() else Some("") - -fun test2() : Maybe = when { - true -> none() - else -> Some("") -} - -fun test3() : Maybe = when { - true -> none() - else -> Some("") -} - -fun test4() : Maybe { - when ("") { - "a" -> return none() - else -> return Some("") - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/kt10811.kt b/compiler/testData/diagnostics/tests/when/kt10811.kt index e99415e09a4..82041313430 100644 --- a/compiler/testData/diagnostics/tests/when/kt10811.kt +++ b/compiler/testData/diagnostics/tests/when/kt10811.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface Maybe class Some(val value: T) : Maybe class None : Maybe diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.fir.kt deleted file mode 100644 index 43f33af1a4b..00000000000 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +VariableDeclarationInWhenSubject -// !DIAGNOSTICS: -UNUSED_VARIABLE - -fun foo(): Any = 42 - -fun test(x: Any) { - val z1 = when (val y = foo()) { - 42 -> "Magic: $y, $x" - else -> { - "Not magic: $y, $x" - } - } - val z2 = "Anyway, it was $y" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.kt index 43f33af1a4b..f8a77eae085 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/invisibleOutsideOfWhen.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +VariableDeclarationInWhenSubject // !DIAGNOSTICS: -UNUSED_VARIABLE diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.fir.kt deleted file mode 100644 index 82c12f2fa0d..00000000000 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +VariableDeclarationInWhenSubject -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - - -fun testNoSubjectVariableName(x: Int?) { - val y = when (val = 42) { - 0 -> "0" - else -> "not 0" - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.kt index 82c12f2fa0d..ff14b1d8fa3 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/noSubjectVariableName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +VariableDeclarationInWhenSubject // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.fir.kt deleted file mode 100644 index 0e554ba12f9..00000000000 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// !LANGUAGE: +VariableDeclarationInWhenSubject - -fun test(data: String) = - when (data.length) { - 0 -> -1 - else -> 42 - } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.kt index 0e554ba12f9..4c0b09da2d2 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/softModifierName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +VariableDeclarationInWhenSubject fun test(data: String) = diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.fir.kt deleted file mode 100644 index ed1765401ca..00000000000 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !LANGUAGE: +VariableDeclarationInWhenSubject -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER - -fun test(x: Any) { - when (val y = x) { - is String -> {} - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt index ed1765401ca..2760d979684 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/subjectVariableInIsPattern.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +VariableDeclarationInWhenSubject // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.fir.kt deleted file mode 100644 index 013dac39c06..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -package test -import kotlin.reflect.KClass - -annotation class AnnClass(val a: KClass<*>) - -class MyClass { - - @AnnClass(MyClass::class) - companion object { - } - -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt index 013dac39c06..01aa83d3acf 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/ClassObjectAnnotatedWithItsKClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package test import kotlin.reflect.KClass diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.fir.kt deleted file mode 100644 index 30742ed854c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -class C { - val plainField: Int = 1 - @delegate:Transient - val lazy by lazy { 1 } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.kt index 30742ed854c..bd49864b92c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/TransientOnDelegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C { val plainField: Int = 1 @delegate:Transient diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.fir.kt deleted file mode 100644 index 464d1bced00..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: A.java -public @interface A { - double b(); - Class x1(); - int a(); - String value(); - Class x(); - Class x2(); -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt index 464d1bced00..8e90f48188f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { double b(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.fir.kt deleted file mode 100644 index 97e7759bf6c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FILE: A.java -public @interface A { - double b(); - Class x1(); - int a(); - Class x(); - Class x2(); -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt index 97e7759bf6c..be0af4f51d3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithoutValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { double b(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.fir.kt deleted file mode 100644 index 7689996da60..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: A.java -public @interface A { - String[] value(); -} - -// FILE: b.kt -@A("1", "2", "3") fun test1() {} - -@A("4") fun test2() {} - -@A(*arrayOf("5", "6"), "7") fun test3() {} - -@A() fun test4() {} - -@A fun test5() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt index 7689996da60..56dcc137754 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { String[] value(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.fir.kt deleted file mode 100644 index 7617ba14f5c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// FILE: A.java -public @interface A { - String[] value() default {"abc", "cde"}; -} - -// FILE: b.kt -@A("1", "2", "3") fun test1() {} - -@A("4") fun test2() {} - -@A(*arrayOf("5", "6"), "7") fun test3() {} - -@A() fun test4() {} - -@A fun test5() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt index 7617ba14f5c..a4c78b1b8f2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayWithDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { String[] value() default {"abc", "cde"}; diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.fir.kt deleted file mode 100644 index f315401b9ec..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// FILE: A.java -public @interface A { - Class arg(); -} - -// FILE: b.kt -@A(arg = String::class) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt index f315401b9ec..9394908ea49 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/arg.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class arg(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.fir.kt deleted file mode 100644 index 8c63da99041..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: A.java -public @interface A { - Class arg(); - int x() default 1; -} - -// FILE: b.kt -@A(arg = String::class) class MyClass1 -@A(arg = String::class, x = 2) class MyClass2 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt index 8c63da99041..05fd5c237c0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argAndOtherDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class arg(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.fir.kt deleted file mode 100644 index df2e3af5c26..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// FILE: A.java -public @interface A { - Class[] arg(); -} - -// FILE: b.kt -@A(arg = arrayOf(String::class, Int::class)) class MyClass diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt index df2e3af5c26..a86007296e3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argArray.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class[] arg(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.fir.kt deleted file mode 100644 index 4871b8a02be..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FILE: A.java -public @interface A { - Class arg() default Integer.class; -} - -// FILE: b.kt -@A(arg = String::class) class MyClass1 -@A class MyClass2 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt index 4871b8a02be..84091215473 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class arg() default Integer.class; diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.fir.kt deleted file mode 100644 index 3afac3724b5..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: A.java -public @interface A { - Class arg() default Integer.class; - int x(); -} - -// FILE: b.kt -@A(arg = String::class, x = 4) class MyClass2 -@A(x = 5) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt index 3afac3724b5..909837f834c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/argWithDefaultAndOther.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class arg() default Integer.class; diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.fir.kt deleted file mode 100644 index aa9efe04fa6..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FILE: A.java -public @interface A { - Class arg1(); - Class arg2(); -} - -// FILE: b.kt -@A(arg1 = String::class, arg2 = Int::class) class MyClass diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt index aa9efe04fa6..9d3c981cca4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/twoArgs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class arg1(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.fir.kt deleted file mode 100644 index ffd1adc3510..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FILE: A.java -public @interface A { - Class value(); -} - -// FILE: b.kt -@A(String::class) class MyClass1 -@A(value = String::class) class MyClass2 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt index ffd1adc3510..eb71afcef5a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/value.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class value(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.fir.kt deleted file mode 100644 index 35a0ee2d2ae..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// FILE: A.java -public @interface A { - Class value(); - int x() default 1; -} - -// FILE: b.kt -@A(String::class) class MyClass1 -@A(value = String::class) class MyClass2 - -@A(String::class, x = 2) class MyClass3 -@A(value = String::class, x = 4) class MyClass4 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt index 35a0ee2d2ae..9d59257039c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueAndOtherDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class value(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.fir.kt deleted file mode 100644 index 4fb56532c42..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: A.java -public @interface A { - Class[] value(); -} - -// FILE: b.kt -@A(String::class, Int::class) class MyClass1 -@A(*arrayOf(String::class, Int::class)) class MyClass2 -@A(value = [String::class, Int::class]) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt index 4fb56532c42..d91bae71a29 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueArray.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class[] value(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.fir.kt deleted file mode 100644 index 50c72be5673..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: A.java -public @interface A { - Class value() default Integer.class; -} - -// FILE: b.kt -@A(String::class) class MyClass1 -@A(value = String::class) class MyClass2 -@A class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt index 50c72be5673..f3da34bc2e2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class value() default Integer.class; diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.fir.kt deleted file mode 100644 index 465a8f35e3d..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FILE: A.java -public @interface A { - Class value() default Integer.class; - int x(); -} - -// FILE: b.kt -@A(String::class, x = 2) class MyClass1 -@A(value = String::class, x = 4) class MyClass2 -@A(x = 5) class MyClass3 diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt index 465a8f35e3d..de06c897309 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/javaAnnotationsWithKClassParameter/valueWithDefaultAndOther.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public @interface A { Class value() default Integer.class; diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.fir.kt deleted file mode 100644 index 5422d3c7004..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -@file:JvmName("SomeName") - -@JvmField -val c = 4 - -@JvmField -var g = 5 - -class C { - @JvmField - var g = 5 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.kt index 5422d3c7004..264b18dc941 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmField/inSingleFileFacade.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @file:JvmName("SomeName") @JvmField diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.fir.kt deleted file mode 100644 index 948fc6161b0..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -import kotlin.reflect.KClass - -open class A -class B1 : A() -class B2 : A() - -annotation class Ann1(val arg: Array>) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.kt index 948fc6161b0..04b66096e33 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/kClass/kClassOutArrayInAnnotationsOutVariance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.reflect.KClass open class A diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.fir.kt deleted file mode 100644 index be23e84ff89..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -annotation class Ann(val x: Int, val value: String, val y: Double) - -@Ann(value = "a", x = 1, y = 1.0) fun foo1() {} -@Ann(2, "b", 2.0) fun foo2() {} -@Ann(3, "c", y = 2.0) fun foo3() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt index be23e84ff89..0e37d69a86c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class Ann(val x: Int, val value: String, val y: Double) @Ann(value = "a", x = 1, y = 1.0) fun foo1() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.fir.kt deleted file mode 100644 index e460ad515b3..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// FILE: TargetUse.java - -import java.lang.annotation.Target; - -public class TargetUse { - public static String foo(kotlin.annotation.Target aTarget) { - return aTarget.toString(); - } - - public static String bar(Target aTarget) { - return aTarget.toString(); - } -} - -// FILE: TargetUse.kt - -import java.lang.annotation.Target as JTarget - -fun fooUse(aTarget: Target): String = TargetUse.foo(aTarget) - -fun barUse(aTarget: JTarget): String = TargetUse.bar(aTarget) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.kt index e460ad515b3..70d5881aec4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/targetuse.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: TargetUse.java import java.lang.annotation.Target; diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.fir.kt deleted file mode 100644 index 157c016709d..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.* - -inline fun myRun(block: () -> T): T { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - return block() -} - -fun functionWithExpressionBody(x: Int): Boolean = myRun { - if (x == 0) return true - if (x == 1) return false - return functionWithExpressionBody(x - 2) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.kt index 157c016709d..d1cc0e68604 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/expressionBody.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.fir.kt deleted file mode 100644 index 9c26e6a7f3b..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.* - -inline fun myRun(block: () -> Unit): Unit { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - return block() -} - -inline fun unknownRun(block: () -> Unit) { block() } - -fun foo() { - val x: Int - myRun { - unknownRun { println("shouldn't change anything") } - x = 42 - } - println(x) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.kt index 9c26e6a7f3b..1f3cf12f8f1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/irrelevantUnknownClosure.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.fir.kt deleted file mode 100644 index a33f7f59b4d..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.* - -inline fun T.myLet(block: (T) -> R): R { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - return block(this) -} - - -fun nonLocalReturnWithElvis(x: Int?): Int? { - x?.myLet { return 42 } - return x?.inc() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.kt index a33f7f59b4d..91c9d7984c9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nonLocalReturn.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.fir.kt deleted file mode 100644 index d7ec16a537e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.fir.kt +++ /dev/null @@ -1,42 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.* - -fun myRun(block: () -> T): T { - contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - return block() -} - -fun definiteVarInitialization() { - var x: Int - myRun { x = 42 } - x.inc() -} - -fun definiteVarReassignment() { - var x: Int - myRun { x = 42 } - x.inc() - myRun { x = 43 } - x.inc() - x = 44 - x.inc() -} - -fun nestedVarInitialization() { - var x: Int - myRun { myRun { myRun { x = 42 } } } - x.inc() - myRun { myRun { myRun { x = 42 } } } -} - - -fun notAnExpression() { - var x: Int = 0 - myRun { if (true) x = 42 } - x.inc() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.kt index d7ec16a537e..9178a564403 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/initialization/exactlyOnce/varDefiniteInitalization.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt deleted file mode 100644 index 1c03aa81914..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt +++ /dev/null @@ -1,42 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -package my - -// Accepts block, can't be distinguished from kotlin.contract without resolve -fun contract(block: () -> Unit) {} - -// Accepts int, potentially can be distinguished from kotlin.contract by PSI, -// but as of Kotlin 1.3.0, we don't do that -fun contract(i: Int) {} - -fun doStuff() {} - -class SomeClass { - - fun contract() {} - - fun callMemberContractWithThis() { - this.contract() - } - - fun callMemberContractWithoutThis() { - contract() - } - - fun callTopLevelSamePsiInMember() { - contract { } - } -} - -fun callTopLevelSamePsi() { - contract { } -} - -fun callTopLevelDifferentPsi() { - contract(42) -} - -fun callTopLevelSamePsiNotFirstStatement() { - doStuff() - contract { } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.kt index 1c03aa81914..6dc12919cc4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER package my diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt deleted file mode 100644 index 1b57f6a6d0f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.fir.kt +++ /dev/null @@ -1,39 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !LANGUAGE: +UseReturnsEffect -// Issue: KT-26386 - -fun myRun(block: () -> Unit) { - block() -} - -fun contract(block: () -> Unit) { - block() -} - -fun case_1(): Boolean? { - contract { case_1() } - return null -} - -fun case_2(): Boolean? { - contract { case_3() } - return null -} - -fun case_3(): Boolean? { - contract { case_2() } - return null -} - -fun case4() { - contract { - myRun { - val s: String - run { - s = "hello" - } - s.length - } - } -} - diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.kt index 1b57f6a6d0f..a7dc2dd7ebd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/recursiveContractCustomContractFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !LANGUAGE: +UseReturnsEffect // Issue: KT-26386 diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.fir.kt deleted file mode 100644 index d47cf86de0f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts -// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER - -import kotlin.contracts.InvocationKind - -inline fun foo(block: () -> Unit) { - kotlin.contracts.contract { - callsInPlace(block, InvocationKind.EXACTLY_ONCE) - } - block() -} - -fun main() { - val x: Int - foo { - x = 42 - } - println(x) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.kt index d47cf86de0f..57ec1f9051f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/fqnContractFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts // !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.fir.kt deleted file mode 100644 index 4942fcb9448..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// See KT-28847 - -class Foo(val str: String?) { - val first = run { - str.isNullOrEmpty() - second - } - - val second = str.isNullOrEmpty() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.kt index 4942fcb9448..e699a339bf7 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/rewriteAtSliceFunctor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-28847 class Foo(val str: String?) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.fir.kt deleted file mode 100644 index 7af925daf1b..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !LANGUAGE: +ReadDeserializedContracts +UseCallsInPlaceEffect - -fun test(lock: Any) { - val x: Int - - synchronized(lock) { - x = 42 - } - - x.inc() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.kt index 7af925daf1b..017e8ac7bd5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/synchronize.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ReadDeserializedContracts +UseCallsInPlaceEffect fun test(lock: Any) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.fir.kt deleted file mode 100644 index 96916e514e9..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect -// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts - -import kotlin.contracts.* - -fun Any.nullWhenString(): Any? { - contract { - returns(null) implies (this@nullWhenString is String) - } - return if (this is String) null else this -} - -fun test(x: Int?) { - if (x?.nullWhenString() == null) { - x.length - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt index 96916e514e9..df863632c68 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/safecallAndReturnsNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect // !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts diff --git a/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.fir.kt deleted file mode 100644 index df951011425..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !API_VERSION: 1.2 - -import java.io.InputStream - -fun InputStream.test() { - readBytes() - - readBytes(1) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.kt b/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.kt index df951011425..c25f9897095 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/deprecated/noDeprecationOnReadBytes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !API_VERSION: 1.2 import java.io.InputStream diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.fir.kt deleted file mode 100644 index 2af8869417b..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -import kotlin.properties.ReadWriteProperty -import kotlin.properties.Delegates - -class C { - val `x$delegate`: ReadWriteProperty? = null - val x: String? by Delegates.notNull() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.kt index 2af8869417b..c09a0c3b024 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/delegatedProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.properties.ReadWriteProperty import kotlin.properties.Delegates diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.fir.kt deleted file mode 100644 index 6add6273f2c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -@JvmName("bar") -fun foo(a: Any) {} - -fun Any.foo() {} - -@JvmName("barInt") -fun bar(x: List) {} - -@JvmName("barStr") -fun bar(x: List) {} - -class C { - var rwProp: Int - @JvmName("get_rwProp") - get() = 0 - @JvmName("set_rwProp") - set(v) {} - - fun getRwProp(): Int = 123 - fun setRwProp(v: Int) {} -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.kt index 6add6273f2c..5a1c9e7fd65 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/jvmNames.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER @JvmName("bar") fun foo(a: Any) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt deleted file mode 100644 index 8b4d5883db4..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: foo/A.java - -package foo; - -public class A { - private static void foo(int s) {} - static void bar(double s) {} -} - -// FILE: K.kt -import foo.A - -open class K : A() { - companion object { - @JvmStatic - fun foo(i: Int) {} - @JvmStatic - fun bar(d: Double) {} - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt index 8b4d5883db4..d64515be706 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/duplicateJvmSignature/statics/kotlinMembersVsJavaNonVisibleStatics.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: foo/A.java diff --git a/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.fir.kt deleted file mode 100644 index a4e9d5b483f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -fun foo(x: Int?) { - // Both parts of the Elvis should be alive, see KT-7936 - x?.let { - smth() - }?: orElse() -} - -fun smth() {} -fun orElse() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.kt b/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.kt index a4e9d5b483f..e8fa491c355 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(x: Int?) { // Both parts of the Elvis should be alive, see KT-7936 x?.let { diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.fir.kt deleted file mode 100644 index cef19037bac..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn -// FILE: api.kt - -package api - -@RequiresOptIn(level = RequiresOptIn.Level.WARNING) -annotation class ExperimentalAPI - -interface I - -@ExperimentalAPI -class Impl : I - -// FILE: usage.kt - -package usage - -import api.* - -open class Base(val i: I) - -@OptIn(ExperimentalAPI::class) -class Derived : Base(Impl()) - -@OptIn(ExperimentalAPI::class) -class Delegated : I by Impl() - -@OptIn(ExperimentalAPI::class) -val delegatedProperty by Impl() -operator fun I.getValue(x: Any?, y: Any?) = null diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.kt index cef19037bac..bed56f97ad1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/bodyUsages.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn // FILE: api.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.fir.kt deleted file mode 100644 index 09eaf8dff8e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn -// !EXPERIMENTAL: api.ExperimentalAPI -// MODULE: api -// FILE: api.kt - -package api - -@RequiresOptIn -annotation class ExperimentalAPI - -@ExperimentalAPI -fun function(): String = "" - -// MODULE: usage(api) -// FILE: usage.kt - -package usage - -import api.* - -fun use() { - function() -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt index 09eaf8dff8e..b39f625ac4a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn // !EXPERIMENTAL: api.ExperimentalAPI // MODULE: api diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.fir.kt deleted file mode 100644 index bcfdc99323b..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn - -package test.abc - -@RequiresOptIn -annotation class E - -@OptIn(test.abc.E::class) -fun f() {} - -@test.abc.E -fun g() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.kt index bcfdc99323b..4ce54e29715 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/fullFqNameUsage.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn package test.abc diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.fir.kt deleted file mode 100644 index 4b18824c5bc..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.fir.kt +++ /dev/null @@ -1,27 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn -// FILE: api.kt - -package feature.experimental.self - -@RequiresOptIn -annotation class ImportedMarker - -@ImportedMarker -object ImportedClass { - @ImportedMarker - fun importedObjectMember() {} -} - -@ImportedMarker -fun importedFunction() {} - -@ImportedMarker -val importedProperty = Unit - -// FILE: usage.kt - -import feature.experimental.self.ImportedMarker -import feature.experimental.self.ImportedClass -import feature.experimental.self.importedFunction -import feature.experimental.self.importedProperty -import feature.experimental.self.ImportedClass.importedObjectMember diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.kt index 4b18824c5bc..4af08974b1f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/importStatement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn // FILE: api.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.fir.kt deleted file mode 100644 index 66e053a6a5c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn -// FILE: api.kt - -package api - -@RequiresOptIn(level = RequiresOptIn.Level.WARNING) -annotation class ExperimentalAPI - -@ExperimentalAPI -@RequiresOptIn(level = RequiresOptIn.Level.WARNING) -annotation class VeryExperimentalAPI - -@ExperimentalAPI -@VeryExperimentalAPI -fun f() {} - -@ExperimentalAPI -fun g() {} - -// FILE: usage.kt - -@file:OptIn(ExperimentalAPI::class, VeryExperimentalAPI::class) -package usage - -import api.* - -fun usage() { - f() - g() -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.kt index 66e053a6a5c..ed11e8a3a4c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnFileWithVeryExperimentalMarker.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn // FILE: api.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.fir.kt deleted file mode 100644 index 3232fc29ef5..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn api.ExperimentalAPI -// MODULE: api -// FILE: api.kt - -package api - -@RequiresOptIn(level = RequiresOptIn.Level.ERROR) -annotation class ExperimentalAPI - -@ExperimentalAPI -fun function(): String = "" - -// MODULE: usage(api) -// FILE: usage.kt - -package usage - -import api.* - -fun use() { - function() -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.kt index 3232fc29ef5..7f70e71b9ad 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalOnWholeModule.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn api.ExperimentalAPI // MODULE: api // FILE: api.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.fir.kt deleted file mode 100644 index d7b55663e0b..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.fir.kt +++ /dev/null @@ -1,57 +0,0 @@ -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn -// !DIAGNOSTICS: -UNUSED_PARAMETER -// FILE: api.kt - -package api - -@RequiresOptIn(level = RequiresOptIn.Level.WARNING) -@Target(AnnotationTarget.CLASS) -annotation class E - -@E -open class Foo(val s: String = "") - -// FILE: usage.kt - -import api.* - -@OptIn(E::class) -class Klass { - init { - Foo() - } -} - -class Constructor { - @OptIn(E::class) constructor() { - Foo() - } -} - -@OptIn(E::class) -val property = Foo().s - -@OptIn(E::class) -fun function() { - Foo() -} - -fun valueParameter(@OptIn(E::class) p: String = Foo().s): String { - @OptIn(E::class) - val localVariable: String = Foo().s - return localVariable -} - -var propertyAccessors: String - @OptIn(E::class) - get() = Foo().s - @OptIn(E::class) - set(value) { Foo() } - -fun expression(): String { - val s = @OptIn(E::class) Foo().s - return s -} - -@OptIn(E::class) -typealias TypeAlias = Foo diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.kt index d7b55663e0b..87c9b33e3dd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/experimental/useExperimentalTargets.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !USE_EXPERIMENTAL: kotlin.RequiresOptIn // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: api.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.fir.kt deleted file mode 100644 index 134a2ccb6cb..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic -// !DIAGNOSTICS: -UNUSED_VALUE -// SKIP_TXT - -var xs: IntArray = intArrayOf(1, 2, 3) - get() = field - set(ys) { - var sum = 0 - for (x in field) { - sum = sum * 10 + x - field = intArrayOf(4, 5, 6) - } - if (sum != 123) throw AssertionError("sum=$sum") - field = ys - } diff --git a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.kt b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.kt index 134a2ccb6cb..4dba239797b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/forInFieldUpdatedInLoopBodyBefore13.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic // !DIAGNOSTICS: -UNUSED_VALUE // SKIP_TXT diff --git a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.fir.kt deleted file mode 100644 index 64edb6438df..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic -// !DIAGNOSTICS: -UNUSED_VALUE -// SKIP_TXT - -class Delegate(var v: T) { - operator fun getValue(thisRef: Any?, kProp: Any?) = v - operator fun setValue(thisRef: Any?, kProp: Any?, value: T) { v = value } -} - -fun testLocalDelegatedProperty() { - var xs by Delegate(arrayOf("a", "b", "c")) - for (x in xs) { - println(x) - xs = arrayOf("d", "e", "f") - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.kt b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.kt index 64edb6438df..4e451c51dbc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeLocalDelegatedPropertyAssignmentBefore13.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -ProperForInArrayLoopRangeVariableAssignmentSemantic // !DIAGNOSTICS: -UNUSED_VALUE // SKIP_TXT diff --git a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.fir.kt deleted file mode 100644 index 1689dd22563..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !LANGUAGE: +ProperForInArrayLoopRangeVariableAssignmentSemantic -// !DIAGNOSTICS: -UNUSED_VALUE -// SKIP_TXT - -fun testObjectArray() { - var xs = arrayOf("a", "b", "c") - for (x in xs) { - println(x) - xs = arrayOf("d", "e", "f") - } -} - -fun testPrimitiveArray() { - var xs = intArrayOf(1, 2, 3) - for (x in xs) { - println(x) - xs = intArrayOf(4, 5, 6) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.kt b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.kt index 1689dd22563..d48b1bd288f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/forInArrayLoop/rangeVariableAssignment13.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +ProperForInArrayLoopRangeVariableAssignmentSemantic // !DIAGNOSTICS: -UNUSED_VALUE // SKIP_TXT diff --git a/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.fir.kt deleted file mode 100644 index abfc08fe611..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: Java.java - -import java.util.List; - -class Java { - public static List get(List o) { return o; } -} - -// FILE: test.kt - -import java.util.ArrayList - -fun call(): List { - // No errors should be here - return Java.get(if (true) ArrayList() else listOf(0)) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.kt b/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.kt index abfc08fe611..eeeed05cc93 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Java.java import java.util.List; diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.fir.kt deleted file mode 100644 index 86a57e0c766..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -//!DIAGNOSTICS: -UNUSED_PARAMETER - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun Iterable<*>.filterIsInstance1(): List<@kotlin.internal.NoInfer R> = throw Exception() - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun List<*>.filterIsInstance2(): @kotlin.internal.NoInfer List = throw Exception() - -fun test(list: List) { - list.filterIsInstance1().map { it * 2 } - list.filterIsInstance2().filter { it > 10 } -} - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun foo(t: R): List<@kotlin.internal.NoInfer R> = throw Exception("$t") - -fun test() { - foo(1).map { it * 2 } -} - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun List.foo(): @kotlin.internal.NoInfer R = throw Exception() - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun bar(r: R, f: Function1<@kotlin.internal.NoInfer R, Unit>): Nothing = throw Exception() - -fun test1() { - listOf("").foo().length - bar(1) { x -> x + 1 } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.kt index 86a57e0c766..b443e8019de 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/internalAnnotationsOnTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //!DIAGNOSTICS: -UNUSED_PARAMETER @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.fir.kt deleted file mode 100644 index 8c7d8deca67..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - -annotation class Anno - -fun test(a: List>) { - strictSelect(a, emptyList().map { it.annotationClass.java }) -} - -fun <@kotlin.internal.OnlyInputTypes S> strictSelect(arg1: S, arg2: S): S = TODO() \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.kt index 8c7d8deca67..80947f205a6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/kt35210.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.fir.kt deleted file mode 100644 index 85003e8de33..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: TestBase.java - -public class TestBase { } - -// FILE: Test.java - -public class Test extends TestBase { } - -// FILE: main.kt - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun <@kotlin.internal.OnlyInputTypes K> TestBase.foo(key: K) = null -fun foo(result: Test<*>) { - result.foo("sd") // Type inference failed (NI), OK in OI -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.kt index 85003e8de33..ec2767ec64e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeAndJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.fir.kt deleted file mode 100644 index fcad07fe37a..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - -interface IFace - -fun <@kotlin.internal.OnlyInputTypes K, V> IFace.get(key: K): V? = TODO() -fun <@kotlin.internal.OnlyInputTypes I> id(arg: I): I = arg - -interface InvBase -class DerivedInv : InvBase -class InvRecursive> - -fun test1(argument: InvRecursive<*>, receiver: IFace, Any>) { - receiver.get(argument) -} - -fun test2(arg: InvRecursive) { - id(arg) -} - -fun test3(arg: InvRecursive) { - id(arg) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.kt index fcad07fe37a..df166ba2065 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypeRecursiveBoundAndProjections.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER @file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.fir.kt deleted file mode 100644 index 154c475e0c7..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -//!DIAGNOSTICS: -UNUSED_PARAMETER - -//FILE:Foo.java - -public class Foo { - public static String foo() { - return null; - } -} - -//FILE:Bar.kt - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -fun <@kotlin.internal.OnlyInputTypes T> assertEquals1(t1: T, t2: T) {} - -fun test() { - assertEquals1(null, Foo.foo()) - assertEquals1("", Foo.foo()) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.kt index 154c475e0c7..71054d75095 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesAnnotationWithPlatformTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //!DIAGNOSTICS: -UNUSED_PARAMETER //FILE:Foo.java diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.fir.kt deleted file mode 100644 index 4e73147cdc6..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.fir.kt +++ /dev/null @@ -1,26 +0,0 @@ -fun test1(ns: String?, vararg nullableStrs: String?) { - nullableStrs.contains("x") - nullableStrs.contains(ns) - "x" in nullableStrs - ns in nullableStrs -} - -fun test2(ns: String?, vararg nonNullableStrs: String) { - nonNullableStrs.contains("x") - nonNullableStrs.contains(ns) - "x" in nonNullableStrs - ns in nonNullableStrs -} - -fun test3(ns: String?, nullableStrs: Array, nonNullableStrs: Array) { - nullableStrs.contains("x") - nonNullableStrs.contains("x") - - nullableStrs.contains(ns) - nonNullableStrs.contains(ns) - - "x" in nullableStrs - "x" in nonNullableStrs - ns in nullableStrs - ns in nonNullableStrs -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.kt index 4e73147cdc6..1f122975587 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/onlyInputTypesWithVarargs.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1(ns: String?, vararg nullableStrs: String?) { nullableStrs.contains("x") nullableStrs.contains(ns) diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.fir.kt deleted file mode 100644 index 7f7e91045c1..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -private object TopLevelTypeVariable { - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - fun foo(): @kotlin.internal.NoInfer T = TODO() - - fun bar(k: K) {} - - fun test() { - bar(foo()) - } -} - -private object NestedTypeVariable { - class Inv - - @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - fun foo(): Inv<@kotlin.internal.NoInfer T> = TODO() - - fun bar(p: Inv) {} - - fun test() { - bar(foo()) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.kt index 7f7e91045c1..26ef1f47754 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/annotationsForResolve/propagationOfNoInferAnnotation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER private object TopLevelTypeVariable { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.fir.kt deleted file mode 100644 index 919b8578b2d..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE - -package b - -fun bar() { - val a1 = Array(1, {i: Int -> i}) - val a2 = Array(1, {i: Int -> "$i"}) - val a3 = Array(1, {it}) - - checkSubtype>(a1) - checkSubtype>(a2) - checkSubtype>(a3) -} - diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.kt index 919b8578b2d..aa2e0494e0f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/arrayConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE package b diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.fir.kt deleted file mode 100644 index 8e0e04562b9..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: +NewInference -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-31219 - -import kotlin.reflect.KProperty - -interface Intf - -interface GenericIntf - -class Foo { - private val generic1 by lazy { - abstract class LocalIntf : GenericIntf - object : LocalIntf() {} - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.kt index 8e0e04562b9..30b8cb4c167 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31219.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.fir.kt deleted file mode 100644 index 5714e3a6e27..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !LANGUAGE: +NewInference -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-31679 - -import kotlin.reflect.KProperty - -class MyDelegate(p: () -> T) { - operator fun getValue(thisRef: Any?, property: KProperty<*>): T = TODO() -} - -private val privateObj by MyDelegate { - object { - val x = 42 - } -} - -fun test() { - privateObj.x -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.kt index 5714e3a6e27..bb9dd9d2784 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt31679.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.fir.kt deleted file mode 100644 index 8d1b2c34377..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !LANGUAGE: +NewInference -// !WITH_NEW_INFERENCE -// !DIAGNOSTICS: -UNUSED_PARAMETER -// ISSUE: KT-32249 - -import kotlin.properties.ReadOnlyProperty -import kotlin.reflect.KProperty - -class Wrapper(val name: String, val defaultValue: T) - -private fun wrapper(defaultValue: T) = object : ReadOnlyProperty> { - override fun getValue(thisRef: Any, property: KProperty<*>): Wrapper = null!! -} - -object Foo { - val x by wrapper(true) - val y: Wrapper by wrapper(true) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.kt index 8d1b2c34377..a846d709c44 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/delegates/kt32249.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.fir.kt deleted file mode 100644 index 0b312e318b3..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !LANGUAGE: +NewInference - -import kotlin.test.assertEquals - -fun test() { - val u = when (true) { - true -> 42 - else -> 1.0 - } - - assertEquals(42, u) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt index 0b312e318b3..a1f3691d2c2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/intersectionInputType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference import kotlin.test.assertEquals diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.fir.kt deleted file mode 100644 index 1c164720a43..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: +NewInference - -fun test(ls: List) { - ls.takeIf(Collection<*>::isNotEmpty) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.kt index 1c164720a43..1acff47b0fc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt30292.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference fun test(ls: List) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.fir.kt deleted file mode 100644 index cd6154e7026..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.KProperty1 -import kotlin.reflect.KFunction1 - -fun has(property: KFunction1) = null -fun has(property: KProperty1) = null - -fun toInt(s: String) = 10 - -object A { - fun main() { - has(::toInt) // throwing an exception here - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.kt index cd6154e7026..6a66777e76b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt35847.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.fir.kt deleted file mode 100644 index 6bac4f49b01..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE -UNUSED_PARAMETER -NULLABLE_INLINE_PARAMETER - -@kotlin.internal.InlineOnly -inline fun test() { - -} - -@kotlin.internal.InlineOnly -inline fun test3(noinline s : (Int) -> Int) { - -} - -@kotlin.internal.InlineOnly -inline fun test4(noinline s : Int.() -> Int) { - -} - -@kotlin.internal.InlineOnly -inline fun Function1?.test5() { - -} - -@kotlin.internal.InlineOnly -inline fun Function1?.test6() { - -} - -@kotlin.internal.InlineOnly -inline fun test2(s : ((Int) -> Int)?) { - -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.kt b/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.kt index 6bac4f49b01..8752a329887 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inline/inlineOnlySuppressesNothingToInline.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE -UNUSED_PARAMETER -NULLABLE_INLINE_PARAMETER @kotlin.internal.InlineOnly diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.fir.kt deleted file mode 100644 index ed1d3830493..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// FULL_JDK -// SKIP_TXT - -import java.util.regex.Pattern - -val strs: List = listOf("regex1", "regex2") - -val patterns: List = strs.map(Pattern::compile) diff --git a/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.kt b/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.kt index ed1d3830493..f18404d8d08 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/java/patternCompileCallableReference.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK // SKIP_TXT diff --git a/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.fir.kt deleted file mode 100644 index 3a711f417bd..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !CHECK_TYPE - -// FILE: A.java -import kotlin.reflect.KClass; - -public class A { - public static A getA() { - return null; - } - - public static KClass getKClass() { - return null; - } -} - - -// types checked by txt file - -// FILE: 1.kt -inline fun test1() = X::class.java -inline fun test2() = X::class.java -inline fun test3() = X::class.java -inline fun test4() = X::class.java -inline fun test5() = X::class.java - -fun test6() = A.getA()::class.java -fun test7() = A.getKClass().java - diff --git a/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt b/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt index 3a711f417bd..a293a88e924 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/javaForKClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.fir.kt deleted file mode 100644 index 557e9ba6a6b..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.fir.kt +++ /dev/null @@ -1,76 +0,0 @@ -// !WITH_NEW_INFERENCE -// NI_EXPECTED_FILE -// JAVAC_EXPECTED_FILE -// FILE: Base.java - -public interface Base {} - -// FILE: Other.java - -public interface Other {} - -// FILE: Derived.java - -public final class Derived implements Base, Other {} - -// FILE: Exotic.java - -public final class Exotic implements Base, Other { - - int x; - - Exotic(int x) { - this.x = x; - } -} - -// FILE: Properties.java - -import kotlin.jvm.functions.Function0; - -class Val { - - Function0 initializer; - - Val(Function0 initializer) { - this.initializer = initializer; - } - - T getValue(Object instance, Object metadata) { - return initializer.invoke(); - } -} - -class Properties { - static Val calcVal(Function0 initializer) { - return new Val(initializer); - } -} - -// FILE: My.kt - -open class Wrapper(val v: T) - -class DerivedWrapper(v: Derived<*>): Wrapper>(v) - -class ExoticWrapper(v: Exotic): Wrapper(v) - -object MyBase { - - fun derived() = Derived() - fun exotic(x: Int) = Exotic(x) - - fun derivedWrapper() = DerivedWrapper(derived()) - fun exoticWrapper(x: Int) = ExoticWrapper(exotic(x)) -} - -class My(val x: Int) { - val wrapper/*: Wrapper<*>*/ by Properties.calcVal { - val y = x + 1 - when { - y > 0 -> MyBase.derivedWrapper() - x < 0 -> MyBase.exoticWrapper(x) - else -> throw java.lang.NullPointerException("") - } - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt b/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt index 557e9ba6a6b..96207a9379a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/kt7585/delegate.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // NI_EXPECTED_FILE // JAVAC_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt9985.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/kt9985.fir.kt deleted file mode 100644 index a99da78ab1c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/kt9985.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun foo(l: List?) { - Pair(l?.joinToString(), "") -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/kt9985.kt b/compiler/testData/diagnostics/testsWithStdLib/kt9985.kt index a99da78ab1c..0fbd47ace87 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/kt9985.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/kt9985.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(l: List?) { Pair(l?.joinToString(), "") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.fir.kt deleted file mode 100644 index 427d84be1c8..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect fun foo(x: String, y: Int = -1) - -// MODULE: m2-jvm(m1-common) -// FILE: jvm.kt - -@JvmOverloads -actual fun foo(x: String, y: Int) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.kt b/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.kt index 427d84be1c8..5500819238a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/multiplatform/jvmOverloads.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt diff --git a/compiler/testData/diagnostics/testsWithStdLib/native/noBody.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/native/noBody.fir.kt deleted file mode 100644 index 3d262f82bb0..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/native/noBody.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -import kotlin.jvm.* - -external fun foo() - -class C { - external fun foo() - - companion object { - external fun foo() - } -} - -object O { - external fun foo() -} - -fun test() { - class Local { - external fun foo() - } - - object { - external fun foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/native/noBody.kt b/compiler/testData/diagnostics/testsWithStdLib/native/noBody.kt index 3d262f82bb0..4be6a84eb2e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/native/noBody.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/native/noBody.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.jvm.* external fun foo() diff --git a/compiler/testData/diagnostics/testsWithStdLib/native/override.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/native/override.fir.kt deleted file mode 100644 index 7662d324aa0..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/native/override.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -import kotlin.jvm.* - -interface Base { - fun foo() -} - -class Derived : Base { - override external fun foo() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/native/override.kt b/compiler/testData/diagnostics/testsWithStdLib/native/override.kt index 7662d324aa0..b8a427d734a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/native/override.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/native/override.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.jvm.* interface Base { diff --git a/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.fir.kt deleted file mode 100644 index b00b584bd5e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: Derived.java -import kotlin.jvm.functions.Function0; -import org.jetbrains.annotations.NotNull; - -public class Derived implements Base { - @Override - public void foo(@NotNull Function0 compute) {} -} - -// FILE: main.kt -interface Base { - fun foo(compute: () -> V?) -} - -fun main() { - Derived().foo { "" } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt b/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt index b00b584bd5e..f5b2bff4b8e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/overrideWithFunctionalType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Derived.java import kotlin.jvm.functions.Function0; import org.jetbrains.annotations.NotNull; diff --git a/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.fir.kt deleted file mode 100644 index 648e86cbe34..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -inline fun foo(x: T) {} - -fun test() { - foo>(listOf("")) - foo(listOf("")) - - foo>(arrayOf("")) - foo(arrayOf("")) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.kt b/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.kt index 648e86cbe34..203678eff51 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/pureReifiable.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") diff --git a/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.fir.kt deleted file mode 100644 index 57cad51a93e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE - -fun test() { - arrayOf>(listOf("")) - arrayOf(listOf("")) - - arrayOf>(arrayOf("")) - arrayOf(arrayOf("")) - - arrayOfNulls>(1) - - Array>(1) { arrayOf("") } - Array(1) { arrayOf("") } - Array(1) { arrayOf("") } - - emptyArray>() - val x: Array> = emptyArray() -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.kt b/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.kt index 57cad51a93e..ec20b1a9d2f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/pureReifiableArrayOperations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE fun test() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.fir.kt deleted file mode 100644 index 80c8397edc9..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// JAVAC_EXPECTED_FILE - -// FILE: A.java -import java.util.*; - -@kotlin.jvm.PurelyImplements("") -public class A extends AbstractList { - @Override - public T get(int index) { - return null; - } - - @Override - public int size() { - return 0; - } -} - -// FILE: B.java -import java.util.*; - -@kotlin.jvm.PurelyImplements("[INVALID]") -public class B extends AbstractList {} - -// FILE: main.kt -val x = A() -val y = B() diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.kt index 80c8397edc9..48a16aff9ea 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/invalidFqName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // JAVAC_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.fir.kt deleted file mode 100644 index 1fb450aad86..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.fir.kt +++ /dev/null @@ -1,40 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// JAVAC_EXPECTED_FILE - -import java.util.*; - -// FILE: A.java -@kotlin.jvm.PurelyImplements("kotlin.collections.MutableList") -class A extends AbstractList { - @Override - public T get(int index) { - return null; - } - - @Override - public int size() { - return 0; - } -} - -// FILE: b.kt - -fun bar(): String? = null - -fun foo() { - var x = A() - x.add(null) - x.add(bar()) - x.add("") - - x[0] = null - x[0] = bar() - x[0] = "" - - val b1: MutableList = x - val b2: MutableList = x - val b3: List = x - - val b4: Collection = x - val b6: MutableCollection = x -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.kt b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.kt index 1fb450aad86..644ce9fa1ec 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/purelyImplementedCollection/wrongTypeParametersCount.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // JAVAC_EXPECTED_FILE diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.fir.kt deleted file mode 100644 index 6fdd50da1ad..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -fun add(a: Int, b: Int) = a + b -interface A { - fun shuffle(x: List): List - fun foo(f : (List) -> List, x : List) - -fun f() : (Int, Int) -> Int = ::add -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.kt index 6fdd50da1ad..a03d90ea2fb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/ea63992.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun add(a: Int, b: Int) = a + b interface A { fun shuffle(x: List): List diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.fir.kt deleted file mode 100644 index 5ab2c2ff4bc..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -const val myPi = kotlin.math.PI - -annotation class Anno(val d: Double) - -@Anno(kotlin.math.PI) -fun f() {} - -@Anno(myPi) -fun g() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.kt index 5ab2c2ff4bc..4b238cdd62d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL const val myPi = kotlin.math.PI annotation class Anno(val d: Double) diff --git a/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.fir.kt deleted file mode 100644 index df17f0fad3e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -class A(val x: Array) { - val y: Int = x[0].toString().length - - fun foo(a: T) { - x[0] = a - } - - fun bar(a: Array): Int = a[0].toString().length -} - -fun baz(a: Array): String = a[0].toString() diff --git a/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.kt b/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.kt index df17f0fad3e..11c50b93f07 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/reified/nonCallableReiefied.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A(val x: Array) { val y: Int = x[0].toString().length diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.fir.kt deleted file mode 100644 index 26068f65a79..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -fun fn(): Nothing = throw java.lang.RuntimeException("oops") - -val x: Nothing = throw java.lang.RuntimeException("oops") - -class SomeClass { - fun method() { - throw java.lang.AssertionError("!!!") - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.kt index 26068f65a79..69564c524de 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/javaPackageMembers.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun fn(): Nothing = throw java.lang.RuntimeException("oops") val x: Nothing = throw java.lang.RuntimeException("oops") diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.fir.kt deleted file mode 100644 index 986bf3b6bae..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.fir.kt +++ /dev/null @@ -1 +0,0 @@ -val stringReversed = String::reversed \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.kt index 986bf3b6bae..5e6092a70e4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10103.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL val stringReversed = String::reversed \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.fir.kt deleted file mode 100644 index f7ac21f1f61..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun List?.foo() {} - -@JvmName("foo1") -fun List.foo() {} - - -fun bar(x: List) = x - -@JvmName("bar1") -fun bar(x: List?) = x diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.kt index f7ac21f1f61..f482fb2c356 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/kt10732a.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun List?.foo() {} @JvmName("foo1") diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.fir.kt deleted file mode 100644 index 57eb8e96916..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -// FILE: s/SamConstructor.java -package s; - -public class SamConstructor { - public SamConstructor(Runnable r) { - } - - public static void foo(Runnable r) {} -} - -// FILE: 1.kt -package a - -fun SamConstructor(a: () -> Unit) {} - -// FILE: 2.kt - -package b - -import s.SamConstructor -import a.* - -fun test() { - val a: s.SamConstructor = SamConstructor { } - - val b: s.SamConstructor = SamConstructor(null) - - SamConstructor.foo(null) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.kt index 57eb8e96916..05384110cd1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // FILE: s/SamConstructor.java package s; diff --git a/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.fir.kt deleted file mode 100644 index 51e32baee57..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -data class XY(val x: Int, val y: Int) - -fun foo(list: List) { - for ((x1, y1) in list) { - for ((x2, y2) in list) { - if (x1 == y2 && x2 == y1) return - } - list.map { (x3, y3) -> x3 + y3 } - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt b/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt index 51e32baee57..4a54d3d9c3e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL data class XY(val x: Int, val y: Int) fun foo(list: List) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.fir.kt deleted file mode 100644 index f9611264f24..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// See KT-9529 Smart cast causes code to be incompilable - -fun foo(o: T): Collection { - if (o is String) { - return listOf(o) - } - return listOf(o) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.kt index f9611264f24..18e44f5a23a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/listOfGeneric.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-9529 Smart cast causes code to be incompilable fun foo(o: T): Collection { diff --git a/compiler/testData/diagnostics/testsWithStdLib/streams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/streams.fir.kt deleted file mode 100644 index a447b3bba69..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/streams.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FULL_JDK -// STDLIB_JDK8 - -import java.util.* -import kotlin.streams.toList - -fun testStreams(list: ArrayList) { - list.stream().toList() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/streams.kt b/compiler/testData/diagnostics/testsWithStdLib/streams.kt index a447b3bba69..9ff78a10edc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/streams.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/streams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FULL_JDK // STDLIB_JDK8 diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.fir.kt deleted file mode 100644 index 4bf34c3afc0..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_DESTRUCTURED_PARAMETER_ENTRY, -UNUSED_ANONYMOUS_PARAMETER -// !LANGUAGE: +TrailingCommas - -data class Foo1(val x: String, val y: String, val z: String = "") - -fun main() { - val (x1,y1,) = Pair(1, 2) - val (x2, y2: Number,) = Pair(1,2) - val (x3,y3,z3,) = Foo1("", "",) - val (x4,y4: CharSequence,) = Foo1("", "", "",) - val (x41,y41: CharSequence,/**/) = Foo1("", "", "",) - - val x5: (Pair, Int) -> Unit = { (x,y,),z, -> } - val x6: (Foo1, Int) -> Any = { (x,y,z: CharSequence,), z2: Number, -> 1 } - val x61: (Foo1, Int) -> Any = { (x,y,z: CharSequence,/**/), z2: Number,/**/ -> 1 } - - for ((i, j) in listOf(Pair(1,2))) {} - for ((i: Any,) in listOf(Pair(1,2))) {} - for ((i: Any,/**/) in listOf(Pair(1,2))) {} -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.kt index 4bf34c3afc0..3a3d5f0cfb3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/multiVariableDeclarationWithEnabledFeature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_DESTRUCTURED_PARAMETER_ENTRY, -UNUSED_ANONYMOUS_PARAMETER // !LANGUAGE: +TrailingCommas diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.fir.kt deleted file mode 100644 index 78df6b74bc2..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER -// !LANGUAGE: +TrailingCommas - -fun foo(vararg x: Int) = false -fun foo() = true - -fun main() { - val x = foo() - val y = foo(,) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.kt index 78df6b74bc2..561b02882c2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/noDisambiguation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER // !LANGUAGE: +TrailingCommas diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.fir.kt deleted file mode 100644 index 3485444781e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_TYPEALIAS_PARAMETER, -CAST_NEVER_SUCCEEDS -// !LANGUAGE: +TrailingCommas - -class Foo1 {} - -interface Foo2 - -fun foo3() {} - -typealias Foo4 = Int - -class Foo5: Foo2 - -fun foo () { - val x1 = Foo1() - val x2: Foo2? = null - val x21: Foo2? = null - val x3 = foo3< - Int, - String, - Float, - >() - val x4: Foo4, Iterable,>, Double, T, - >? = null as Foo4, Iterable,>, Double, T,> - val x5: (Float,) -> Unit = {} - val x6: Pair<(Float, Comparable,) -> Unit, (Float,) -> Unit,>? = null - val x61: Pair<(Float, Comparable,/**/) -> Unit, (Float,/**/) -> Unit,/**/>? = null -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.kt index 3485444781e..f5e133e9691 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeArgumentsWithEnabledFeature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_TYPEALIAS_PARAMETER, -CAST_NEVER_SUCCEEDS // !LANGUAGE: +TrailingCommas diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.fir.kt deleted file mode 100644 index bb48ef27620..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.fir.kt +++ /dev/null @@ -1,51 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_TYPEALIAS_PARAMETER -// !LANGUAGE: +TrailingCommas - -@Target(AnnotationTarget.TYPE) -annotation class Anno - -class Foo1 - -class Foo2< - T1, - T2: T1, - > { - fun foo2() {} - - internal inner class B -} - -interface A - -interface A1 - -fun foo1() {} - -fun foo11() {} - -inline fun foo2() {} - -fun T2?.foo3() {} - -val T.bar1 get() = null - -var < - T4, - > T4?.bar2 - get() = null - set(value) { - - } - -typealias Foo3 = List - -typealias Foo4 = List - -fun main() { - fun foo10() { - fun foo10() {} - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.kt index bb48ef27620..52152e81816 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/typeParametersWithEnabledFeature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_TYPEALIAS_PARAMETER // !LANGUAGE: +TrailingCommas diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.fir.kt deleted file mode 100644 index aabceebf900..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.fir.kt +++ /dev/null @@ -1,50 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -NAME_SHADOWING -// !LANGUAGE: +TrailingCommas - -fun foo1(x: Any) = when (x) { - Comparable::class, - Iterable::class, - String::class, - -> println(1) - else -> println(3) -} - -fun foo2(x: Any) { - val z = when (val y: Int = x as Int) { - 1, -> println(1) - else -> println(3) - } -} - -fun foo3(x: (Any) -> Any) { - val z = when (val y: (Any) -> Any = x) { - {x: Any, -> x}, {y: Any, -> y}, -> println(1) - else -> println(3) - } -} - -fun foo4(x: Any) { - val z = when (x) { - is Int, is Double, -> println(1) - else -> println(3) - } -} - -fun foo5(x: Int, y: IntArray, z: IntArray) { - val u = when (x) { - in y, - in z, - -> println(1) - else -> println(3) - } -} - -fun foo6(x: Boolean?) = when (x) { - true, false, -> println(1) - null, -> println(1) -} - -fun foo7(x: Boolean?) = when (x) { - true, false,/**/ -> println(1) - null,/**/ -> println(1) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.kt b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.kt index aabceebf900..e6587e0debc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/trailingComma/whenEntryWithEnabledFeature.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -NAME_SHADOWING // !LANGUAGE: +TrailingCommas diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.fir.kt deleted file mode 100644 index 7639d72c72f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -// FILE: test.kt -val fooException = Exception("foo") -val barException = kotlin.Exception("bar") diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.kt index 7639d72c72f..df8dc03a434 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/typealias/exceptionTypeAliases.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: test.kt val fooException = Exception("foo") val barException = kotlin.Exception("bar") diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.fir.kt deleted file mode 100644 index 1cb5f2b94a5..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -import kotlin.test.* -import java.util.* - -typealias HM = HashMap - -fun >> updateMap(map: M, k: K, v: V): M { - map[k]!!.add(v) - return map -} - -val nameToTeam = listOf("Alice" to "Marketing", "Bob" to "Sales", "Carol" to "Marketing") -val namesByTeam = nameToTeam.groupBy({ it.second }, { it.first }) - -val mutableNamesByTeam1 = updateMap(HM(), "", "") -val mutableNamesByTeam2 = updateMap(HashMap(), "", "") - -fun test() { - assertEquals(namesByTeam, mutableNamesByTeam1) - assertEquals(namesByTeam, mutableNamesByTeam2) -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt index 1cb5f2b94a5..ee3b509b0b8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/typealias/hashMapTypeAlias.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL import kotlin.test.* import java.util.* diff --git a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.fir.kt deleted file mode 100644 index 4ab40699fd5..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// FILE: A.java -public class A { - public static void main(String[] args) {} -} - -// FILE: 1.kt -fun main() { - A.main(arrayOf()) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.kt b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.kt index 4ab40699fd5..ec85b032318 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt4172j.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { public static void main(String[] args) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.fir.kt deleted file mode 100644 index dbd93e1b8b5..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -fun test() { - val p: Array = arrayOf("a") - foo(*p) -} - -fun foo(vararg a: String?) = a \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.kt b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.kt index dbd93e1b8b5..879f3e42e27 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/varargs/kt5534.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test() { val p: Array = arrayOf("a") foo(*p) diff --git a/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.fir.kt deleted file mode 100644 index bb4ed7a89dd..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -fun test1() { - if (true) { - when (true) { - true -> println() - } - } else { - System.out?.println() // kotlin.Unit? - } -} - -fun test2() { - val mlist = arrayListOf("") - if (true) { - when (true) { - true -> println() - } - } else { - mlist.add("") // kotlin.Boolean - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.kt b/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.kt index bb4ed7a89dd..94efaad6dfd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/when/kt10192.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1() { if (true) { when (true) { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt index b8a7352b373..64430f93327 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/AbstractFirOldFrontendDiagnosticsTest.kt @@ -12,7 +12,7 @@ import java.io.File abstract class AbstractFirOldFrontendDiagnosticsTest : AbstractFirDiagnosticsTest() { override fun createTestFileFromPath(filePath: String): File { - val newPath = filePath.replace(".kt", ".fir.kt") + val newPath = if (File(filePath).readText().contains("// FIR_IDENTICAL")) filePath else filePath.replace(".kt", ".fir.kt") return File(newPath).also { prepareTestDataFile(filePath, it) } @@ -40,6 +40,11 @@ abstract class AbstractFirOldFrontendDiagnosticsTest : AbstractFirDiagnosticsTes checkResultingFirFiles(allFirFiles, testDataFile) assertFalse("Test is good but there is expected exception", failureFile.exists()) checkDiagnostics(testDataFile, testFiles, allFirFiles) + if (testDataFile.absolutePath.endsWith(".fir.kt")) { + val oldFrontendTestDataFile = File(testDataFile.absolutePath.replace(".fir.kt", ".kt")) + compareAndMergeFirFileAndOldFrontendFile(oldFrontendTestDataFile, testDataFile) + } + val needDump = testFiles.any { it.directives.containsKey("FIR_DUMP") } if (needDump) { checkFir(testDataFile, allFirFiles) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt new file mode 100644 index 00000000000..9fbe942ced4 --- /dev/null +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/fir/FirTestUtils.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir + +import junit.framework.TestCase +import java.io.File + +fun compareAndMergeFirFileAndOldFrontendFile(oldFrontendTestDataFile: File, frontendIRTestDataFile: File) { + if (oldFrontendTestDataFile.exists() && frontendIRTestDataFile.exists()) { + val originalLines = oldFrontendTestDataFile.readLines() + val firLines = frontendIRTestDataFile.readLines() + val sameDumps = firLines.withIndex().all { (index, line) -> + val trimmed = line.trim() + val originalTrimmed = originalLines.getOrNull(index)?.trim() + trimmed.isEmpty() && originalTrimmed?.isEmpty() != false || trimmed == originalTrimmed + } && originalLines.withIndex().all { (index, line) -> + index < firLines.size || line.trim().isEmpty() + } + if (sameDumps) { + frontendIRTestDataFile.delete() + oldFrontendTestDataFile.writeText("// FIR_IDENTICAL\n" + oldFrontendTestDataFile.readText()) + } + TestCase.assertFalse( + "Dumps via FIR & via old FE are the same. Deleted .fir.txt dump, added // FIR_IDENTICAL to test source", + sameDumps + ) + } +} \ No newline at end of file