From 6db934465903dfb7235930d09dd3f5a7c240f4da Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Mon, 21 Sep 2015 23:40:34 +0300 Subject: [PATCH] Fix compiler tests --- compiler/testData/builtin-classes.txt | 634 +++++++++--------- compiler/testData/cli/jvm/wrongAbiVersion.out | 4 +- .../invoke/onObjects/invokeOnClassObject1.kt | 2 +- .../invoke/onObjects/invokeOnClassObject1.txt | 2 +- .../invoke/onObjects/invokeOnClassObject2.kt | 2 +- .../invoke/onObjects/invokeOnClassObject2.txt | 2 +- .../invokeOnClassObjectOfNestedClass1.kt | 2 +- .../invokeOnClassObjectOfNestedClass1.txt | 2 +- .../invokeOnClassObjectOfNestedClass2.kt | 2 +- .../invokeOnClassObjectOfNestedClass2.txt | 2 +- .../invoke/onObjects/invokeOnEnum1.kt | 2 +- .../invoke/onObjects/invokeOnEnum1.txt | 2 +- .../invoke/onObjects/invokeOnEnum2.kt | 2 +- .../invoke/onObjects/invokeOnEnum2.txt | 2 +- .../invoke/onObjects/invokeOnImportedEnum1.kt | 2 +- .../onObjects/invokeOnImportedEnum1.txt | 2 +- .../invoke/onObjects/invokeOnImportedEnum2.kt | 2 +- .../onObjects/invokeOnImportedEnum2.txt | 2 +- .../invoke/onObjects/invokeOnObject1.kt | 2 +- .../invoke/onObjects/invokeOnObject1.txt | 2 +- .../invoke/onObjects/invokeOnObject2.kt | 2 +- .../invoke/onObjects/invokeOnObject2.txt | 2 +- .../ranges/rangeContainsString.kt | 2 +- .../testData/diagnostics/tests/Builders.kt | 4 +- .../testData/diagnostics/tests/Builders.txt | 4 +- .../diagnostics/tests/ForRangeConventions.kt | 38 +- .../diagnostics/tests/ForRangeConventions.txt | 38 +- compiler/testData/diagnostics/tests/IncDec.kt | 12 +- .../testData/diagnostics/tests/IncDec.txt | 12 +- .../diagnostics/tests/UnusedVariables.kt | 4 +- .../diagnostics/tests/UnusedVariables.txt | 4 +- .../tests/annotations/ConstructorCall.kt | 2 +- .../tests/annotations/ConstructorCall.txt | 2 +- .../tests/annotations/MultiDeclaration.txt | 4 +- .../forParameterAnnotationResolve.txt | 4 +- .../tests/annotations/onMultiDeclaration.txt | 4 +- .../annotations/options/multiDeclaration.txt | 4 +- .../tests/annotations/options/target.txt | 2 +- .../diagnostics/tests/cast/DowncastMap.kt | 2 +- .../diagnostics/tests/cast/DowncastMap.txt | 2 +- .../deadCode/deadCodeFromDifferentSources.kt | 2 +- .../deadCode/deadCodeFromDifferentSources.txt | 2 +- .../deadCode/deadCodeInArrayAccess.kt | 10 +- .../deadCode/deadCodeInAssignment.kt | 2 +- .../deadCode/deadCodeInBinaryExpressions.kt | 2 +- .../deadCode/deadCodeInInnerExpressions.kt | 4 +- .../deadCode/deadCodeInLoops.kt | 2 +- .../deadCode/deadCodeInUnaryExpr.kt | 4 +- .../tests/controlFlowAnalysis/kt1571.kt | 4 +- .../tests/controlFlowAnalysis/kt1571.txt | 4 +- .../tests/controlFlowAnalysis/kt4126.txt | 4 +- .../forLoopWithNullableRange.kt | 6 +- .../forLoopWithNullableRange.txt | 6 +- .../forWithNullableIterator.kt | 6 +- .../forWithNullableIterator.txt | 6 +- .../componentFunctionInSubClass.txt | 2 +- .../dataClasses/componentNamedComponent1.txt | 2 +- .../dataClasses/conflictingCopyOverloads.txt | 4 +- .../dataClasses/conflictingOverloads.txt | 4 +- .../tests/dataClasses/copyOfPrivateClass.txt | 2 +- .../dataClasses/dataClassVarargParam.txt | 4 +- .../tests/dataClasses/dataInheritance.txt | 6 +- .../implementTraitWhichHasComponent1.txt | 2 +- .../implementTraitWhichHasFinalComponent1.txt | 2 +- .../tests/dataClasses/innerDataClass.txt | 2 +- .../tests/dataClasses/innerOuterDataClass.txt | 2 +- .../tests/dataClasses/multiDeclaration.txt | 4 +- .../tests/dataClasses/multiDeclarationFor.txt | 4 +- .../tests/dataClasses/oneValParam.txt | 2 +- .../tests/dataClasses/repeatedProperties.txt | 14 +- .../tests/dataClasses/sealedDataClass.txt | 2 +- .../diagnostics/tests/dataClasses/strange.txt | 4 +- .../tests/dataClasses/twoValParams.txt | 4 +- .../tests/dataClasses/twoVarParams.txt | 4 +- .../ArrayGetSetConvention.kt | 4 +- .../ArrayGetSetConvention.txt | 4 +- .../BinaryExpressionCompareToConvention.kt | 2 +- .../BinaryExpressionCompareToConvention.txt | 2 +- .../BinaryExpressionPlusConvention.kt | 2 +- .../BinaryExpressionPlusConvention.txt | 2 +- .../dataFlowInfoTraversal/MultiDeclaration.kt | 2 +- .../MultiDeclaration.txt | 2 +- .../ComponentFunctionReturnTypeMismatch.kt | 4 +- .../ComponentFunctionReturnTypeMismatch.txt | 4 +- .../DataFlowInMultiDeclInFor.kt | 6 +- .../DataFlowInMultiDeclInFor.txt | 6 +- .../DataFlowInfoInMultiDecl.kt | 4 +- .../DataFlowInfoInMultiDecl.txt | 4 +- .../RedeclarationsInMultiDecl.kt | 4 +- .../RedeclarationsInMultiDecl.txt | 4 +- .../kt2631_MultipleDeclaration.kt | 6 +- .../kt2631_MultipleDeclaration.txt | 6 +- .../kt2643MultiDeclInControlFlow.kt | 4 +- .../kt2643MultiDeclInControlFlow.txt | 4 +- .../multiDeclarations/DoubleDeclForLoop.kt | 6 +- .../multiDeclarations/DoubleDeclForLoop.txt | 6 +- .../FolLoopTypeComponentTypeMismatch.kt | 6 +- .../FolLoopTypeComponentTypeMismatch.txt | 6 +- .../ForLoopComponentFunctionAmbiguity.kt | 8 +- .../ForLoopComponentFunctionAmbiguity.txt | 8 +- .../ForLoopComponentFunctionMissing.kt | 4 +- .../ForLoopComponentFunctionMissing.txt | 4 +- .../ForLoopWithExtensions.kt | 6 +- .../ForLoopWithExtensions.txt | 6 +- .../multiDeclarations/ForWithExplicitTypes.kt | 6 +- .../ForWithExplicitTypes.txt | 6 +- .../RedeclarationInForLoop.kt | 6 +- .../RedeclarationInForLoop.txt | 6 +- .../multiDeclarations/SingleDeclForLoop.kt | 4 +- .../multiDeclarations/SingleDeclForLoop.txt | 4 +- .../multiDeclarations/kt2829.txt | 4 +- .../differentDelegatedExpressions.kt | 4 +- .../differentDelegatedExpressions.txt | 4 +- .../tests/deprecated/componentUsage.kt | 4 +- .../tests/deprecated/componentUsage.txt | 4 +- .../tests/deprecated/functionUsage.kt | 2 +- .../tests/deprecated/functionUsage.txt | 2 +- .../tests/deprecated/iteratorUsage.kt | 12 +- .../tests/deprecated/iteratorUsage.txt | 12 +- .../specialNames/dataClassCopy.txt | 2 +- .../tests/extensions/ExtensionFunctions.kt | 6 +- .../tests/extensions/ExtensionFunctions.txt | 6 +- .../tests/extensions/GenericIterator.kt | 6 +- .../tests/extensions/GenericIterator.txt | 6 +- .../tests/extensions/GenericIterator2.kt | 2 +- .../tests/extensions/GenericIterator2.txt | 2 +- .../throwOutCandidatesByReceiver2.kt | 2 +- .../throwOutCandidatesByReceiver2.txt | 2 +- .../tests/functionLiterals/kt6869.kt | 2 +- .../tests/functionLiterals/kt6869.txt | 2 +- .../tests/generics/tpAsReified/Conventions.kt | 4 +- .../generics/tpAsReified/Conventions.txt | 4 +- .../setterProjectedOutPlusAssignDefined.kt | 2 +- .../setterProjectedOutPlusAssignDefined.txt | 2 +- .../tests/incompleteCode/plusOnTheRight.kt | 2 +- .../tests/incompleteCode/plusOnTheRight.txt | 2 +- .../diagnostics/tests/inference/kt3184.kt | 2 +- .../diagnostics/tests/inference/kt3184.txt | 2 +- .../inference/nestedCalls/arrayAccess.kt | 2 +- .../inference/nestedCalls/arrayAccess.txt | 2 +- .../nestedCalls/binaryExpressions.kt | 4 +- .../nestedCalls/binaryExpressions.txt | 4 +- ...ompleteNestedCallsForArraySetExpression.kt | 2 +- ...mpleteNestedCallsForArraySetExpression.txt | 2 +- ...completeNestedForVariableAsFunctionCall.kt | 2 +- ...ompleteNestedForVariableAsFunctionCall.txt | 2 +- .../tests/inference/regressions/kt1718.kt | 2 +- .../tests/inference/regressions/kt1718.txt | 2 +- .../tests/inference/regressions/kt3496.kt | 2 +- .../tests/inference/regressions/kt3496.txt | 2 +- .../tests/inference/regressions/kt3496_2.kt | 2 +- .../tests/inference/regressions/kt3496_2.txt | 2 +- .../inline/binaryExpressions/arrayAccess.kt | 6 +- .../inline/binaryExpressions/arrayAccess.txt | 6 +- .../inline/binaryExpressions/assignment.kt | 12 +- .../inline/binaryExpressions/assignment.txt | 12 +- .../inline/binaryExpressions/comparison.kt | 6 +- .../inline/binaryExpressions/comparison.txt | 6 +- .../binaryExpressions/componentAccess.kt | 12 +- .../binaryExpressions/componentAccess.txt | 12 +- .../inline/binaryExpressions/contains.kt | 6 +- .../inline/binaryExpressions/contains.txt | 6 +- .../binaryExpressions/mathOperations.kt | 8 +- .../binaryExpressions/mathOperations.txt | 8 +- .../tests/inline/binaryExpressions/rangeTo.kt | 6 +- .../inline/binaryExpressions/rangeTo.txt | 6 +- .../diagnostics/tests/inline/recursion.kt | 4 +- .../diagnostics/tests/inline/recursion.txt | 4 +- .../inline/unaryExpressions/mathOperation.kt | 16 +- .../inline/unaryExpressions/mathOperation.txt | 16 +- .../inline/unaryExpressions/notOperation.kt | 6 +- .../inline/unaryExpressions/notOperation.txt | 6 +- ...nestedClassAccessedViaInstanceReference.kt | 6 +- ...estedClassAccessedViaInstanceReference.txt | 6 +- .../InfixCallNullability.kt | 10 +- .../InfixCallNullability.txt | 10 +- .../tests/nullableTypes/safeAccessOnUnit.txt | 2 +- .../tests/nullableTypes/safeCallWithInvoke.kt | 2 +- .../nullableTypes/safeCallWithInvoke.txt | 2 +- .../tests/objects/invokeOnInnerObject.kt | 2 +- .../tests/objects/invokeOnInnerObject.txt | 2 +- .../AssignOperatorAmbiguity.kt | 4 +- .../AssignOperatorAmbiguity.txt | 4 +- .../AssignmentOperations.kt | 20 +- .../AssignmentOperations.txt | 20 +- .../assignmentOperationsCheckReturnType.kt | 4 +- .../assignmentOperationsCheckReturnType.txt | 4 +- .../operatorsOverloading/compareToNullable.kt | 2 +- .../compareToNullable.txt | 2 +- .../tests/operatorsOverloading/kt1028.kt | 4 +- .../tests/operatorsOverloading/kt1028.txt | 4 +- .../tests/operatorsOverloading/kt3450.kt | 12 +- .../tests/operatorsOverloading/kt3450.txt | 16 +- .../operatorsOverloading/plusAssignOnArray.kt | 10 +- .../plusAssignOnArray.txt | 10 +- .../operatorsOverloading/plusAssignOnLocal.kt | 4 +- .../plusAssignOnLocal.txt | 4 +- .../plusAssignOnProperty.kt | 4 +- .../plusAssignOnProperty.txt | 4 +- .../nullabilityWarnings/invoke.kt | 9 +- .../nullabilityWarnings/multiDeclaration.kt | 7 +- .../notNullAssertionInCall.kt | 2 +- .../notNullAssertionInCall.txt | 2 +- .../nullabilityWarnings/uselessElvisInCall.kt | 2 +- .../uselessElvisInCall.txt | 2 +- .../reflection/noReflectionInClassPath.kt | 4 +- .../diagnostics/tests/regressions/kt235.kt | 10 +- .../diagnostics/tests/regressions/kt235.txt | 10 +- .../diagnostics/tests/regressions/kt258.kt | 2 +- .../diagnostics/tests/regressions/kt258.txt | 2 +- .../diagnostics/tests/regressions/kt282.kt | 6 +- .../diagnostics/tests/regressions/kt282.txt | 6 +- .../diagnostics/tests/regressions/kt459.kt | 2 +- .../diagnostics/tests/regressions/kt459.txt | 2 +- .../diagnostics/tests/regressions/kt469.kt | 4 +- .../diagnostics/tests/regressions/kt469.txt | 4 +- .../diagnostics/tests/regressions/kt597.kt | 2 +- .../diagnostics/tests/regressions/kt597.txt | 2 +- .../diagnostics/tests/regressions/kt618.kt | 10 +- .../diagnostics/tests/regressions/kt618.txt | 10 +- .../diagnostics/tests/regressions/kt629.kt | 2 +- .../diagnostics/tests/regressions/kt629.txt | 2 +- .../tests/regressions/kt7585/base.txt | 4 +- .../tests/regressions/kt7585/java.txt | 4 +- .../resolve/invoke/errors/invisibleInvoke.kt | 2 +- .../resolve/invoke/errors/invisibleInvoke.txt | 2 +- .../errors/typeInferenceErrorForInvoke.kt | 2 +- .../errors/typeInferenceErrorForInvoke.txt | 2 +- .../invoke/errors/unsafeCallWithInvoke.kt | 2 +- .../invoke/errors/unsafeCallWithInvoke.txt | 2 +- .../tests/resolve/invoke/invokeAsExtension.kt | 2 +- .../resolve/invoke/invokeAsExtension.txt | 2 +- .../tests/resolve/invoke/invokeAsMember.kt | 2 +- .../tests/resolve/invoke/invokeAsMember.txt | 2 +- .../resolve/invoke/invokeAsMemberExtension.kt | 10 +- .../invoke/invokeAsMemberExtension.txt | 10 +- ...vokeAsMemberExtensionToExplicitReceiver.kt | 2 +- ...okeAsMemberExtensionToExplicitReceiver.txt | 2 +- .../tests/resolve/invoke/kt3772.kt | 4 +- .../tests/resolve/invoke/kt3772.txt | 4 +- .../invoke/kt3833-invokeInsideNestedClass.kt | 2 +- .../invoke/kt3833-invokeInsideNestedClass.txt | 2 +- .../resolve/invoke/kt4321InvokeOnEnum.kt | 4 +- .../resolve/invoke/kt4321InvokeOnEnum.txt | 4 +- .../nestedCalls/argumentsInParentheses.kt | 2 +- .../nestedCalls/argumentsInParentheses.txt | 2 +- .../ExhaustiveWhenWithAdditionalMember.txt | 4 +- .../secondaryConstructors/dataClasses.txt | 6 +- .../ShadowMultiDeclarationWithFunParameter.kt | 4 +- ...ShadowMultiDeclarationWithFunParameter.txt | 4 +- .../diagnostics/tests/smartCasts/fieldPlus.kt | 2 +- .../tests/smartCasts/fieldPlus.txt | 2 +- .../tests/smartCasts/inference/kt1355.kt | 2 +- .../tests/smartCasts/inference/kt1355.txt | 4 +- .../diagnostics/tests/smartCasts/kt2865.kt | 2 +- .../diagnostics/tests/smartCasts/kt2865.txt | 2 +- .../diagnostics/tests/smartCasts/kt3711.txt | 4 +- .../diagnostics/tests/smartCasts/kt3899.txt | 4 +- .../tests/smartCasts/safecalls/property.txt | 2 +- .../varnotnull/doWhileWithBreak.txt | 2 +- .../tests/smartCasts/varnotnull/forEach.txt | 2 +- .../varnotnull/forEachWithBreak.txt | 2 +- .../varnotnull/forEachWithContinue.txt | 2 +- .../varnotnull/infiniteWhileWithBreak.txt | 2 +- .../smartCasts/varnotnull/iterations.txt | 2 +- .../postfixNotnullClassIncrement.kt | 2 +- .../postfixNotnullClassIncrement.txt | 2 +- .../postfixNullableClassIncrement.kt | 2 +- .../postfixNullableClassIncrement.txt | 2 +- .../varnotnull/postfixNullableIncrement.kt | 2 +- .../varnotnull/postfixNullableIncrement.txt | 2 +- .../varnotnull/prefixNotnullClassIncrement.kt | 2 +- .../prefixNotnullClassIncrement.txt | 2 +- .../prefixNullableClassIncrement.kt | 2 +- .../prefixNullableClassIncrement.txt | 2 +- .../varnotnull/prefixNullableIncrement.kt | 2 +- .../varnotnull/prefixNullableIncrement.txt | 2 +- .../varnotnull/unnecessaryWithMap.kt | 6 +- .../varnotnull/unnecessaryWithMap.txt | 6 +- .../smartCasts/varnotnull/whileWithBreak.txt | 2 +- .../staticCallsInDynamicContext.kt | 8 +- .../staticCallsInDynamicContext.txt | 8 +- .../pseudocodeMemoryOverhead.txt | 10 +- .../ea66827_dataClassWrongToString.txt | 2 +- .../annotations/classes/DataClass.txt | 2 +- .../dataClass/MixedComponents.txt | 4 +- .../compiledKotlin/dataClass/OneVal.txt | 2 +- .../dataClass/OpenDataClass.txt | 2 +- .../dataClass/OpenPropertyFinalComponent.txt | 2 +- .../dataClass/ParamNameSameToField.txt | 2 +- .../compiledKotlin/dataClass/TwoVals.txt | 4 +- .../compiledKotlin/dataClass/TwoVars.txt | 4 +- compiler/testData/psi/examples/BitArith.kt | 8 +- compiler/testData/psi/examples/BitArith.txt | 14 +- .../simpleArrayAccess.txt | 2 +- idea/testData/checker/Builders.kt | 4 +- idea/testData/checker/ExtensionFunctions.kt | 6 +- idea/testData/checker/ForRangeConventions.kt | 34 +- idea/testData/checker/IncDec.kt | 12 +- idea/testData/checker/Shadowing.kt | 4 +- .../stubBuilder/DataClass/DataClass.txt | 4 +- .../highlighter/VariablesAsFunctions.kt | 2 +- idea/testData/highlighter/deprecated/Get.kt | 2 +- idea/testData/highlighter/deprecated/Inc.kt | 2 +- .../testData/highlighter/deprecated/Invoke.kt | 2 +- .../highlighter/deprecated/Operation.kt | 16 +- .../highlighter/deprecated/RangeTo.kt | 2 +- .../inapplicableOperator.kt | 2 +- .../autoImports/plusOperator.after.kt | 2 +- .../plusOperator.before.Dependency.kt | 2 +- .../autoImports/plusOperator.before.Main.kt | 2 +- .../timesAssign.before.Dependency.kt | 4 +- .../unaryMinusOperator.before.Dependency.kt | 2 +- .../autoImports/unaryPlusOperator.after.kt | 4 +- .../unaryPlusOperator.before.Dependency.kt | 2 +- .../unaryPlusOperator.before.Main.kt | 4 +- .../addParameterNotAvailableForBuiltins.kt | 2 +- .../notAvailableForSynthesized.kt | 2 +- .../conventions/containsRuntime.kt | 2 +- 319 files changed, 1034 insertions(+), 1032 deletions(-) diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 7516bbeea75..5adea951ca6 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -2,7 +2,7 @@ package-fragment kotlin public fun arrayOfNulls(/*0*/ size: kotlin.Int): kotlin.Array public fun kotlin.Any?.identityEquals(/*0*/ other: kotlin.Any?): kotlin.Boolean -public fun kotlin.String?.plus(/*0*/ other: kotlin.Any?): kotlin.String +public operator fun kotlin.String?.plus(/*0*/ other: kotlin.Any?): kotlin.String public fun kotlin.Any?.toString(): kotlin.String public interface Annotation { @@ -15,9 +15,9 @@ public open class Any { public final class Array : kotlin.Cloneable { /*primary*/ private constructor Array() public open override /*1*/ fun clone(): kotlin.Array - public final fun get(/*0*/ index: kotlin.Int): T - public final fun iterator(): kotlin.Iterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: T): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): T + public final operator fun iterator(): kotlin.Iterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: T): kotlin.Unit public final fun size(): kotlin.Int } @@ -25,7 +25,7 @@ public final class Boolean : kotlin.Comparable { /*primary*/ private constructor Boolean() public final fun and(/*0*/ other: kotlin.Boolean): kotlin.Boolean public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Boolean): kotlin.Int - public final fun not(): kotlin.Boolean + public final operator fun not(): kotlin.Boolean public final fun or(/*0*/ other: kotlin.Boolean): kotlin.Boolean public final fun xor(/*0*/ other: kotlin.Boolean): kotlin.Boolean } @@ -33,9 +33,9 @@ public final class Boolean : kotlin.Comparable { public final class BooleanArray : kotlin.Cloneable { /*primary*/ public constructor BooleanArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.BooleanArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Boolean - public final fun iterator(): kotlin.BooleanIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Boolean): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Boolean + public final operator fun iterator(): kotlin.BooleanIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Boolean): kotlin.Unit public final fun size(): kotlin.Int } @@ -49,51 +49,51 @@ public abstract class BooleanIterator : kotlin.Iterator { public final class Byte : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Byte() public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int - public final fun dec(): kotlin.Byte - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Float - public final fun div(/*0*/ other: kotlin.Int): kotlin.Int - public final fun div(/*0*/ other: kotlin.Long): kotlin.Long - public final fun div(/*0*/ other: kotlin.Short): kotlin.Int - public final fun inc(): kotlin.Byte - public final fun minus(): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int - public final fun plus(): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.ByteRange - public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange - public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.ShortRange - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Float - public final fun times(/*0*/ other: kotlin.Int): kotlin.Int - public final fun times(/*0*/ other: kotlin.Long): kotlin.Long - public final fun times(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun dec(): kotlin.Byte + public final operator fun div(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun inc(): kotlin.Byte + public final operator fun minus(): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun plus(): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.ByteRange + public final operator fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange + public final operator fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange + public final operator fun rangeTo(/*0*/ other: kotlin.Short): kotlin.ShortRange + public final operator fun times(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Int public open override /*1*/ fun toByte(): kotlin.Byte public open override /*1*/ fun toChar(): kotlin.Char public open override /*1*/ fun toDouble(): kotlin.Double @@ -114,9 +114,9 @@ public final class Byte : kotlin.Number, kotlin.Comparable { public final class ByteArray : kotlin.Cloneable { /*primary*/ public constructor ByteArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.ByteArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Byte - public final fun iterator(): kotlin.ByteIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Byte): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Byte + public final operator fun iterator(): kotlin.ByteIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Byte): kotlin.Unit public final fun size(): kotlin.Int } @@ -178,12 +178,12 @@ public final class ByteRange : kotlin.Range, kotlin.Progression { /*primary*/ private constructor Char() public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Char): kotlin.Int - public final fun dec(): kotlin.Char - public final fun inc(): kotlin.Char - public final fun minus(/*0*/ other: kotlin.Char): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Char - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Char - public final fun rangeTo(/*0*/ other: kotlin.Char): kotlin.CharRange + public final operator fun dec(): kotlin.Char + public final operator fun inc(): kotlin.Char + public final operator fun minus(/*0*/ other: kotlin.Char): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Char + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Char + public final operator fun rangeTo(/*0*/ other: kotlin.Char): kotlin.CharRange public open fun toByte(): kotlin.Byte public open fun toChar(): kotlin.Char public open fun toDouble(): kotlin.Double @@ -200,9 +200,9 @@ public final class Char : kotlin.Comparable { public final class CharArray : kotlin.Cloneable { /*primary*/ public constructor CharArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.CharArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Char - public final fun iterator(): kotlin.CharIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Char): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Char + public final operator fun iterator(): kotlin.CharIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Char): kotlin.Unit public final fun size(): kotlin.Int } @@ -272,7 +272,7 @@ public interface Cloneable { } public interface Collection : kotlin.Iterable { - public abstract fun contains(/*0*/ o: kotlin.Any?): kotlin.Boolean + public abstract operator fun contains(/*0*/ o: kotlin.Any?): kotlin.Boolean public abstract fun containsAll(/*0*/ c: kotlin.Collection): kotlin.Boolean public abstract fun isEmpty(): kotlin.Boolean public abstract override /*1*/ fun iterator(): kotlin.Iterator @@ -280,7 +280,7 @@ public interface Collection : kotlin.Iterable { } public interface Comparable { - public abstract fun compareTo(/*0*/ other: T): kotlin.Int + public abstract operator fun compareTo(/*0*/ other: T): kotlin.Int } @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.PROPERTY_GETTER}) @kotlin.annotation.MustBeDocumented() @kotlin.annotation.annotation() public final class Deprecated : kotlin.Annotation { @@ -293,52 +293,52 @@ public interface Comparable { public final class Double : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Double() - public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int - public final fun dec(): kotlin.Double - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Double - public final fun div(/*0*/ other: kotlin.Int): kotlin.Double - public final fun div(/*0*/ other: kotlin.Long): kotlin.Double - public final fun div(/*0*/ other: kotlin.Short): kotlin.Double - public final fun inc(): kotlin.Double - public final fun minus(): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Double - public final fun plus(): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Double - public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.DoubleRange - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Double - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Double - public final fun times(/*0*/ other: kotlin.Int): kotlin.Double - public final fun times(/*0*/ other: kotlin.Long): kotlin.Double - public final fun times(/*0*/ other: kotlin.Short): kotlin.Double + public final operator fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun dec(): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Byte): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Float): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Int): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Long): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Short): kotlin.Double + public final operator fun inc(): kotlin.Double + public final operator fun minus(): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Byte): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Float): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Long): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Short): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Byte): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Float): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Int): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Long): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Short): kotlin.Double + public final operator fun plus(): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Byte): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Float): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Long): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Short): kotlin.Double + public final operator fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Float): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Int): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Long): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Short): kotlin.DoubleRange + public final operator fun times(/*0*/ other: kotlin.Byte): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Float): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Double public open override /*1*/ fun toByte(): kotlin.Byte public open override /*1*/ fun toChar(): kotlin.Char public open override /*1*/ fun toDouble(): kotlin.Double @@ -365,9 +365,9 @@ public final class Double : kotlin.Number, kotlin.Comparable { public final class DoubleArray : kotlin.Cloneable { /*primary*/ public constructor DoubleArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.DoubleArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Double - public final fun iterator(): kotlin.DoubleIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Double): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Double + public final operator fun iterator(): kotlin.DoubleIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Double): kotlin.Unit public final fun size(): kotlin.Int } @@ -441,52 +441,52 @@ public abstract class Enum> : kotlin.Comparable { public final class Float : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Float() - public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int - public final fun dec(): kotlin.Float - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Float - public final fun div(/*0*/ other: kotlin.Int): kotlin.Float - public final fun div(/*0*/ other: kotlin.Long): kotlin.Float - public final fun div(/*0*/ other: kotlin.Short): kotlin.Float - public final fun inc(): kotlin.Float - public final fun minus(): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Float - public final fun plus(): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Float - public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.FloatRange - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Float - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Float - public final fun times(/*0*/ other: kotlin.Int): kotlin.Float - public final fun times(/*0*/ other: kotlin.Long): kotlin.Float - public final fun times(/*0*/ other: kotlin.Short): kotlin.Float + public final operator fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun dec(): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Byte): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Int): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Long): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Short): kotlin.Float + public final operator fun inc(): kotlin.Float + public final operator fun minus(): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Byte): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Long): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Short): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Byte): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Int): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Long): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Short): kotlin.Float + public final operator fun plus(): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Byte): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Long): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Short): kotlin.Float + public final operator fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Int): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Long): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Short): kotlin.FloatRange + public final operator fun times(/*0*/ other: kotlin.Byte): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Float public open override /*1*/ fun toByte(): kotlin.Byte public open override /*1*/ fun toChar(): kotlin.Char public open override /*1*/ fun toDouble(): kotlin.Double @@ -513,9 +513,9 @@ public final class Float : kotlin.Number, kotlin.Comparable { public final class FloatArray : kotlin.Cloneable { /*primary*/ public constructor FloatArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.FloatArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Float - public final fun iterator(): kotlin.FloatIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Float): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Float + public final operator fun iterator(): kotlin.FloatIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Float): kotlin.Unit public final fun size(): kotlin.Int } @@ -594,56 +594,56 @@ public interface Function { public final class Int : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Int() public final fun and(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int - public final fun dec(): kotlin.Int - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Float - public final fun div(/*0*/ other: kotlin.Int): kotlin.Int - public final fun div(/*0*/ other: kotlin.Long): kotlin.Long - public final fun div(/*0*/ other: kotlin.Short): kotlin.Int - public final fun inc(): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun dec(): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun inc(): kotlin.Int public final fun inv(): kotlin.Int - public final fun minus(): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun minus(): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Short): kotlin.Int public final fun or(/*0*/ other: kotlin.Int): kotlin.Int - public final fun plus(): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.IntRange - public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange - public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.IntRange + public final operator fun plus(): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.IntRange + public final operator fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange + public final operator fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange + public final operator fun rangeTo(/*0*/ other: kotlin.Short): kotlin.IntRange public final fun shl(/*0*/ bits: kotlin.Int): kotlin.Int public final fun shr(/*0*/ bits: kotlin.Int): kotlin.Int - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Float - public final fun times(/*0*/ other: kotlin.Int): kotlin.Int - public final fun times(/*0*/ other: kotlin.Long): kotlin.Long - public final fun times(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Int public open override /*1*/ fun toByte(): kotlin.Byte public open override /*1*/ fun toChar(): kotlin.Char public open override /*1*/ fun toDouble(): kotlin.Double @@ -666,9 +666,9 @@ public final class Int : kotlin.Number, kotlin.Comparable { public final class IntArray : kotlin.Cloneable { /*primary*/ public constructor IntArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.IntArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Int - public final fun iterator(): kotlin.IntIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Int + public final operator fun iterator(): kotlin.IntIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit public final fun size(): kotlin.Int } @@ -735,18 +735,18 @@ public interface IntegerConstants { } public interface Iterable { - public abstract fun iterator(): kotlin.Iterator + public abstract operator fun iterator(): kotlin.Iterator } public interface Iterator { - public abstract fun hasNext(): kotlin.Boolean - public abstract fun next(): T + public abstract operator fun hasNext(): kotlin.Boolean + public abstract operator fun next(): T } public interface List : kotlin.Collection { public abstract override /*1*/ fun contains(/*0*/ o: kotlin.Any?): kotlin.Boolean public abstract override /*1*/ fun containsAll(/*0*/ c: kotlin.Collection): kotlin.Boolean - public abstract fun get(/*0*/ index: kotlin.Int): E + public abstract operator fun get(/*0*/ index: kotlin.Int): E public abstract fun indexOf(/*0*/ o: kotlin.Any?): kotlin.Int public abstract override /*1*/ fun isEmpty(): kotlin.Boolean public abstract override /*1*/ fun iterator(): kotlin.Iterator @@ -769,56 +769,56 @@ public interface ListIterator : kotlin.Iterator { public final class Long : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Long() public final fun and(/*0*/ other: kotlin.Long): kotlin.Long - public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int - public final fun dec(): kotlin.Long - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Float - public final fun div(/*0*/ other: kotlin.Int): kotlin.Long - public final fun div(/*0*/ other: kotlin.Long): kotlin.Long - public final fun div(/*0*/ other: kotlin.Short): kotlin.Long - public final fun inc(): kotlin.Long + public final operator fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun dec(): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Byte): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Int): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Short): kotlin.Long + public final operator fun inc(): kotlin.Long public final fun inv(): kotlin.Long - public final fun minus(): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Long + public final operator fun minus(): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Byte): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Short): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Byte): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Int): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Short): kotlin.Long public final fun or(/*0*/ other: kotlin.Long): kotlin.Long - public final fun plus(): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Long - public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.LongRange + public final operator fun plus(): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Byte): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Short): kotlin.Long + public final operator fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.LongRange + public final operator fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Int): kotlin.LongRange + public final operator fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange + public final operator fun rangeTo(/*0*/ other: kotlin.Short): kotlin.LongRange public final fun shl(/*0*/ bits: kotlin.Int): kotlin.Long public final fun shr(/*0*/ bits: kotlin.Int): kotlin.Long - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Long - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Float - public final fun times(/*0*/ other: kotlin.Int): kotlin.Long - public final fun times(/*0*/ other: kotlin.Long): kotlin.Long - public final fun times(/*0*/ other: kotlin.Short): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Byte): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Long public open override /*1*/ fun toByte(): kotlin.Byte public open override /*1*/ fun toChar(): kotlin.Char public open override /*1*/ fun toDouble(): kotlin.Double @@ -841,9 +841,9 @@ public final class Long : kotlin.Number, kotlin.Comparable { public final class LongArray : kotlin.Cloneable { /*primary*/ public constructor LongArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.LongArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Long - public final fun iterator(): kotlin.LongIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Long): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Long + public final operator fun iterator(): kotlin.LongIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Long): kotlin.Unit public final fun size(): kotlin.Int } @@ -906,7 +906,7 @@ public interface Map { public abstract fun containsKey(/*0*/ key: kotlin.Any?): kotlin.Boolean public abstract fun containsValue(/*0*/ value: kotlin.Any?): kotlin.Boolean public abstract fun entrySet(): kotlin.Set> - public abstract fun get(/*0*/ key: kotlin.Any?): V? + public abstract operator fun get(/*0*/ key: kotlin.Any?): V? public abstract fun isEmpty(): kotlin.Boolean public abstract fun keySet(): kotlin.Set public abstract fun size(): kotlin.Int @@ -961,7 +961,7 @@ public interface MutableList : kotlin.List, kotlin.MutableCollection public abstract fun remove(/*0*/ index: kotlin.Int): E public abstract override /*1*/ fun removeAll(/*0*/ c: kotlin.Collection): kotlin.Boolean public abstract override /*1*/ fun retainAll(/*0*/ c: kotlin.Collection): kotlin.Boolean - public abstract fun set(/*0*/ index: kotlin.Int, /*1*/ element: E): E + public abstract operator fun set(/*0*/ index: kotlin.Int, /*1*/ element: E): E public abstract override /*2*/ /*fake_override*/ fun size(): kotlin.Int public abstract override /*1*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.MutableList } @@ -1047,7 +1047,7 @@ public interface PropertyMetadata { /*primary*/ public constructor PropertyMetadataImpl(/*0*/ name: kotlin.String) public open override /*1*/ val name: kotlin.String public open override /*1*/ fun (): kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ name: kotlin.String = ...): kotlin.PropertyMetadataImpl } @@ -1056,7 +1056,7 @@ public interface Range> { public abstract fun (): T public abstract val start: T public abstract fun (): T - public abstract fun contains(/*0*/ item: T): kotlin.Boolean + public abstract operator fun contains(/*0*/ item: T): kotlin.Boolean public open fun isEmpty(): kotlin.Boolean } @@ -1078,52 +1078,52 @@ public interface Set : kotlin.Collection { public final class Short : kotlin.Number, kotlin.Comparable { /*primary*/ private constructor Short() - public final fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int - public final fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Double): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Float): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun compareTo(/*0*/ other: kotlin.Long): kotlin.Int public open override /*1*/ fun compareTo(/*0*/ other: kotlin.Short): kotlin.Int - public final fun dec(): kotlin.Short - public final fun div(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun div(/*0*/ other: kotlin.Double): kotlin.Double - public final fun div(/*0*/ other: kotlin.Float): kotlin.Float - public final fun div(/*0*/ other: kotlin.Int): kotlin.Int - public final fun div(/*0*/ other: kotlin.Long): kotlin.Long - public final fun div(/*0*/ other: kotlin.Short): kotlin.Int - public final fun inc(): kotlin.Short - public final fun minus(): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun minus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun minus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun minus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun minus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Double): kotlin.Double - public final fun mod(/*0*/ other: kotlin.Float): kotlin.Float - public final fun mod(/*0*/ other: kotlin.Int): kotlin.Int - public final fun mod(/*0*/ other: kotlin.Long): kotlin.Long - public final fun mod(/*0*/ other: kotlin.Short): kotlin.Int - public final fun plus(): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Double): kotlin.Double - public final fun plus(/*0*/ other: kotlin.Float): kotlin.Float - public final fun plus(/*0*/ other: kotlin.Int): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Long): kotlin.Long - public final fun plus(/*0*/ other: kotlin.Short): kotlin.Int - public final fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.ShortRange - public final fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange - public final fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange - public final fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange - public final fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange - public final fun rangeTo(/*0*/ other: kotlin.Short): kotlin.ShortRange - public final fun times(/*0*/ other: kotlin.Byte): kotlin.Int - public final fun times(/*0*/ other: kotlin.Double): kotlin.Double - public final fun times(/*0*/ other: kotlin.Float): kotlin.Float - public final fun times(/*0*/ other: kotlin.Int): kotlin.Int - public final fun times(/*0*/ other: kotlin.Long): kotlin.Long - public final fun times(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun dec(): kotlin.Short + public final operator fun div(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun div(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun div(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun div(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun div(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun inc(): kotlin.Short + public final operator fun minus(): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun minus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun minus(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun minus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun minus(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun mod(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun mod(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun mod(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun mod(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun plus(): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun plus(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun plus(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun plus(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun plus(/*0*/ other: kotlin.Short): kotlin.Int + public final operator fun rangeTo(/*0*/ other: kotlin.Byte): kotlin.ShortRange + public final operator fun rangeTo(/*0*/ other: kotlin.Double): kotlin.DoubleRange + public final operator fun rangeTo(/*0*/ other: kotlin.Float): kotlin.FloatRange + public final operator fun rangeTo(/*0*/ other: kotlin.Int): kotlin.IntRange + public final operator fun rangeTo(/*0*/ other: kotlin.Long): kotlin.LongRange + public final operator fun rangeTo(/*0*/ other: kotlin.Short): kotlin.ShortRange + public final operator fun times(/*0*/ other: kotlin.Byte): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Double): kotlin.Double + public final operator fun times(/*0*/ other: kotlin.Float): kotlin.Float + public final operator fun times(/*0*/ other: kotlin.Int): kotlin.Int + public final operator fun times(/*0*/ other: kotlin.Long): kotlin.Long + public final operator fun times(/*0*/ other: kotlin.Short): kotlin.Int public open override /*1*/ fun toByte(): kotlin.Byte public open override /*1*/ fun toChar(): kotlin.Char public open override /*1*/ fun toDouble(): kotlin.Double @@ -1144,9 +1144,9 @@ public final class Short : kotlin.Number, kotlin.Comparable { public final class ShortArray : kotlin.Cloneable { /*primary*/ public constructor ShortArray(/*0*/ size: kotlin.Int) public open override /*1*/ fun clone(): kotlin.ShortArray - public final fun get(/*0*/ index: kotlin.Int): kotlin.Short - public final fun iterator(): kotlin.ShortIterator - public final fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Short): kotlin.Unit + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Short + public final operator fun iterator(): kotlin.ShortIterator + public final operator fun set(/*0*/ index: kotlin.Int, /*1*/ value: kotlin.Short): kotlin.Unit public final fun size(): kotlin.Int } @@ -1209,9 +1209,9 @@ public final class String : kotlin.Comparable, kotlin.CharSequenc /*primary*/ public constructor String() public open override /*1*/ fun charAt(/*0*/ index: kotlin.Int): kotlin.Char public open override /*1*/ fun compareTo(/*0*/ other: kotlin.String): kotlin.Int - public final fun get(/*0*/ index: kotlin.Int): kotlin.Char + public final operator fun get(/*0*/ index: kotlin.Int): kotlin.Char public open override /*1*/ fun length(): kotlin.Int - public final fun plus(/*0*/ other: kotlin.Any?): kotlin.String + public final operator fun plus(/*0*/ other: kotlin.Any?): kotlin.String public open override /*1*/ fun subSequence(/*0*/ start: kotlin.Int, /*1*/ end: kotlin.Int): kotlin.CharSequence public companion object Companion { diff --git a/compiler/testData/cli/jvm/wrongAbiVersion.out b/compiler/testData/cli/jvm/wrongAbiVersion.out index d1e7f34210f..a3d55e4cf77 100644 --- a/compiler/testData/cli/jvm/wrongAbiVersion.out +++ b/compiler/testData/cli/jvm/wrongAbiVersion.out @@ -3,10 +3,10 @@ compiler/testData/cli/jvm/wrongAbiVersion.kt:4:5: error: unresolved reference: b bar() ^ compiler/testData/cli/jvm/wrongAbiVersion.kt:6:7: error: unresolved reference. None of the following candidates is applicable because of receiver type mismatch: -public fun kotlin.MutableMap.set(key: kotlin.Int, value: kotlin.Int): kotlin.Int? defined in kotlin +public operator fun kotlin.MutableMap.set(key: kotlin.Int, value: kotlin.Int): kotlin.Int? defined in kotlin (note: this may be caused by the fact that some classes compiled with an incompatible version of Kotlin were found in the classpath. Such classes cannot be loaded properly by this version of Kotlin compiler. See below for more information) 1.set(2, 3) ^ compiler/testData/cli/jvm/wrongAbiVersionLib/bin/ClassWithWrongAbiVersion.class: error: class 'ClassWithWrongAbiVersion' was compiled with an incompatible version of Kotlin. Its ABI version is unknown, expected ABI version is $ABI_VERSION$ compiler/testData/cli/jvm/wrongAbiVersionLib/bin/wrong/WrongPackage.class: error: class 'wrong/WrongPackage' was compiled with an incompatible version of Kotlin. Its ABI version is unknown, expected ABI version is $ABI_VERSION$ -COMPILATION_ERROR +COMPILATION_ERROR \ No newline at end of file diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.kt index 060c5e8b467..5f7fbce55f9 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.kt @@ -1,6 +1,6 @@ class A { companion object { - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } } diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.txt index ffe84231c46..29670b42fcb 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject1.txt @@ -12,7 +12,7 @@ public final class A { private constructor Companion() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.kt index 45495ff0179..b808ed09f6a 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.kt @@ -1,6 +1,6 @@ interface B -fun B.invoke(i: Int) = i +operator fun B.invoke(i: Int) = i class A { companion object: B { diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.txt index f548f75f5f6..6ab8e9be9be 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObject2.txt @@ -1,7 +1,7 @@ package public fun box(): kotlin.String -public fun B.invoke(/*0*/ i: kotlin.Int): kotlin.Int +public operator fun B.invoke(/*0*/ i: kotlin.Int): kotlin.Int public final class A { public constructor A() diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.kt index 27a700dd08a..dcc924a9ba8 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.kt @@ -1,7 +1,7 @@ class A { class Nested { companion object { - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } } } diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.txt index 49969693e72..4722c798bb3 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass1.txt @@ -18,7 +18,7 @@ public final class A { private constructor Companion() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.kt index 82f96ee54a5..85b73084d1a 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.kt @@ -3,7 +3,7 @@ import A.Nested class A { class Nested { companion object { - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } } } diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.txt index 49969693e72..4722c798bb3 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnClassObjectOfNestedClass2.txt @@ -18,7 +18,7 @@ public final class A { private constructor Companion() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.kt index 6a9d1bc73b3..6491d8e0cc9 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.kt @@ -2,7 +2,7 @@ enum class A { ONE, TWO; - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } fun box() = if (A.ONE(42) == 42) "OK" else "fail" diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.txt index 6194ca538ed..532934f983e 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum1.txt @@ -12,7 +12,7 @@ public final enum class A : kotlin.Enum { public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public final override /*1*/ /*fake_override*/ fun name(): kotlin.String public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.kt index 24db38cf2dd..95eb4b9c827 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.kt @@ -3,6 +3,6 @@ enum class A { TWO } -fun A.invoke(i: Int) = i +operator fun A.invoke(i: Int) = i fun box() = if (A.ONE(42) == 42) "OK" else "fail" diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.txt index 7ab6a9018ce..336e43034c7 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnEnum2.txt @@ -1,7 +1,7 @@ package public fun box(): kotlin.String -public fun A.invoke(/*0*/ i: kotlin.Int): kotlin.Int +public operator fun A.invoke(/*0*/ i: kotlin.Int): kotlin.Int public final enum class A : kotlin.Enum { enum entry ONE diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.kt index 5533fc8e3ee..d627dad85a8 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.kt @@ -4,7 +4,7 @@ enum class A { ONE, TWO; - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } fun box() = if (ONE(42) == 42) "OK" else "fail" diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.txt index 6194ca538ed..532934f983e 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum1.txt @@ -12,7 +12,7 @@ public final enum class A : kotlin.Enum { public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public final override /*1*/ /*fake_override*/ fun name(): kotlin.String public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.kt index 81a18fa173b..53ecfc65908 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.kt @@ -5,6 +5,6 @@ enum class A { TWO } -fun A.invoke(i: Int) = i +operator fun A.invoke(i: Int) = i fun box() = if (ONE(42) == 42) "OK" else "fail" diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.txt index 7ab6a9018ce..336e43034c7 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnImportedEnum2.txt @@ -1,7 +1,7 @@ package public fun box(): kotlin.String -public fun A.invoke(/*0*/ i: kotlin.Int): kotlin.Int +public operator fun A.invoke(/*0*/ i: kotlin.Int): kotlin.Int public final enum class A : kotlin.Enum { enum entry ONE diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.kt index d97fd73eda8..e14c1acefc4 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.kt @@ -1,5 +1,5 @@ object A -fun A.invoke(i: Int) = i +operator fun A.invoke(i: Int) = i fun box() = if (A(42) == 42) "OK" else "fail" \ No newline at end of file diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.txt index b9f1ab4bf5c..cb0f049e350 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject1.txt @@ -1,7 +1,7 @@ package public fun box(): kotlin.String -public fun A.invoke(/*0*/ i: kotlin.Int): kotlin.Int +public operator fun A.invoke(/*0*/ i: kotlin.Int): kotlin.Int public object A { private constructor A() diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.kt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.kt index 2a159deb7ab..fc16215881c 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.kt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.kt @@ -1,5 +1,5 @@ object A { - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } fun box() = if (A(42) == 42) "OK" else "fail" \ No newline at end of file diff --git a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.txt b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.txt index c9970a4cd86..a0046e7528d 100644 --- a/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.txt +++ b/compiler/testData/codegen/box/diagnostics/functions/invoke/onObjects/invokeOnObject2.txt @@ -6,6 +6,6 @@ public object A { private constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/codegen/boxWithStdlib/ranges/rangeContainsString.kt b/compiler/testData/codegen/boxWithStdlib/ranges/rangeContainsString.kt index 8636de58cea..9e2c9269f96 100644 --- a/compiler/testData/codegen/boxWithStdlib/ranges/rangeContainsString.kt +++ b/compiler/testData/codegen/boxWithStdlib/ranges/rangeContainsString.kt @@ -1,4 +1,4 @@ -fun IntRange.contains(s: String): Boolean = true +operator fun IntRange.contains(s: String): Boolean = true fun box(): String { return if ("s" in 0..1) "OK" else "fail" diff --git a/compiler/testData/diagnostics/tests/Builders.kt b/compiler/testData/diagnostics/tests/Builders.kt index 0d539318003..d62bc829d81 100644 --- a/compiler/testData/diagnostics/tests/Builders.kt +++ b/compiler/testData/diagnostics/tests/Builders.kt @@ -93,7 +93,7 @@ abstract class Tag(val name : String) : Element { } abstract class TagWithText(name : String) : Tag(name) { - fun String.plus() { + operator fun String.plus() { children.add(TextElement(this)) } } @@ -148,7 +148,7 @@ fun html(init : HTML.() -> Unit) : HTML { } // An excerpt from the Standard Library -fun MutableMap.set(key : K, value : V) = this.put(key, value) +operator fun MutableMap.set(key : K, value : V) = this.put(key, value) fun println(message : Any?) { System.out.println(message) diff --git a/compiler/testData/diagnostics/tests/Builders.txt b/compiler/testData/diagnostics/tests/Builders.txt index 97ac89b6aa1..bad460e67db 100644 --- a/compiler/testData/diagnostics/tests/Builders.txt +++ b/compiler/testData/diagnostics/tests/Builders.txt @@ -5,7 +5,7 @@ package html { public fun main(/*0*/ args: kotlin.Array): kotlin.Unit public fun print(/*0*/ message: kotlin.Any?): kotlin.Unit public fun println(/*0*/ message: kotlin.Any?): kotlin.Unit - public fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? + public operator fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? public final class A : html.BodyTag { public constructor A() @@ -203,7 +203,7 @@ package html { public open override /*1*/ /*fake_override*/ fun render(/*0*/ builder: java.lang.StringBuilder, /*1*/ indent: kotlin.String): kotlin.Unit invisible_fake final override /*1*/ /*fake_override*/ fun renderAttributes(): kotlin.String? public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public final fun kotlin.String.plus(): kotlin.Unit + public final operator fun kotlin.String.plus(): kotlin.Unit } public final class TextElement : html.Element { diff --git a/compiler/testData/diagnostics/tests/ForRangeConventions.kt b/compiler/testData/diagnostics/tests/ForRangeConventions.kt index f955f79ed6f..e920f5195b4 100644 --- a/compiler/testData/diagnostics/tests/ForRangeConventions.kt +++ b/compiler/testData/diagnostics/tests/ForRangeConventions.kt @@ -7,73 +7,73 @@ class NotRange1() { } abstract class NotRange2() { - abstract fun iterator() : Unit + abstract operator fun iterator() : Unit } abstract class ImproperIterator1 { - abstract fun hasNext() : Boolean + abstract operator fun hasNext() : Boolean } abstract class NotRange3() { - abstract fun iterator() : ImproperIterator1 + abstract operator fun iterator() : ImproperIterator1 } abstract class ImproperIterator2 { - abstract fun next() : Boolean + abstract operator fun next() : Boolean } abstract class NotRange4() { - abstract fun iterator() : ImproperIterator2 + abstract operator fun iterator() : ImproperIterator2 } abstract class ImproperIterator3 { - abstract fun hasNext() : Int - abstract fun next() : Int + abstract operator fun hasNext() : Int + abstract operator fun next() : Int } abstract class NotRange5() { - abstract fun iterator() : ImproperIterator3 + abstract operator fun iterator() : ImproperIterator3 } abstract class AmbiguousHasNextIterator { - abstract fun hasNext() : Boolean + abstract operator fun hasNext() : Boolean val hasNext : Boolean get() = false - abstract fun next() : Int + abstract operator fun next() : Int } abstract class NotRange6() { - abstract fun iterator() : AmbiguousHasNextIterator + abstract operator fun iterator() : AmbiguousHasNextIterator } abstract class ImproperIterator4 { val hasNext : Int get() = 1 - abstract fun next() : Int + abstract operator fun next() : Int } abstract class NotRange7() { - abstract fun iterator() : ImproperIterator3 + abstract operator fun iterator() : ImproperIterator3 } abstract class GoodIterator { - abstract fun hasNext() : Boolean - abstract fun next() : Int + abstract operator fun hasNext() : Boolean + abstract operator fun next() : Int } abstract class Range0() { - abstract fun iterator() : GoodIterator + abstract operator fun iterator() : GoodIterator } abstract class Range1() { - abstract fun iterator() : Iterator + abstract operator fun iterator() : Iterator } abstract class ImproperIterator5 { abstract val String.hasNext : Boolean - abstract fun next() : Int + abstract operator fun next() : Int } abstract class NotRange8() { - abstract fun iterator() : ImproperIterator5 + abstract operator fun iterator() : ImproperIterator5 } diff --git a/compiler/testData/diagnostics/tests/ForRangeConventions.txt b/compiler/testData/diagnostics/tests/ForRangeConventions.txt index d7a71f29c14..1ed12ef85d5 100644 --- a/compiler/testData/diagnostics/tests/ForRangeConventions.txt +++ b/compiler/testData/diagnostics/tests/ForRangeConventions.txt @@ -6,25 +6,25 @@ public abstract class AmbiguousHasNextIterator { public constructor AmbiguousHasNextIterator() public final val hasNext: kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract fun hasNext(): kotlin.Boolean + public abstract operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): kotlin.Int + public abstract operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public abstract class GoodIterator { public constructor GoodIterator() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract fun hasNext(): kotlin.Boolean + public abstract operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): kotlin.Int + public abstract operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public abstract class ImproperIterator1 { public constructor ImproperIterator1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract fun hasNext(): kotlin.Boolean + public abstract operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -33,16 +33,16 @@ public abstract class ImproperIterator2 { public constructor ImproperIterator2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): kotlin.Boolean + public abstract operator fun next(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public abstract class ImproperIterator3 { public constructor ImproperIterator3() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract fun hasNext(): kotlin.Int + public abstract operator fun hasNext(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): kotlin.Int + public abstract operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -51,7 +51,7 @@ public abstract class ImproperIterator4 { public final val hasNext: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): kotlin.Int + public abstract operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -60,7 +60,7 @@ public abstract class ImproperIterator5 { public abstract val kotlin.String.hasNext: kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): kotlin.Int + public abstract operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -75,7 +75,7 @@ public abstract class NotRange2 { public constructor NotRange2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): kotlin.Unit + public abstract operator fun iterator(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -83,7 +83,7 @@ public abstract class NotRange3 { public constructor NotRange3() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): ImproperIterator1 + public abstract operator fun iterator(): ImproperIterator1 public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -91,7 +91,7 @@ public abstract class NotRange4 { public constructor NotRange4() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): ImproperIterator2 + public abstract operator fun iterator(): ImproperIterator2 public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -99,7 +99,7 @@ public abstract class NotRange5 { public constructor NotRange5() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): ImproperIterator3 + public abstract operator fun iterator(): ImproperIterator3 public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -107,7 +107,7 @@ public abstract class NotRange6 { public constructor NotRange6() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): AmbiguousHasNextIterator + public abstract operator fun iterator(): AmbiguousHasNextIterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -115,7 +115,7 @@ public abstract class NotRange7 { public constructor NotRange7() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): ImproperIterator3 + public abstract operator fun iterator(): ImproperIterator3 public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -123,7 +123,7 @@ public abstract class NotRange8 { public constructor NotRange8() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): ImproperIterator5 + public abstract operator fun iterator(): ImproperIterator5 public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -131,7 +131,7 @@ public abstract class Range0 { public constructor Range0() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): GoodIterator + public abstract operator fun iterator(): GoodIterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -139,6 +139,6 @@ public abstract class Range1 { public constructor Range1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun iterator(): kotlin.Iterator + public abstract operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/IncDec.kt b/compiler/testData/diagnostics/tests/IncDec.kt index 9b3fcc8512a..648100d67a3 100644 --- a/compiler/testData/diagnostics/tests/IncDec.kt +++ b/compiler/testData/diagnostics/tests/IncDec.kt @@ -1,6 +1,6 @@ class IncDec() { - fun inc() : IncDec = this - fun dec() : IncDec = this + operator fun inc() : IncDec = this + operator fun dec() : IncDec = this } fun testIncDec() { @@ -16,8 +16,8 @@ fun testIncDec() { } class WrongIncDec() { - fun inc() : Int = 1 - fun dec() : Int = 1 + operator fun inc() : Int = 1 + operator fun dec() : Int = 1 } fun testWrongIncDec() { @@ -29,8 +29,8 @@ fun testWrongIncDec() { } class UnitIncDec() { - fun inc() : Unit {} - fun dec() : Unit {} + operator fun inc() : Unit {} + operator fun dec() : Unit {} } fun testUnitIncDec() { diff --git a/compiler/testData/diagnostics/tests/IncDec.txt b/compiler/testData/diagnostics/tests/IncDec.txt index adf43d1c462..01129a22365 100644 --- a/compiler/testData/diagnostics/tests/IncDec.txt +++ b/compiler/testData/diagnostics/tests/IncDec.txt @@ -6,27 +6,27 @@ public fun testWrongIncDec(): kotlin.Unit public final class IncDec { public constructor IncDec() - public final fun dec(): IncDec + public final operator fun dec(): IncDec public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun inc(): IncDec + public final operator fun inc(): IncDec public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class UnitIncDec { public constructor UnitIncDec() - public final fun dec(): kotlin.Unit + public final operator fun dec(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun inc(): kotlin.Unit + public final operator fun inc(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class WrongIncDec { public constructor WrongIncDec() - public final fun dec(): kotlin.Int + public final operator fun dec(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun inc(): kotlin.Int + public final operator fun inc(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/UnusedVariables.kt b/compiler/testData/diagnostics/tests/UnusedVariables.kt index 1d1822663a4..afd4c811a62 100644 --- a/compiler/testData/diagnostics/tests/UnusedVariables.kt +++ b/compiler/testData/diagnostics/tests/UnusedVariables.kt @@ -13,8 +13,8 @@ fun testSimpleCases() { } class IncDec() { - fun inc() : IncDec = this - fun dec() : IncDec = this + operator fun inc() : IncDec = this + operator fun dec() : IncDec = this } class MyTest() { diff --git a/compiler/testData/diagnostics/tests/UnusedVariables.txt b/compiler/testData/diagnostics/tests/UnusedVariables.txt index f2135eaa31a..08bc71d9dad 100644 --- a/compiler/testData/diagnostics/tests/UnusedVariables.txt +++ b/compiler/testData/diagnostics/tests/UnusedVariables.txt @@ -10,10 +10,10 @@ package unused_variables { public final class IncDec { public constructor IncDec() - public final fun dec(): unused_variables.IncDec + public final operator fun dec(): unused_variables.IncDec public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun inc(): unused_variables.IncDec + public final operator fun inc(): unused_variables.IncDec public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt b/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt index 0dea7da9aa2..1d9819d4b07 100644 --- a/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt +++ b/compiler/testData/diagnostics/tests/annotations/ConstructorCall.kt @@ -29,7 +29,7 @@ fun bar(a: Ann = Ann()) { if (a is Ann) {} } -fun String.invoke() {} +operator fun String.invoke() {} // from stdlib fun javaClass() : Class = null as Class diff --git a/compiler/testData/diagnostics/tests/annotations/ConstructorCall.txt b/compiler/testData/diagnostics/tests/annotations/ConstructorCall.txt index 389d4f37e2f..cbd95461381 100644 --- a/compiler/testData/diagnostics/tests/annotations/ConstructorCall.txt +++ b/compiler/testData/diagnostics/tests/annotations/ConstructorCall.txt @@ -5,7 +5,7 @@ package public fun bar(/*0*/ a: Ann = ...): kotlin.Unit public fun foo(): kotlin.Unit public fun javaClass(): java.lang.Class -public fun kotlin.String.invoke(): kotlin.Unit +public operator fun kotlin.String.invoke(): kotlin.Unit @kotlin.annotation.annotation() public final class Ann : kotlin.Annotation { public constructor Ann() diff --git a/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt b/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt index 24773a99689..8da60a4ae83 100644 --- a/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt +++ b/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt @@ -13,8 +13,8 @@ public fun foo(): kotlin.Int public constructor Pair(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) public final val x: kotlin.Int public final val y: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): Pair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.txt b/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.txt index ab3452b6cf6..ceeb787f8c7 100644 --- a/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.txt +++ b/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.txt @@ -7,8 +7,8 @@ public fun foo(): kotlin.Unit public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) public final val x: kotlin.Int public final val y: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.txt b/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.txt index 37e50cfea65..df3be20e649 100644 --- a/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.txt +++ b/compiler/testData/diagnostics/tests/annotations/onMultiDeclaration.txt @@ -6,8 +6,8 @@ public fun test(): kotlin.Any? public constructor P(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int) public final val a: kotlin.Int public final val b: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ a: kotlin.Int = ..., /*1*/ b: kotlin.Int = ...): P public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/options/multiDeclaration.txt b/compiler/testData/diagnostics/tests/annotations/options/multiDeclaration.txt index c4ce5a1f57f..5a77e5822dc 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/multiDeclaration.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/multiDeclaration.txt @@ -13,8 +13,8 @@ public fun foo(): kotlin.Int public constructor Pair(/*0*/ a: kotlin.Int, /*1*/ b: kotlin.Int) public final val a: kotlin.Int public final val b: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ a: kotlin.Int = ..., /*1*/ b: kotlin.Int = ...): Pair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/annotations/options/target.txt b/compiler/testData/diagnostics/tests/annotations/options/target.txt index be92c218594..740e7f0b05a 100644 --- a/compiler/testData/diagnostics/tests/annotations/options/target.txt +++ b/compiler/testData/diagnostics/tests/annotations/options/target.txt @@ -3,7 +3,7 @@ package @base() @kotlin.data() public final class My { public constructor My(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): My public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/cast/DowncastMap.kt b/compiler/testData/diagnostics/tests/cast/DowncastMap.kt index 7bf0df122ee..957e89dd2fa 100644 --- a/compiler/testData/diagnostics/tests/cast/DowncastMap.kt +++ b/compiler/testData/diagnostics/tests/cast/DowncastMap.kt @@ -1,6 +1,6 @@ interface Map interface MutableMap: Map { - fun set(k: K, v: V) + operator fun set(k: K, v: V) } fun p(p: Map) { diff --git a/compiler/testData/diagnostics/tests/cast/DowncastMap.txt b/compiler/testData/diagnostics/tests/cast/DowncastMap.txt index 439b2ff78de..caee828d582 100644 --- a/compiler/testData/diagnostics/tests/cast/DowncastMap.txt +++ b/compiler/testData/diagnostics/tests/cast/DowncastMap.txt @@ -11,6 +11,6 @@ public interface Map { public interface MutableMap : Map { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun set(/*0*/ k: K, /*1*/ v: V): kotlin.Unit + public abstract operator fun set(/*0*/ k: K, /*1*/ v: V): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.kt index 63c2571b0ca..66c20c12352 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.kt @@ -17,7 +17,7 @@ fun test3() { fun throwNPE() = null!! class A { - fun plus(a: A): Nothing = throw Exception() + operator fun plus(a: A): Nothing = throw Exception() } fun bar() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.txt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.txt index 5f2bbacb7de..805383764c2 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.txt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeFromDifferentSources.txt @@ -11,7 +11,7 @@ package c { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plus(/*0*/ a: c.A): kotlin.Nothing + public final operator fun plus(/*0*/ a: c.A): kotlin.Nothing public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInArrayAccess.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInArrayAccess.kt index b9109c096c9..ceb3f3934b7 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInArrayAccess.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInArrayAccess.kt @@ -5,12 +5,12 @@ fun testArrayAccess1(array: Array) { } fun testArrayAccess2() { - fun Nothing.get(i: Int, s: String) {} + operator fun Nothing.get(i: Int, s: String) {} todo()[1, ""] } fun testAraryAccess3() { - fun Nothing.get(n: Nothing) {} + operator fun Nothing.get(n: Nothing) {} todo()[todo()] } @@ -23,17 +23,17 @@ fun testArrayAssignment2(array: Array) { } fun testArrayAssignment3(n: Nothing) { - fun Nothing.set(i: Int, j: Int) {} + operator fun Nothing.set(i: Int, j: Int) {} n[1] = 2 } fun testArrayAssignment4(n: Nothing) { - fun Nothing.set(i: Int, a: Any) {} + operator fun Nothing.set(i: Int, a: Any) {} n[1] = todo() } fun testArrayPlusAssign(array: Array) { - fun Any.plusAssign(a: Any) {} + operator fun Any.plusAssign(a: Any) {} array[1] += todo() } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInAssignment.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInAssignment.kt index 85e9e23aaf0..24236d66ba8 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInAssignment.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInAssignment.kt @@ -8,7 +8,7 @@ fun testVariableDeclaration() { } fun testPlusAssign() { - fun Int.plusAssign(i: Int) {} + operator fun Int.plusAssign(i: Int) {} var a = 1 a += todo() diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInBinaryExpressions.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInBinaryExpressions.kt index 35a6a6393a9..a52ce2c7d3e 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInBinaryExpressions.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInBinaryExpressions.kt @@ -1,5 +1,5 @@ fun testBinary1() { - fun Int.times(s: String) {} + operator fun Int.times(s: String) {} todo() * "" } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInInnerExpressions.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInInnerExpressions.kt index 16f1395f857..977a63b4fc7 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInInnerExpressions.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInInnerExpressions.kt @@ -1,12 +1,12 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun testCompound() { - fun Nothing.get(i: Int) {} + operator fun Nothing.get(i: Int) {} todo()!![12] } fun testCompound1() { - fun Int.times(s: String): Array = throw Exception() + operator fun Int.times(s: String): Array = throw Exception() (todo() * "")[1] } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLoops.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLoops.kt index f5f85117c8c..aca104fd837 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLoops.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInLoops.kt @@ -1,5 +1,5 @@ fun testFor() { - fun Nothing.iterator() = (0..1).iterator() + operator fun Nothing.iterator() = (0..1).iterator() for (i in todo()) {} } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInUnaryExpr.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInUnaryExpr.kt index 1d158e012d2..385de223e04 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInUnaryExpr.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/deadCodeInUnaryExpr.kt @@ -1,10 +1,10 @@ fun testPrefix() { - fun Any.not() {} + operator fun Any.not() {} !todo() } fun testPostfixWithCall(n: Nothing) { - fun Nothing.inc(): Nothing = this + operator fun Nothing.inc(): Nothing = this n++ } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.kt index 3f76c0a8f0c..94efd2514a0 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.kt @@ -7,10 +7,10 @@ var c2 = 0 class A() { var p = 0 - fun divAssign(a : Int) { + operator fun divAssign(a : Int) { c1++; } - fun times(a : Int) : A { + operator fun times(a : Int) : A { c2++; return this; } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.txt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.txt index bb47bf8b424..2f749cbf525 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.txt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt1571.txt @@ -10,10 +10,10 @@ package kt1571 { public final class A { public constructor A() public final var p: kotlin.Int - public final fun divAssign(/*0*/ a: kotlin.Int): kotlin.Unit + public final operator fun divAssign(/*0*/ a: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun times(/*0*/ a: kotlin.Int): kt1571.A + public final operator fun times(/*0*/ a: kotlin.Int): kt1571.A public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt4126.txt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt4126.txt index eb8db3fbf9d..909274cc8e8 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt4126.txt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt4126.txt @@ -5,8 +5,8 @@ package public final val name: kotlin.String public final val parent: ProductGroup? public final val short_name: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): ProductGroup? + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): ProductGroup? public final /*synthesized*/ fun copy(/*0*/ short_name: kotlin.String = ..., /*1*/ parent: ProductGroup? = ...): ProductGroup public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.kt b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.kt index 48fb36a5b3e..5f34d4126d5 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.kt @@ -1,10 +1,10 @@ class Coll { - fun iterator(): It = It() + operator fun iterator(): It = It() } class It { - fun next() = 1 - fun hasNext() = false + operator fun next() = 1 + operator fun hasNext() = false } fun test(c: Coll?) { diff --git a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.txt b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.txt index e8c12429580..4a9685809ce 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.txt +++ b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.txt @@ -6,15 +6,15 @@ public final class Coll { public constructor Coll() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): It + public final operator fun iterator(): It public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class It { public constructor It() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun hasNext(): kotlin.Boolean + public final operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun next(): kotlin.Int + public final operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.kt b/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.kt index f5f46c8baf3..906a2ef847c 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.kt @@ -1,10 +1,10 @@ class Coll { - fun iterator(): It? = null + operator fun iterator(): It? = null } class It { - fun next() = 1 - fun hasNext() = false + operator fun next() = 1 + operator fun hasNext() = false } fun test() { diff --git a/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.txt b/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.txt index 14454a43d6e..a9ea1997e0f 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.txt +++ b/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.txt @@ -6,15 +6,15 @@ public final class Coll { public constructor Coll() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): It? + public final operator fun iterator(): It? public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class It { public constructor It() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun hasNext(): kotlin.Boolean + public final operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun next(): kotlin.Int + public final operator fun next(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/dataClasses/componentFunctionInSubClass.txt b/compiler/testData/diagnostics/tests/dataClasses/componentFunctionInSubClass.txt index f0b36358447..04cbaed14c1 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/componentFunctionInSubClass.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/componentFunctionInSubClass.txt @@ -5,7 +5,7 @@ public fun foo(): kotlin.Unit @kotlin.data() public open class A { public constructor A(/*0*/ x: kotlin.Int) private final val x: kotlin.Int - private final /*synthesized*/ fun component1(): kotlin.Int + private final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.txt b/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.txt index 111d25d8e9c..fdabd28b344 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/componentNamedComponent1.txt @@ -5,7 +5,7 @@ public fun foo(/*0*/ a: A): kotlin.Unit @kotlin.data() public final class A { public constructor A(/*0*/ component1: kotlin.Int) public final val component1: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ component1: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/conflictingCopyOverloads.txt b/compiler/testData/diagnostics/tests/dataClasses/conflictingCopyOverloads.txt index 26d3f60c6c3..f2102065ccb 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/conflictingCopyOverloads.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/conflictingCopyOverloads.txt @@ -4,8 +4,8 @@ package public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String) public final val x: kotlin.Int public final val y: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.String public final fun copy(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String): A public final fun copy(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A diff --git a/compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.txt b/compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.txt index c1027777ed3..50cc83cd0d5 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/conflictingOverloads.txt @@ -5,9 +5,9 @@ package public final val x: kotlin.Int public final val y: kotlin.String public final fun component1(): kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final fun component2(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.txt b/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.txt index add2b3a74b3..1e1f52dbb8e 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/copyOfPrivateClass.txt @@ -9,7 +9,7 @@ public final class Outer { @kotlin.data() private final class Nested { public constructor Nested(/*0*/ c: kotlin.Int) public final val c: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ c: kotlin.Int = ...): Outer.Nested public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/dataClassVarargParam.txt b/compiler/testData/diagnostics/tests/dataClasses/dataClassVarargParam.txt index 8309972d047..ab617b66201 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/dataClassVarargParam.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/dataClassVarargParam.txt @@ -4,8 +4,8 @@ package public constructor My(/*0*/ x: kotlin.Int, /*1*/ vararg y: kotlin.String /*kotlin.Array*/) public final val x: kotlin.Int public final val y: kotlin.Array - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Array + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Array public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ vararg y: kotlin.String /*kotlin.Array*/ = ...): My public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.txt b/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.txt index 719dcc338c6..9275ecb0a41 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/dataInheritance.txt @@ -9,7 +9,7 @@ public interface Allowed { @kotlin.data() public abstract class Base { public constructor Base(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): Base public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -19,7 +19,7 @@ public interface Allowed { @kotlin.data() public final class Complex : Allowed, NotAllowed { public constructor Complex(/*0*/ y: kotlin.Int) public final val y: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ y: kotlin.Int = ...): Complex public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -42,7 +42,7 @@ public final class Derived : Base { public final val y: kotlin.Int public final val z: kotlin.Int public final override /*1*/ /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final override /*1*/ /*fake_override*/ fun copy(/*0*/ x: kotlin.Int = ...): Base public final /*synthesized*/ fun copy(/*0*/ z: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): Nasty public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.txt b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.txt index 08746d5a0af..1e01f38faec 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.txt @@ -3,7 +3,7 @@ package @kotlin.data() public final class A : T { public constructor A(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final override /*1*/ /*synthesized*/ fun component1(): kotlin.Int + public final operator override /*1*/ /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasFinalComponent1.txt b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasFinalComponent1.txt index 3f31f56db14..4510a47d289 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasFinalComponent1.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasFinalComponent1.txt @@ -3,7 +3,7 @@ package @kotlin.data() public final class A : T { public constructor A(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final override /*1*/ /*synthesized*/ fun component1(): kotlin.Int + public final operator override /*1*/ /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/innerDataClass.txt b/compiler/testData/diagnostics/tests/dataClasses/innerDataClass.txt index 340ef1801ab..d5ac3e4a9ab 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/innerDataClass.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/innerDataClass.txt @@ -9,7 +9,7 @@ public final class Outer { @kotlin.data() public final inner class Inner { public constructor Inner(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): Outer.Inner public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/innerOuterDataClass.txt b/compiler/testData/diagnostics/tests/dataClasses/innerOuterDataClass.txt index 32e412f4341..4ee5314accd 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/innerOuterDataClass.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/innerOuterDataClass.txt @@ -3,7 +3,7 @@ package @kotlin.data() public final class Outer { public constructor Outer(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): Outer public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.txt b/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.txt index 413edf352bf..881b5024989 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/multiDeclaration.txt @@ -6,8 +6,8 @@ public fun foo(/*0*/ a: A): kotlin.Unit public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String) public final val x: kotlin.Int public final val y: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.txt b/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.txt index fe7003f7abd..3ef137100c3 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/multiDeclarationFor.txt @@ -6,8 +6,8 @@ public fun foo(/*0*/ arr: kotlin.Array): kotlin.Unit public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String) public final val x: kotlin.Int public final val y: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/oneValParam.txt b/compiler/testData/diagnostics/tests/dataClasses/oneValParam.txt index 19f036e20d9..2eab33ecbfe 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/oneValParam.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/oneValParam.txt @@ -5,7 +5,7 @@ public fun foo(/*0*/ a: A): kotlin.Unit @kotlin.data() public final class A { public constructor A(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/repeatedProperties.txt b/compiler/testData/diagnostics/tests/dataClasses/repeatedProperties.txt index 282d27de090..7f653f24f2c 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/repeatedProperties.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/repeatedProperties.txt @@ -6,9 +6,9 @@ package public final val x: kotlin.Int public final val y: kotlin.String public final val z: kotlin.String = "" - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String - public final /*synthesized*/ fun component3(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component3(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ..., /*2*/ x: kotlin.Int = ...): A1 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -20,8 +20,8 @@ package public final val x: kotlin.Int public final val x: kotlin.String = "" public final val y: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A2 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -32,8 +32,8 @@ package public constructor A3(/*0*/ : kotlin.Int, /*1*/ : kotlin.Int) public final val : kotlin.Int public final val : kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ : kotlin.Int = ..., /*1*/ : kotlin.Int = ...): A3 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt b/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt index 5a3e8f48709..4241804b766 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt @@ -3,7 +3,7 @@ package @kotlin.data() public sealed class My { private constructor My(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): My public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/strange.txt b/compiler/testData/diagnostics/tests/dataClasses/strange.txt index e4bb7aa21f3..36f6444418e 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/strange.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/strange.txt @@ -9,7 +9,7 @@ package public final val x: kotlin.Int protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: First): kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): First public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -25,7 +25,7 @@ package @kotlin.data() @kotlin.annotation.annotation() public final class Fourth : kotlin.Annotation { public constructor Fourth(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): Fourth public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/twoValParams.txt b/compiler/testData/diagnostics/tests/dataClasses/twoValParams.txt index 413edf352bf..881b5024989 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/twoValParams.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/twoValParams.txt @@ -6,8 +6,8 @@ public fun foo(/*0*/ a: A): kotlin.Unit public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String) public final val x: kotlin.Int public final val y: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.txt b/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.txt index 608819ac542..43dbcc4d63f 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/twoVarParams.txt @@ -6,8 +6,8 @@ public fun foo(/*0*/ a: A): kotlin.Unit public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String) public final var x: kotlin.Int public final var y: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.kt index ea5e8ede713..b387c246c68 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.kt @@ -1,8 +1,8 @@ // !CHECK_TYPE interface G { - fun get(x: Int, y: Int): Int = x + y - fun set(x: Int, y: Int, value: Int) {} + operator fun get(x: Int, y: Int): Int = x + y + operator fun set(x: Int, y: Int, value: Int) {} } fun foo1(a: Int?, b: G) { diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.txt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.txt index 411b8a99121..20a907ac380 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.txt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ArrayGetSetConvention.txt @@ -7,8 +7,8 @@ public fun foo4(/*0*/ a: kotlin.Int?, /*1*/ b: G): kotlin.Unit public interface G { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open fun get(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int): kotlin.Int + public open operator fun get(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open fun set(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int, /*2*/ value: kotlin.Int): kotlin.Unit + public open operator fun set(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int, /*2*/ value: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.kt index 68e9e099cf9..16361729596 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.kt @@ -3,7 +3,7 @@ interface A interface B : A -fun B.compareTo(b: B) = if (this == b) 0 else 1 +operator fun B.compareTo(b: B) = if (this == b) 0 else 1 fun foo(a: A): Boolean { val result = (a as B) < a diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.txt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.txt index 122fbf4d5d5..178617513e8 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.txt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionCompareToConvention.txt @@ -2,7 +2,7 @@ package public fun bar(/*0*/ a: A, /*1*/ b: B): kotlin.Boolean public fun foo(/*0*/ a: A): kotlin.Boolean -public fun B.compareTo(/*0*/ b: B): kotlin.Int +public operator fun B.compareTo(/*0*/ b: B): kotlin.Int public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.kt index d6e0f6ac247..133040c2cd2 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.kt @@ -3,7 +3,7 @@ interface A interface B : A -fun B.plus(b: B) = if (this == b) b else this +operator fun B.plus(b: B) = if (this == b) b else this fun foo(a: A): B { val result = (a as B) + a diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.txt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.txt index 1fe3cf4ab44..15f9a3265e4 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.txt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/BinaryExpressionPlusConvention.txt @@ -2,7 +2,7 @@ package public fun bar(/*0*/ a: A, /*1*/ b: B): B public fun foo(/*0*/ a: A): B -public fun B.plus(/*0*/ b: B): B +public operator fun B.plus(/*0*/ b: B): B public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.kt index 4fb155a6dbf..9b1eab0d05a 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.kt @@ -1,6 +1,6 @@ // !CHECK_TYPE -fun Int.component1() = "a" +operator fun Int.component1() = "a" fun foo(a: Number) { val (x) = a as Int diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.txt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.txt index b78b41f8d95..3f238e17580 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.txt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/MultiDeclaration.txt @@ -1,4 +1,4 @@ package public fun foo(/*0*/ a: kotlin.Number): kotlin.Unit -public fun kotlin.Int.component1(): kotlin.String +public operator fun kotlin.Int.component1(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt b/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt index 31ece10edbf..86b8432b678 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.kt @@ -1,6 +1,6 @@ class A { - fun component1() : Int = 1 - fun component2() : Int = 2 + operator fun component1() : Int = 1 + operator fun component2() : Int = 2 } fun a(aa : A) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.txt b/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.txt index 4bac5a4ef06..677eac600e3 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/ComponentFunctionReturnTypeMismatch.txt @@ -4,8 +4,8 @@ public fun a(/*0*/ aa: A): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt index 3cb39dd9435..2eecf2d6460 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.kt @@ -2,9 +2,9 @@ package d class A { - fun component1() = 1 - fun component2() = 2 - fun component3() = 3 + operator fun component1() = 1 + operator fun component2() = 2 + operator fun component3() = 3 } fun foo(list: List) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.txt b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.txt index 390d040ee3c..3ccc4de51e4 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInMultiDeclInFor.txt @@ -5,9 +5,9 @@ package d { public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int - public final fun component3(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int + public final operator fun component3(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.kt b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.kt index 1c81bc03a38..3e046284e52 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.kt @@ -1,6 +1,6 @@ class A { - fun component1() : Int = 1 - fun component2() : Int = 2 + operator fun component1() : Int = 1 + operator fun component2() : Int = 2 } fun a(aa : A?, b : Any) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.txt b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.txt index f9c7022601b..ce39e709c17 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/DataFlowInfoInMultiDecl.txt @@ -4,8 +4,8 @@ public fun a(/*0*/ aa: A?, /*1*/ b: kotlin.Any): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt b/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt index ca3d104f4e3..f0350b365dd 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.kt @@ -1,6 +1,6 @@ class A { - fun component1() : Int = 1 - fun component2() : Int = 2 + operator fun component1() : Int = 1 + operator fun component2() : Int = 2 } fun a() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.txt b/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.txt index 8878e1482b3..be493c6972e 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/RedeclarationsInMultiDecl.txt @@ -5,8 +5,8 @@ public fun use(/*0*/ a: kotlin.Any): kotlin.Any public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.kt b/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.kt index ffdb4c3963e..99728930b1f 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.kt @@ -4,13 +4,13 @@ package a class MyClass { - fun component1() = 1 - fun component2() = "a" + operator fun component1() = 1 + operator fun component2() = "a" } class MyClass2 {} -fun MyClass2.component1() = 1.2 +operator fun MyClass2.component1() = 1.2 fun test(mc1: MyClass, mc2: MyClass2) { val (a, b) = mc1 diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.txt b/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.txt index 16723ff0863..192075f0923 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt2631_MultipleDeclaration.txt @@ -2,12 +2,12 @@ package package a { public fun test(/*0*/ mc1: a.MyClass, /*1*/ mc2: a.MyClass2): kotlin.Unit - public fun a.MyClass2.component1(): kotlin.Double + public operator fun a.MyClass2.component1(): kotlin.Double public final class MyClass { public constructor MyClass() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.String + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.kt b/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.kt index a70e60a6ffc..56ffc1ccf38 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.kt @@ -2,8 +2,8 @@ package n class C { - fun component1() = 1 - fun component2() = 2 + operator fun component1() = 1 + operator fun component2() = 2 } fun test1(c: C) { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.txt b/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.txt index dbfc73d2428..31c22627ee8 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt2643MultiDeclInControlFlow.txt @@ -8,8 +8,8 @@ package n { public final class C { public constructor C() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.kt index 54ad4676859..065d6ac7c48 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.kt @@ -1,10 +1,10 @@ class A { - fun component1() = 1 - fun component2() = 1 + operator fun component1() = 1 + operator fun component2() = 1 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.txt index a103232a59b..f53023fbca1 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/DoubleDeclForLoop.txt @@ -4,8 +4,8 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -15,6 +15,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.kt index 411e9b020c1..de3155d1fa6 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.kt @@ -1,10 +1,10 @@ class A { - fun component1() = 1 - fun component2() = 1.0 + operator fun component1() = 1 + operator fun component2() = 1.0 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.txt index 9711f1ed02c..dfabd810eed 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/FolLoopTypeComponentTypeMismatch.txt @@ -4,8 +4,8 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Double + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Double public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -15,6 +15,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.kt index 801fb10eeb6..6bc083401c6 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.kt @@ -1,11 +1,11 @@ class A { - fun component1() = 1 - fun component1() = 1 - fun component2() = 1 + operator fun component1() = 1 + operator fun component1() = 1 + operator fun component2() = 1 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.txt index 71bfd39a06c..32325608b61 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionAmbiguity.txt @@ -4,9 +4,9 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -16,6 +16,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.kt index 061d5704dee..95924e4c839 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.kt @@ -1,9 +1,9 @@ class A { - fun component1() = 1 + operator fun component1() = 1 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.txt index d25aecc1ae2..babba8620ac 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopComponentFunctionMissing.txt @@ -4,7 +4,7 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int + public final operator fun component1(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -14,6 +14,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.kt index b2f98835ba3..30fca7424e3 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.kt @@ -1,10 +1,10 @@ class A { } -fun A.component1() = 1 -fun A.component2() = 1 +operator fun A.component1() = 1 +operator fun A.component2() = 1 class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.txt index c3e7511ca4a..a88397b2bb2 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.txt @@ -1,8 +1,8 @@ package public fun test(): kotlin.Unit -public fun A.component1(): kotlin.Int -public fun A.component2(): kotlin.Int +public operator fun A.component1(): kotlin.Int +public operator fun A.component2(): kotlin.Int public final class A { public constructor A() @@ -15,6 +15,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.kt index 211225352ca..3e97d2fc5ff 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.kt @@ -1,10 +1,10 @@ class A { - fun component1() = 1 - fun component2() = 1.0 + operator fun component1() = 1 + operator fun component2() = 1.0 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.txt index 9711f1ed02c..dfabd810eed 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForWithExplicitTypes.txt @@ -4,8 +4,8 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Double + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Double public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -15,6 +15,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.kt index 0af1ac3c81e..4973697a161 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.kt @@ -1,10 +1,10 @@ class A { - fun component1() = 1 - fun component2() = 1 + operator fun component1() = 1 + operator fun component2() = 1 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.txt index a103232a59b..f53023fbca1 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/RedeclarationInForLoop.txt @@ -4,8 +4,8 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -15,6 +15,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.kt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.kt index cdaf0a34991..d955b6a5df7 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.kt @@ -1,9 +1,9 @@ class A { - fun component1() = 1 + operator fun component1() = 1 } class C { - fun iterator(): Iterator = null!! + operator fun iterator(): Iterator = null!! } fun test() { diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.txt index d25aecc1ae2..babba8620ac 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/SingleDeclForLoop.txt @@ -4,7 +4,7 @@ public fun test(): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int + public final operator fun component1(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -14,6 +14,6 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): kotlin.Iterator + public final operator fun iterator(): kotlin.Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/kt2829.txt b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/kt2829.txt index eb560e7c52d..4e172afa1ff 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/kt2829.txt +++ b/compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/kt2829.txt @@ -9,8 +9,8 @@ package test { public constructor Pair(/*0*/ a: A, /*1*/ b: B) public final val a: A public final val b: B - public final /*synthesized*/ fun component1(): A - public final /*synthesized*/ fun component2(): B + public final operator /*synthesized*/ fun component1(): A + public final operator /*synthesized*/ fun component2(): B public final /*synthesized*/ fun copy(/*0*/ a: A = ..., /*1*/ b: B = ...): test.Pair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt index d8bf1eaf054..cc7f90e6fc0 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.kt @@ -31,8 +31,8 @@ class MyProperty { } } -fun MyProperty.plus() = MyProperty() -fun MyProperty.minus(i: Int) = MyProperty() +operator fun MyProperty.plus() = MyProperty() +operator fun MyProperty.minus(i: Int) = MyProperty() object O { fun getMyProperty() = MyProperty() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt index e59fd4f8459..62427ced9b4 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/differentDelegatedExpressions.txt @@ -5,8 +5,8 @@ package baz { public fun getMyConcreteProperty(): baz.MyProperty public fun getMyProperty(): baz.MyProperty public fun println(/*0*/ a: kotlin.Any?): kotlin.Any? - public fun baz.MyProperty.minus(/*0*/ i: kotlin.Int): baz.MyProperty - public fun baz.MyProperty.plus(): baz.MyProperty + public operator fun baz.MyProperty.minus(/*0*/ i: kotlin.Int): baz.MyProperty + public operator fun baz.MyProperty.plus(): baz.MyProperty public final class A { public constructor A(/*0*/ outer: baz.Outer) diff --git a/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt b/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt index 833ec310286..fcc545c6be8 100644 --- a/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/componentUsage.kt @@ -2,8 +2,8 @@ class Data { @Deprecated("text") - fun component1(): String = throw Exception() - fun component2(): String = throw Exception() + operator fun component1(): String = throw Exception() + operator fun component2(): String = throw Exception() } fun use() { diff --git a/compiler/testData/diagnostics/tests/deprecated/componentUsage.txt b/compiler/testData/diagnostics/tests/deprecated/componentUsage.txt index 62e9346e546..cb4a6bf8507 100644 --- a/compiler/testData/diagnostics/tests/deprecated/componentUsage.txt +++ b/compiler/testData/diagnostics/tests/deprecated/componentUsage.txt @@ -4,8 +4,8 @@ public fun use(): kotlin.Unit public final class Data { public constructor Data() - @kotlin.Deprecated(value = "text") public final fun component1(): kotlin.String - public final fun component2(): kotlin.String + @kotlin.Deprecated(value = "text") public final operator fun component1(): kotlin.String + public final operator fun component2(): kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt b/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt index f35803a34db..b6531229503 100644 --- a/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/functionUsage.kt @@ -13,7 +13,7 @@ fun Obsolete(param: Int = 1): UsefulClass = UsefulClass(param) class Invocable { @Deprecated("message") - fun invoke() {} + operator fun invoke() {} } object InvocableHolder { diff --git a/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt b/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt index d9d7095f0bc..dd677e4e3fd 100644 --- a/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt +++ b/compiler/testData/diagnostics/tests/deprecated/functionUsage.txt @@ -29,7 +29,7 @@ public final class Invocable { public constructor Invocable() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - @kotlin.Deprecated(value = "message") public final fun invoke(): kotlin.Unit + @kotlin.Deprecated(value = "message") public final operator fun invoke(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt b/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt index d524e270402..62fbe0dda0c 100644 --- a/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt +++ b/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.kt @@ -1,20 +1,20 @@ class Iter { @Deprecated("text") - fun iterator() : IterIterator = throw Exception() + operator fun iterator() : IterIterator = throw Exception() class IterIterator { - fun hasNext(): Boolean = throw UnsupportedOperationException() - fun next(): String = throw UnsupportedOperationException() + operator fun hasNext(): Boolean = throw UnsupportedOperationException() + operator fun next(): String = throw UnsupportedOperationException() } } class Iter2 { - fun iterator() : Iter2Iterator = throw Exception() + operator fun iterator() : Iter2Iterator = throw Exception() class Iter2Iterator { @Deprecated("text") - fun hasNext(): Boolean = throw UnsupportedOperationException() + operator fun hasNext(): Boolean = throw UnsupportedOperationException() @Deprecated("text") - fun next(): String = throw UnsupportedOperationException() + operator fun next(): String = throw UnsupportedOperationException() } } diff --git a/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.txt b/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.txt index d10f80c27ec..406665e9e56 100644 --- a/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.txt +++ b/compiler/testData/diagnostics/tests/deprecated/iteratorUsage.txt @@ -6,15 +6,15 @@ public final class Iter { public constructor Iter() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - @kotlin.Deprecated(value = "text") public final fun iterator(): Iter.IterIterator + @kotlin.Deprecated(value = "text") public final operator fun iterator(): Iter.IterIterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final class IterIterator { public constructor IterIterator() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun hasNext(): kotlin.Boolean + public final operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun next(): kotlin.String + public final operator fun next(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } @@ -23,15 +23,15 @@ public final class Iter2 { public constructor Iter2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun iterator(): Iter2.Iter2Iterator + public final operator fun iterator(): Iter2.Iter2Iterator public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final class Iter2Iterator { public constructor Iter2Iterator() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - @kotlin.Deprecated(value = "text") public final fun hasNext(): kotlin.Boolean + @kotlin.Deprecated(value = "text") public final operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - @kotlin.Deprecated(value = "text") public final fun next(): kotlin.String + @kotlin.Deprecated(value = "text") public final operator fun next(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/dataClassCopy.txt b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/dataClassCopy.txt index 01d8cbeda16..17b0cac99f1 100644 --- a/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/dataClassCopy.txt +++ b/compiler/testData/diagnostics/tests/duplicateJvmSignature/specialNames/dataClassCopy.txt @@ -3,7 +3,7 @@ package @kotlin.data() public final class C { public constructor C(/*0*/ c: kotlin.Int) public final val c: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ c: kotlin.Int = ...): C public final fun `copy$default`(/*0*/ c: C, /*1*/ x: kotlin.Int, /*2*/ m: kotlin.Int): C public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt index 465f51d0202..e1054b448c5 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.kt @@ -16,7 +16,7 @@ fun T.foo(x : E, y : A) : T { class A -fun A.plus(a : Any) { +operator fun A.plus(a : Any) { 1.foo() true.foo() @@ -24,11 +24,11 @@ fun A.plus(a : Any) { 1 } -fun A.plus(a : Int) { +operator fun A.plus(a : Int) { 1 } -fun T.minus(t : T) : Int = 1 +operator fun T.minus(t : T) : Int = 1 fun test() { val y = 1.abs diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.txt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.txt index d785cfaa96c..81bc8b32159 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.txt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.txt @@ -23,10 +23,10 @@ package outer { public fun test(): kotlin.Unit public fun T.foo(/*0*/ x: E, /*1*/ y: outer.A): T public fun kotlin.Int.foo(): kotlin.Int - public fun T.minus(/*0*/ t: T): kotlin.Int + public operator fun T.minus(/*0*/ t: T): kotlin.Int public fun kotlin.Int?.optint(): kotlin.Unit - public fun outer.A.plus(/*0*/ a: kotlin.Any): kotlin.Unit - public fun outer.A.plus(/*0*/ a: kotlin.Int): kotlin.Unit + public operator fun outer.A.plus(/*0*/ a: kotlin.Any): kotlin.Unit + public operator fun outer.A.plus(/*0*/ a: kotlin.Int): kotlin.Unit public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt b/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt index a3f7c02519a..6778e30a9bc 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator.kt @@ -8,12 +8,12 @@ fun java.util.Enumeration.iterator() = object: Iterator { interface MyIterator { - fun hasNext() : Boolean + operator fun hasNext() : Boolean - fun next() : T + operator fun next() : T } -fun T?.iterator() = object : MyIterator { +operator fun T?.iterator() = object : MyIterator { var hasNext = this@iterator != null private set override fun hasNext() = hasNext diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator.txt b/compiler/testData/diagnostics/tests/extensions/GenericIterator.txt index 73946c5ed5e..7c59a3e9443 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator.txt +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator.txt @@ -1,13 +1,13 @@ package public fun main(/*0*/ args: kotlin.Array): kotlin.Unit -public fun T?.iterator(): MyIterator +public operator fun T?.iterator(): MyIterator public fun java.util.Enumeration.iterator(): kotlin.Iterator public interface MyIterator { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public abstract fun hasNext(): kotlin.Boolean + public abstract operator fun hasNext(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public abstract fun next(): T + public abstract operator fun next(): T public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator2.kt b/compiler/testData/diagnostics/tests/extensions/GenericIterator2.kt index 2b8f42bee80..8f77ae0b73b 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator2.kt +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator2.kt @@ -2,7 +2,7 @@ import java.util.Enumeration -fun java.util.Enumeration.iterator() = object : Iterator { +operator fun java.util.Enumeration.iterator() = object : Iterator { public override fun hasNext(): Boolean = hasMoreElements() public override fun next() = nextElement() diff --git a/compiler/testData/diagnostics/tests/extensions/GenericIterator2.txt b/compiler/testData/diagnostics/tests/extensions/GenericIterator2.txt index 44ffde9dd82..2048dcd4024 100644 --- a/compiler/testData/diagnostics/tests/extensions/GenericIterator2.txt +++ b/compiler/testData/diagnostics/tests/extensions/GenericIterator2.txt @@ -1,4 +1,4 @@ package public fun a(/*0*/ e: java.util.Enumeration): kotlin.Unit -public fun java.util.Enumeration.iterator(): kotlin.Iterator +public operator fun java.util.Enumeration.iterator(): kotlin.Iterator diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt index dea949656a3..860f0a11fa3 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.kt @@ -9,6 +9,6 @@ fun test(a1: A, a2: A) { } -public fun > T.rangeTo(that: T): Range { +public operator fun > T.rangeTo(that: T): Range { throw UnsupportedOperationException() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt index ffdc09fc1f9..2e82e70baa3 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver2.txt @@ -2,7 +2,7 @@ package package a { public fun test(/*0*/ a1: a.A, /*1*/ a2: a.A): kotlin.Unit - public fun > T.rangeTo(/*0*/ that: T): kotlin.Range + public operator fun > T.rangeTo(/*0*/ that: T): kotlin.Range public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt index ac69102251b..160bb4dd0eb 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.kt @@ -7,5 +7,5 @@ fun main(args : Array) { } fun T.let(f: (T) -> R): R = f(this) -fun Iterable.plus(element: T): List = null!! +operator fun Iterable.plus(element: T): List = null!! fun listOf(vararg values: T): List = null!! \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt index ebbb4c255d7..9f292cb9a0a 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt +++ b/compiler/testData/diagnostics/tests/functionLiterals/kt6869.txt @@ -3,4 +3,4 @@ package public fun listOf(/*0*/ vararg values: T /*kotlin.Array*/): kotlin.List public fun main(/*0*/ args: kotlin.Array): kotlin.Unit public fun T.let(/*0*/ f: (T) -> R): R -public fun kotlin.Iterable.plus(/*0*/ element: T): kotlin.List +public operator fun kotlin.Iterable.plus(/*0*/ element: T): kotlin.List diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.kt index bb0546bf698..feec86f78af 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.kt @@ -1,8 +1,8 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -inline fun T.plus(p: T): T = this +inline operator fun T.plus(p: T): T = this -inline fun T.invoke(): T = this +inline operator fun T.invoke(): T = this fun main(tp: A, any: Any) { tp + tp diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.txt b/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.txt index 779d861f77b..ab8123e08b7 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.txt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/Conventions.txt @@ -1,5 +1,5 @@ package public fun main(/*0*/ tp: A, /*1*/ any: kotlin.Any): kotlin.Unit -@kotlin.inline() public fun T.invoke(): T -@kotlin.inline() public fun T.plus(/*0*/ p: T): T +@kotlin.inline() public operator fun T.invoke(): T +@kotlin.inline() public operator fun T.plus(/*0*/ p: T): T diff --git a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.kt b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.kt index 85a976ac8b7..74acaec0119 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.kt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.kt @@ -4,7 +4,7 @@ interface Tr { } class C { - fun plusAssign(c: C) {} + operator fun plusAssign(c: C) {} } fun test(t: Tr) { diff --git a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.txt b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.txt index c99cefc536b..f475a81f211 100644 --- a/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.txt +++ b/compiler/testData/diagnostics/tests/generics/varProjection/setterProjectedOutPlusAssignDefined.txt @@ -6,7 +6,7 @@ public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plusAssign(/*0*/ c: C): kotlin.Unit + public final operator fun plusAssign(/*0*/ c: C): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt b/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt index ed135a6aa94..7ae36b27c2e 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.kt @@ -2,7 +2,7 @@ package a class MyClass1 { - public fun plus() {} + public operator fun plus() {} } fun main(arg: MyClass1) { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.txt b/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.txt index 7e5f56973db..fdf48e5c0ec 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.txt +++ b/compiler/testData/diagnostics/tests/incompleteCode/plusOnTheRight.txt @@ -7,7 +7,7 @@ package a { public constructor MyClass1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plus(): kotlin.Unit + public final operator fun plus(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/inference/kt3184.kt b/compiler/testData/diagnostics/tests/inference/kt3184.kt index 86773f52862..069676a9a52 100644 --- a/compiler/testData/diagnostics/tests/inference/kt3184.kt +++ b/compiler/testData/diagnostics/tests/inference/kt3184.kt @@ -21,6 +21,6 @@ fun tests() { } // from standard library -fun MutableMap.set(key : K, value : V) : V? = this.put(key, value) +operator fun MutableMap.set(key : K, value : V) : V? = this.put(key, value) fun println(message : Any?) = System.out.println(message) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/kt3184.txt b/compiler/testData/diagnostics/tests/inference/kt3184.txt index 1c269c33e67..142e9e88fb8 100644 --- a/compiler/testData/diagnostics/tests/inference/kt3184.txt +++ b/compiler/testData/diagnostics/tests/inference/kt3184.txt @@ -5,5 +5,5 @@ package a { public fun println(/*0*/ message: kotlin.Any?): kotlin.Unit private fun test(/*0*/ value: T, /*1*/ extf: kotlin.String.(T) -> kotlin.Unit): kotlin.Unit public fun tests(): kotlin.Unit - public fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? + public operator fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? } diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt index af64eb4f064..2657debff59 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.kt @@ -1,7 +1,7 @@ package b class A { - fun get(i: Int): List = throw Exception("$i") + operator fun get(i: Int): List = throw Exception("$i") } fun bar(l: List) = l diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.txt b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.txt index 5b9541408c5..2c6c62683cc 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.txt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/arrayAccess.txt @@ -7,7 +7,7 @@ package b { public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ i: kotlin.Int): kotlin.List + public final operator fun get(/*0*/ i: kotlin.Int): kotlin.List public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt index 44e791a7adb..c938327b3aa 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.kt @@ -20,7 +20,7 @@ fun test(z: Z) { } //binary operation expression -fun Z.plus(a: A): A = a +operator fun Z.plus(a: A): A = a fun test1(z: Z) { id(z + newA()) @@ -32,7 +32,7 @@ fun test1(z: Z) { } //comparison operation -fun Z.compareTo(a: A): Int { use(a); return 1 } +operator fun Z.compareTo(a: A): Int { use(a); return 1 } fun test2(z: Z) { val a: Boolean = id(z < newA()) diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.txt b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.txt index 9ab9d0158a0..8665c7ff112 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.txt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/binaryExpressions.txt @@ -11,10 +11,10 @@ package h { public fun test5(): kotlin.Unit public fun toBeOrNot(): kotlin.Boolean public fun use(/*0*/ vararg a: kotlin.Any? /*kotlin.Array*/): kotlin.Array - public fun h.Z.compareTo(/*0*/ a: h.A): kotlin.Int + public operator fun h.Z.compareTo(/*0*/ a: h.A): kotlin.Int public fun h.Z.equals(/*0*/ any: kotlin.Any): kotlin.Int public fun h.Z.foo(/*0*/ a: h.A): h.A - public fun h.Z.plus(/*0*/ a: h.A): h.A + public operator fun h.Z.plus(/*0*/ a: h.A): h.A public interface A { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt index 147e8856741..1a4a770b8d2 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.kt @@ -5,4 +5,4 @@ fun test(map: MutableMap, t: Int) { } //from library -fun MutableMap.set(key : K, value : V) : V? = this.put(key, value) \ No newline at end of file +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.txt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.txt index 4bcfa335cd0..4c51793151f 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.txt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedCallsForArraySetExpression.txt @@ -2,4 +2,4 @@ package public fun foo(/*0*/ t: T): T public fun test(/*0*/ map: kotlin.MutableMap, /*1*/ t: kotlin.Int): kotlin.Unit -public fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? +public operator fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.kt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.kt index ee388bc2f2e..b75c1ed2d02 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.kt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.kt @@ -6,7 +6,7 @@ class A(val b: B) { } class B { - fun invoke(f: (T) -> T): MyFunc = throw Exception() + operator fun invoke(f: (T) -> T): MyFunc = throw Exception() } fun id(r: R) = r diff --git a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.txt b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.txt index 0e161a2b59c..a1afa81e5e0 100644 --- a/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.txt +++ b/compiler/testData/diagnostics/tests/inference/nestedCalls/completeNestedForVariableAsFunctionCall.txt @@ -16,7 +16,7 @@ package j { public constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ f: (T) -> T): j.MyFunc + public final operator fun invoke(/*0*/ f: (T) -> T): j.MyFunc public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1718.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt1718.kt index ff96866612d..d1ff42da91e 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1718.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1718.kt @@ -14,4 +14,4 @@ fun test() { //from library fun arrayList(vararg values: T) : ArrayList {} -fun Iterable.plus(elements: Iterable): List {} \ No newline at end of file +operator fun Iterable.plus(elements: Iterable): List {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt1718.txt b/compiler/testData/diagnostics/tests/inference/regressions/kt1718.txt index 75c60be6bec..88dbbdb3bfc 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt1718.txt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt1718.txt @@ -3,5 +3,5 @@ package package n { public fun arrayList(/*0*/ vararg values: T /*kotlin.Array*/): java.util.ArrayList public fun test(): kotlin.Unit - public fun kotlin.Iterable.plus(/*0*/ elements: kotlin.Iterable): kotlin.List + public operator fun kotlin.Iterable.plus(/*0*/ elements: kotlin.Iterable): kotlin.List } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt index 5180621417f..9468733e750 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3496.kt @@ -5,5 +5,5 @@ class B { fun x (y: B>) { val z: S = y[""] // does not work with [], but works with .get() } - fun get(s : String): S = throw Exception() + operator fun get(s : String): S = throw Exception() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3496.txt b/compiler/testData/diagnostics/tests/inference/regressions/kt3496.txt index eb8dd544855..ad7df35d3f1 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3496.txt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3496.txt @@ -3,7 +3,7 @@ package public final class B { public constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ s: kotlin.String): S + public final operator fun get(/*0*/ s: kotlin.String): S public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public final fun x(/*0*/ y: B>): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt index 19716e3ba80..1fc2f31cf73 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.kt @@ -8,4 +8,4 @@ class F { val z: ArrayList = y["", w] } } -fun Any.get(s: String, w: ArrayList): ArrayList = throw Exception() \ No newline at end of file +operator fun Any.get(s: String, w: ArrayList): ArrayList = throw Exception() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.txt b/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.txt index c9e83c8a296..8ee49c165d7 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.txt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt3496_2.txt @@ -1,6 +1,6 @@ package -public fun kotlin.Any.get(/*0*/ s: kotlin.String, /*1*/ w: java.util.ArrayList): java.util.ArrayList +public operator fun kotlin.Any.get(/*0*/ s: kotlin.String, /*1*/ w: java.util.ArrayList): java.util.ArrayList public final class F { public constructor F() diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.kt index d73c6b4cc6b..4a13385ee75 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -inline fun Function1.get(index : Int) { +operator inline fun Function1.get(index : Int) { } @@ -8,11 +8,11 @@ inline fun inlineFunWithInvoke(s: (p: T) -> U) { } //noinline -fun Function2.get(index : Int) { +operator fun Function2.get(index : Int) { } -fun @Extension Function3.get(index : Int) { +operator fun @Extension Function3.get(index : Int) { } diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.txt index dc2835d0010..2635017aff3 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/arrayAccess.txt @@ -2,6 +2,6 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T, U) -> V, /*1*/ ext: T.(U, V) -> W): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).get(/*0*/ index: kotlin.Int): kotlin.Unit -public fun ((T, U) -> V).get(/*0*/ index: kotlin.Int): kotlin.Unit -public fun (T.(U, V) -> W).get(/*0*/ index: kotlin.Int): kotlin.Unit +@kotlin.inline() public operator fun ((T) -> U).get(/*0*/ index: kotlin.Int): kotlin.Unit +public operator fun ((T, U) -> V).get(/*0*/ index: kotlin.Int): kotlin.Unit +public operator fun (T.(U, V) -> W).get(/*0*/ index: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.kt index 9827bd367d2..8767f9c00ee 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.kt @@ -1,25 +1,25 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -NON_LOCAL_RETURN_NOT_ALLOWED -fun Function1.minusAssign(p: Function1) {} +operator fun Function1.minusAssign(p: Function1) {} -inline fun Function1.modAssign(p: Function1) = { +inline operator fun Function1.modAssign(p: Function1) = { this += p p += this } -inline fun Function1.plusAssign(p: Function1) { +inline operator fun Function1.plusAssign(p: Function1) { this -= p p -= this } -fun @Extension Function2.minusAssign(ext : @Extension Function2) {} +operator fun @Extension Function2.minusAssign(ext : @Extension Function2) {} -inline fun @Extension Function2.modAssign(ext : @Extension Function2) = { +inline operator fun @Extension Function2.modAssign(ext : @Extension Function2) = { this += ext ext += this } -inline fun @Extension Function2.plusAssign(ext : @Extension Function2) { +inline operator fun @Extension Function2.plusAssign(ext : @Extension Function2) { this -= ext ext -= this } diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.txt index 5e1ebab92a7..47530660624 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/assignment.txt @@ -1,9 +1,9 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U, /*1*/ ext: T.(U) -> V): kotlin.Unit -public fun ((T) -> U).minusAssign(/*0*/ p: (T) -> U): kotlin.Unit -public fun (T.(U) -> V).minusAssign(/*0*/ ext: T.(U) -> V): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).modAssign(/*0*/ p: (T) -> U): () -> kotlin.Unit -@kotlin.inline() public fun (T.(U) -> V).modAssign(/*0*/ ext: T.(U) -> V): () -> kotlin.Unit -@kotlin.inline() public fun ((T) -> U).plusAssign(/*0*/ p: (T) -> U): kotlin.Unit -@kotlin.inline() public fun (T.(U) -> V).plusAssign(/*0*/ ext: T.(U) -> V): kotlin.Unit +public operator fun ((T) -> U).minusAssign(/*0*/ p: (T) -> U): kotlin.Unit +public operator fun (T.(U) -> V).minusAssign(/*0*/ ext: T.(U) -> V): kotlin.Unit +@kotlin.inline() public operator fun ((T) -> U).modAssign(/*0*/ p: (T) -> U): () -> kotlin.Unit +@kotlin.inline() public operator fun (T.(U) -> V).modAssign(/*0*/ ext: T.(U) -> V): () -> kotlin.Unit +@kotlin.inline() public operator fun ((T) -> U).plusAssign(/*0*/ p: (T) -> U): kotlin.Unit +@kotlin.inline() public operator fun (T.(U) -> V).plusAssign(/*0*/ ext: T.(U) -> V): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.kt index 2d8ed2997bc..1233c32f4f2 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -inline fun Function1.compareTo(p: Function1) = 1 +inline operator fun Function1.compareTo(p: Function1) = 1 inline fun inlineFunWithInvoke(s: (p: T) -> U) { s < s @@ -10,8 +10,8 @@ inline fun inlineFunWithInvoke(s: (p: T) -> U) { } //noinline -fun Function2.compareTo(index : Function2) = 1 -fun @Extension Function3.compareTo(index : @Extension Function3) = 1 +operator fun Function2.compareTo(index : Function2) = 1 +operator fun @Extension Function3.compareTo(index : @Extension Function3) = 1 inline fun inlineFunWithInvoke(s: (p: T, l: U) -> V, ext: T.(p: U, l: V) -> W) { s < s diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.txt index 302f956fa9e..b8d73790960 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/comparison.txt @@ -2,6 +2,6 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T, U) -> V, /*1*/ ext: T.(U, V) -> W): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).compareTo(/*0*/ p: (T) -> U): kotlin.Int -public fun ((T, U) -> V).compareTo(/*0*/ index: (T, U) -> V): kotlin.Int -public fun (T.(U, V) -> W).compareTo(/*0*/ index: T.(U, V) -> W): kotlin.Int +@kotlin.inline() public operator fun ((T) -> U).compareTo(/*0*/ p: (T) -> U): kotlin.Int +public operator fun ((T, U) -> V).compareTo(/*0*/ index: (T, U) -> V): kotlin.Int +public operator fun (T.(U, V) -> W).compareTo(/*0*/ index: T.(U, V) -> W): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.kt index bfbd3ac3462..0403652b44e 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.kt @@ -1,16 +1,16 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -inline fun Function1.component1() = 1 -inline fun Function1.component2() = 2 +inline operator fun Function1.component1() = 1 +inline operator fun Function1.component2() = 2 inline fun inlineFunWithInvoke(s: (p: T) -> U) { val (d1, e1) = s } -fun Function2.component1() = 1 -fun Function2.component2() = 2 +operator fun Function2.component1() = 1 +operator fun Function2.component2() = 2 -fun @Extension Function3.component1() = 1 -fun @Extension Function3.component2() = 2 +operator fun @Extension Function3.component1() = 1 +operator fun @Extension Function3.component2() = 2 inline fun inlineFunWithInvoke(s: (p: T, l: U) -> V, ext: T.(p: U, l: V) -> W) { val (d1, e1) = s diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.txt index 4d0be77f347..32deec85031 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/componentAccess.txt @@ -2,9 +2,9 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T, U) -> V, /*1*/ ext: T.(U, V) -> W): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).component1(): kotlin.Int -public fun ((T, U) -> V).component1(): kotlin.Int -public fun (T.(U, V) -> W).component1(): kotlin.Int -@kotlin.inline() public fun ((T) -> U).component2(): kotlin.Int -public fun ((T, U) -> V).component2(): kotlin.Int -public fun (T.(U, V) -> W).component2(): kotlin.Int +@kotlin.inline() public operator fun ((T) -> U).component1(): kotlin.Int +public operator fun ((T, U) -> V).component1(): kotlin.Int +public operator fun (T.(U, V) -> W).component1(): kotlin.Int +@kotlin.inline() public operator fun ((T) -> U).component2(): kotlin.Int +public operator fun ((T, U) -> V).component2(): kotlin.Int +public operator fun (T.(U, V) -> W).component2(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.kt index 149b9b99159..0cde2e63426 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -RECURSION_IN_INLINE -inline fun Function1.contains(p: Function1): Boolean { +operator inline fun Function1.contains(p: Function1): Boolean { this in p p in this return false @@ -11,9 +11,9 @@ inline fun inlineFunWithInvoke(s: (p: T) -> U) { } -fun Function2.contains(p: Function2): Boolean = false +operator fun Function2.contains(p: Function2): Boolean = false -fun @Extension Function3.contains(ext: @Extension Function3): Boolean = false +operator fun @Extension Function3.contains(ext: @Extension Function3): Boolean = false inline fun inlineFunWithInvoke(s: (p: T, l: U) -> U, ext: T.(p: U, l: U) -> V) { s in s diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.txt index 015ea11b148..17542f73c28 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/contains.txt @@ -2,6 +2,6 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T, U) -> U, /*1*/ ext: T.(U, U) -> V): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).contains(/*0*/ p: (T) -> U): kotlin.Boolean -public fun ((T, U) -> V).contains(/*0*/ p: (T, U) -> V): kotlin.Boolean -public fun (T.(U, V) -> W).contains(/*0*/ ext: T.(U, V) -> W): kotlin.Boolean +@kotlin.inline() public operator fun ((T) -> U).contains(/*0*/ p: (T) -> U): kotlin.Boolean +public operator fun ((T, U) -> V).contains(/*0*/ p: (T, U) -> V): kotlin.Boolean +public operator fun (T.(U, V) -> W).contains(/*0*/ ext: T.(U, V) -> W): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.kt index f6134fd3064..105bbd25dbb 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.kt @@ -1,17 +1,17 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -CONFLICTING_JVM_DECLARATIONS -fun Function1.minus(p: Function1) { +operator fun Function1.minus(p: Function1) { } -fun @Extension Function2.minus(p: T.(p: U) -> V) { +operator fun @Extension Function2.minus(p: T.(p: U) -> V) { } -inline fun Function1.plus(p: Function1) { +inline operator fun Function1.plus(p: Function1) { this - p } -inline fun @Extension Function2.plus(p: T.(p: U) -> V) { +inline operator fun @Extension Function2.plus(p: T.(p: U) -> V) { this - p } diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.txt index a8465fe7475..949c57f87ea 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/mathOperations.txt @@ -2,9 +2,9 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U, /*1*/ ext: T.(U) -> V): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U, /*1*/ ext: T.(U) -> V): kotlin.Unit -public fun ((T) -> U).minus(/*0*/ p: (T) -> U): kotlin.Unit -public fun (T.(U) -> V).minus(/*0*/ p: T.(U) -> V): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).plus(/*0*/ p: (T) -> U): kotlin.Unit -@kotlin.inline() public fun (T.(U) -> V).plus(/*0*/ p: T.(U) -> V): kotlin.Unit +public operator fun ((T) -> U).minus(/*0*/ p: (T) -> U): kotlin.Unit +public operator fun (T.(U) -> V).minus(/*0*/ p: T.(U) -> V): kotlin.Unit +@kotlin.inline() public operator fun ((T) -> U).plus(/*0*/ p: (T) -> U): kotlin.Unit +@kotlin.inline() public operator fun (T.(U) -> V).plus(/*0*/ p: T.(U) -> V): kotlin.Unit @kotlin.inline() public fun ((T) -> U).submit(): kotlin.Unit @kotlin.inline() public fun (T.(U) -> V).submit(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt index ed297511152..8016216964a 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -RECURSION_IN_INLINE -inline fun Function1.rangeTo(p: Function1): Range { +inline operator fun Function1.rangeTo(p: Function1): Range { this..p p..this return 1..2 @@ -12,11 +12,11 @@ inline fun inlineFunWithInvoke(s: (p: T) -> U) { } -fun Function2.rangeTo(p: Function2): Range { +operator fun Function2.rangeTo(p: Function2): Range { return 1..2 } -fun @Extension Function3.rangeTo(ext: @Extension Function3): Range { +operator fun @Extension Function3.rangeTo(ext: @Extension Function3): Range { return 1..2 } diff --git a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt index a2699cd9a15..a06249c1542 100644 --- a/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt +++ b/compiler/testData/diagnostics/tests/inline/binaryExpressions/rangeTo.txt @@ -2,6 +2,6 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> U): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T, U) -> U, /*1*/ ext: T.(U, U) -> V): kotlin.Unit -@kotlin.inline() public fun ((T) -> U).rangeTo(/*0*/ p: (T) -> U): kotlin.Range -public fun ((T, U) -> V).rangeTo(/*0*/ p: (T, U) -> V): kotlin.Range -public fun (T.(U, V) -> W).rangeTo(/*0*/ ext: T.(U, V) -> W): kotlin.Range +@kotlin.inline() public operator fun ((T) -> U).rangeTo(/*0*/ p: (T) -> U): kotlin.Range +public operator fun ((T, U) -> V).rangeTo(/*0*/ p: (T, U) -> V): kotlin.Range +public operator fun (T.(U, V) -> W).rangeTo(/*0*/ ext: T.(U, V) -> W): kotlin.Range diff --git a/compiler/testData/diagnostics/tests/inline/recursion.kt b/compiler/testData/diagnostics/tests/inline/recursion.kt index 02dff244c3b..021b84011a0 100644 --- a/compiler/testData/diagnostics/tests/inline/recursion.kt +++ b/compiler/testData/diagnostics/tests/inline/recursion.kt @@ -15,10 +15,10 @@ inline fun Function0.inlineExt() { {11}.inlineExt() } -inline fun Function1.not() : Boolean { +inline operator fun Function1.not() : Boolean { return !this } -inline fun Function1.inc() : Function1 { +inline operator fun Function1.inc() : Function1 { return this++ } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/recursion.txt b/compiler/testData/diagnostics/tests/inline/recursion.txt index 919421d1ebb..3192111f39d 100644 --- a/compiler/testData/diagnostics/tests/inline/recursion.txt +++ b/compiler/testData/diagnostics/tests/inline/recursion.txt @@ -2,6 +2,6 @@ package @kotlin.inline() public fun inlineFun(/*0*/ s: (kotlin.Int) -> kotlin.Unit): kotlin.Unit @kotlin.inline() public fun inlineFun(/*0*/ s: T): kotlin.Unit -@kotlin.inline() public fun ((T) -> V).inc(): (T) -> V +@kotlin.inline() public operator fun ((T) -> V).inc(): (T) -> V @kotlin.inline() public fun (() -> T).inlineExt(): kotlin.Unit -@kotlin.inline() public fun ((T) -> V).not(): kotlin.Boolean +@kotlin.inline() public operator fun ((T) -> V).not(): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.kt b/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.kt index 5a8ec85c859..9a16aa08d7e 100644 --- a/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.kt +++ b/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.kt @@ -1,14 +1,14 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -VAL_REASSIGNMENT -UNUSED_CHANGED_VALUE -VARIABLE_EXPECTED -inline fun Function1.plus() = this -fun Function1.minus() = this -inline fun Function1.inc() = this -fun Function1.dec() = this +inline operator fun Function1.plus() = this +operator fun Function1.minus() = this +inline operator fun Function1.inc() = this +operator fun Function1.dec() = this -inline fun @Extension Function2.plus(){} -fun @Extension Function2.minus(){} -inline fun @Extension Function2.inc() = this -fun @Extension Function2.dec() = this +inline operator fun @Extension Function2.plus(){} +operator fun @Extension Function2.minus(){} +inline operator fun @Extension Function2.inc() = this +operator fun @Extension Function2.dec() = this inline fun inlineFunWithInvoke(s: (p: T) -> V, ext: T.(p: T) -> V) { +s diff --git a/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.txt b/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.txt index 22f3d7ccfba..8da0ac01ea8 100644 --- a/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.txt +++ b/compiler/testData/diagnostics/tests/inline/unaryExpressions/mathOperation.txt @@ -1,12 +1,12 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> V, /*1*/ ext: T.(T) -> V): kotlin.Unit -public fun ((T) -> V).dec(): (T) -> V -public fun (T.(T) -> V).dec(): T.(T) -> V -@kotlin.inline() public fun ((T) -> V).inc(): (T) -> V -@kotlin.inline() public fun (T.(T) -> V).inc(): T.(T) -> V +public operator fun ((T) -> V).dec(): (T) -> V +public operator fun (T.(T) -> V).dec(): T.(T) -> V +@kotlin.inline() public operator fun ((T) -> V).inc(): (T) -> V +@kotlin.inline() public operator fun (T.(T) -> V).inc(): T.(T) -> V @kotlin.inline() public fun ((T) -> V).inlineFunWithInvoke(): kotlin.Unit -public fun ((T) -> V).minus(): (T) -> V -public fun (T.(T) -> V).minus(): kotlin.Unit -@kotlin.inline() public fun ((T) -> V).plus(): (T) -> V -@kotlin.inline() public fun (T.(T) -> V).plus(): kotlin.Unit +public operator fun ((T) -> V).minus(): (T) -> V +public operator fun (T.(T) -> V).minus(): kotlin.Unit +@kotlin.inline() public operator fun ((T) -> V).plus(): (T) -> V +@kotlin.inline() public operator fun (T.(T) -> V).plus(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.kt b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.kt index 777a2acfe9c..75a7c46794b 100644 --- a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.kt +++ b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -RECURSION_IN_INLINE -inline fun Function1.not() : Boolean { +inline operator fun Function1.not() : Boolean { return !this } @@ -7,11 +7,11 @@ inline fun inlineFunWithInvoke(s: (p: T) -> V) { !s } -fun Function2.not() : Boolean { +operator fun Function2.not() : Boolean { return !this } -fun @Extension Function3.not() : Boolean { +operator fun @Extension Function3.not() : Boolean { return !this } diff --git a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.txt b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.txt index 0d647b51335..9cba57a5e90 100644 --- a/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.txt +++ b/compiler/testData/diagnostics/tests/inline/unaryExpressions/notOperation.txt @@ -2,6 +2,6 @@ package @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T) -> V): kotlin.Unit @kotlin.inline() public fun inlineFunWithInvoke(/*0*/ s: (T, U) -> V, /*1*/ ext: T.(T, U) -> V): kotlin.Unit -@kotlin.inline() public fun ((T) -> V).not(): kotlin.Boolean -public fun ((T, U) -> V).not(): kotlin.Boolean -public fun (T.(U, V) -> W).not(): kotlin.Boolean +@kotlin.inline() public operator fun ((T) -> V).not(): kotlin.Boolean +public operator fun ((T, U) -> V).not(): kotlin.Boolean +public operator fun (T.(U, V) -> W).not(): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt index 1bf30bf8e15..3c001b643b8 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.kt @@ -6,21 +6,21 @@ class WithClassObject { class Nested() class NestedWithClassObject { companion object : N } enum class NestedEnum { A } - object NestedObj : N { fun invoke() = 1 } + object NestedObj : N { operator fun invoke() = 1 } } class WithoutClassObject { class Nested() class NestedWithClassObject { companion object : N } enum class NestedEnum { A } - object NestedObj : N { fun invoke() = 1 } + object NestedObj : N { operator fun invoke() = 1 } } object Obj { class Nested() class NestedWithClassObject { companion object : N } enum class NestedEnum { A } - object NestedObj : N { fun invoke() = 1 } + object NestedObj : N { operator fun invoke() = 1 } } fun test(with: WithClassObject, without: WithoutClassObject, obj: Obj) { diff --git a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.txt b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.txt index ec7fc47eda5..b2e5a35a91f 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.txt +++ b/compiler/testData/diagnostics/tests/inner/nestedClassAccessedViaInstanceReference.txt @@ -44,7 +44,7 @@ public object Obj { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): kotlin.Int + public final operator fun invoke(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -106,7 +106,7 @@ public final class WithClassObject { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): kotlin.Int + public final operator fun invoke(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -161,7 +161,7 @@ public final class WithoutClassObject { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun foo(): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): kotlin.Int + public final operator fun invoke(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt index c737813ab55..a124f892048 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.kt @@ -1,11 +1,11 @@ class A() { - fun plus(i : Int) {} - fun minus() {} - fun contains(a : Any?) : Boolean = true + operator fun plus(i : Int) {} + operator fun minus() {} + operator fun contains(a : Any?) : Boolean = true } -fun A.div(i : Int) {} -fun A?.times(i : Int) {} +operator fun A.div(i : Int) {} +operator fun A?.times(i : Int) {} fun test(x : Int?, a : A?) { x.plus(1) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.txt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.txt index 322a8d43b5b..3646a244fce 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.txt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.txt @@ -1,15 +1,15 @@ package public fun test(/*0*/ x: kotlin.Int?, /*1*/ a: A?): kotlin.Unit -public fun A.div(/*0*/ i: kotlin.Int): kotlin.Unit -public fun A?.times(/*0*/ i: kotlin.Int): kotlin.Unit +public operator fun A.div(/*0*/ i: kotlin.Int): kotlin.Unit +public operator fun A?.times(/*0*/ i: kotlin.Int): kotlin.Unit public final class A { public constructor A() - public final fun contains(/*0*/ a: kotlin.Any?): kotlin.Boolean + public final operator fun contains(/*0*/ a: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun minus(): kotlin.Unit - public final fun plus(/*0*/ i: kotlin.Int): kotlin.Unit + public final operator fun minus(): kotlin.Unit + public final operator fun plus(/*0*/ i: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.txt b/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.txt index 2c95c3153b4..7090fe326cd 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.txt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeAccessOnUnit.txt @@ -5,7 +5,7 @@ public fun foo(/*0*/ my: My?): kotlin.Int? @kotlin.data() public final class My { public constructor My(/*0*/ x: kotlin.Unit) public final val x: kotlin.Unit - public final /*synthesized*/ fun component1(): kotlin.Unit + public final operator /*synthesized*/ fun component1(): kotlin.Unit public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Unit = ...): My public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.kt index 61b0274e6fc..57aeb019ee2 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.kt @@ -2,7 +2,7 @@ class A { val b = B() } class B -fun B.invoke(i: Int) = i +operator fun B.invoke(i: Int) = i fun foo(i: Int) = i diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.txt b/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.txt index 064c2899d52..2cd8dda8b5c 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.txt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeCallWithInvoke.txt @@ -2,7 +2,7 @@ package public fun foo(/*0*/ i: kotlin.Int): kotlin.Int public fun test(/*0*/ a: A?): kotlin.Unit -public fun B.invoke(/*0*/ i: kotlin.Int): kotlin.Int +public operator fun B.invoke(/*0*/ i: kotlin.Int): kotlin.Int public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.kt b/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.kt index 1b2d3819d80..9522a397361 100644 --- a/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.kt +++ b/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.kt @@ -6,7 +6,7 @@ fun test() { class A() { companion object { object f { - fun invoke(i: Int) = i + operator fun invoke(i: Int) = i } } } diff --git a/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.txt b/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.txt index 362d59489f6..2e81d0a9cd5 100644 --- a/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.txt +++ b/compiler/testData/diagnostics/tests/objects/invokeOnInnerObject.txt @@ -18,7 +18,7 @@ public final class A { private constructor f() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun invoke(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.kt index e2c66b75fc3..94d57e3294a 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.kt @@ -2,10 +2,10 @@ package kt1820 class MyInt(val i: Int) { - fun plus(m: MyInt) : MyInt = MyInt(m.i + i) + operator fun plus(m: MyInt) : MyInt = MyInt(m.i + i) } -fun Any.plusAssign(a: Any) {} +operator fun Any.plusAssign(a: Any) {} fun test(m: MyInt) { m += m diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.txt index 013b2398c56..1a806cf7d26 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignOperatorAmbiguity.txt @@ -2,14 +2,14 @@ package package kt1820 { public fun test(/*0*/ m: kt1820.MyInt): kotlin.Unit - public fun kotlin.Any.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit + public operator fun kotlin.Any.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit public final class MyInt { public constructor MyInt(/*0*/ i: kotlin.Int) public final val i: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plus(/*0*/ m: kt1820.MyInt): kt1820.MyInt + public final operator fun plus(/*0*/ m: kt1820.MyInt): kt1820.MyInt public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.kt index 7027dc751f1..075d1b981fb 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.kt @@ -1,9 +1,9 @@ class A { - fun plusAssign(x: Int) {} - fun minusAssign(x: Int) {} - fun timesAssign(x: Int) {} - fun divAssign(x: Int) {} - fun modAssign(x: Int) {} + operator fun plusAssign(x: Int) {} + operator fun minusAssign(x: Int) {} + operator fun timesAssign(x: Int) {} + operator fun divAssign(x: Int) {} + operator fun modAssign(x: Int) {} } fun testVal() { @@ -24,11 +24,11 @@ fun testExpr() { } class B { - fun plus(x: Int): B = B() - fun minus(x: Int): B = B() - fun times(x: Int): B = B() - fun div(x: Int): B = B() - fun mod(x: Int): B = B() + operator fun plus(x: Int): B = B() + operator fun minus(x: Int): B = B() + operator fun times(x: Int): B = B() + operator fun div(x: Int): B = B() + operator fun mod(x: Int): B = B() } fun testWrong() { diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.txt index e0f71488c6b..f2a070f9cf7 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/AssignmentOperations.txt @@ -6,24 +6,24 @@ public fun testWrong(): kotlin.Unit public final class A { public constructor A() - public final fun divAssign(/*0*/ x: kotlin.Int): kotlin.Unit + public final operator fun divAssign(/*0*/ x: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun minusAssign(/*0*/ x: kotlin.Int): kotlin.Unit - public final fun modAssign(/*0*/ x: kotlin.Int): kotlin.Unit - public final fun plusAssign(/*0*/ x: kotlin.Int): kotlin.Unit - public final fun timesAssign(/*0*/ x: kotlin.Int): kotlin.Unit + public final operator fun minusAssign(/*0*/ x: kotlin.Int): kotlin.Unit + public final operator fun modAssign(/*0*/ x: kotlin.Int): kotlin.Unit + public final operator fun plusAssign(/*0*/ x: kotlin.Int): kotlin.Unit + public final operator fun timesAssign(/*0*/ x: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class B { public constructor B() - public final fun div(/*0*/ x: kotlin.Int): B + public final operator fun div(/*0*/ x: kotlin.Int): B public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun minus(/*0*/ x: kotlin.Int): B - public final fun mod(/*0*/ x: kotlin.Int): B - public final fun plus(/*0*/ x: kotlin.Int): B - public final fun times(/*0*/ x: kotlin.Int): B + public final operator fun minus(/*0*/ x: kotlin.Int): B + public final operator fun mod(/*0*/ x: kotlin.Int): B + public final operator fun plus(/*0*/ x: kotlin.Int): B + public final operator fun times(/*0*/ x: kotlin.Int): B public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt index 209820a1ced..a14df555888 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.kt @@ -32,11 +32,11 @@ fun shortBinEq() { } class A { - fun plus(x : A) : A { return x } + operator fun plus(x : A) : A { return x } } class B { - fun plus(x : A) : A { return x } + operator fun plus(x : A) : A { return x } } fun overloading() { diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.txt index 6ccb70ac1bc..dc7a70bb0e3 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/assignmentOperationsCheckReturnType.txt @@ -8,7 +8,7 @@ public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plus(/*0*/ x: A): A + public final operator fun plus(/*0*/ x: A): A public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -16,6 +16,6 @@ public final class B { public constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plus(/*0*/ x: A): A + public final operator fun plus(/*0*/ x: A): A public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.kt index 275e43f5231..b447be3d803 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class C { - fun compareTo(c: C): Int? = null + operator fun compareTo(c: C): Int? = null } fun test(c: C) { diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.txt index 6a89c81b608..ceefc3fc68f 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/compareToNullable.txt @@ -4,7 +4,7 @@ public fun test(/*0*/ c: C): kotlin.Unit public final class C { public constructor C() - public final fun compareTo(/*0*/ c: C): kotlin.Int? + public final operator fun compareTo(/*0*/ c: C): kotlin.Int? public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.kt index 924d83be3e4..e4f9c170868 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.kt @@ -7,8 +7,8 @@ class event() { val callbacks = ArrayList< Function1 >() // Should be ArrayList<()->Unit>, bug posted - fun plusAssign(f : (T) -> Unit) = callbacks.add(f) - fun minusAssign(f : (T) -> Unit) = callbacks.remove(f) + operator fun plusAssign(f : (T) -> Unit) = callbacks.add(f) + operator fun minusAssign(f : (T) -> Unit) = callbacks.remove(f) fun call(value : T) { for(c in callbacks) c(value) } } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.txt index 5b705120446..4570f86b22e 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt1028.txt @@ -33,8 +33,8 @@ package kt1028 { public final fun call(/*0*/ value: T): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun minusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean - public final fun plusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean + public final operator fun minusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean + public final operator fun plusAssign(/*0*/ f: (T) -> kotlin.Unit): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt index e33cf9c167d..e8945dbb4c1 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.kt @@ -1,10 +1,10 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER public class A { - public fun get(vararg attrs : Pair) : A = this + public operator fun get(vararg attrs : Pair) : A = this } -fun String.plus() : A = A() -fun A.div(s : String) : A = A() +operator fun String.plus() : A = A() +operator fun A.div(s : String) : A = A() fun test() { (+"node2" / "node3" / "zzz") ["attr" to "value", "a2" to "v2"] @@ -12,9 +12,9 @@ fun test() { //--------- class B { - public fun get(s : String, q : String) : B = this - public fun get(s : Pair) : B = this - public fun invoke(q : B.() -> Unit) : B = this + 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 {} diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.txt index 3b11d6a4d72..8f0037df299 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/kt3450.txt @@ -2,14 +2,14 @@ package public val x: B public fun test(): kotlin.Unit -public fun A.div(/*0*/ s: kotlin.String): A -public fun kotlin.String.plus(): A +public operator fun A.div(/*0*/ s: kotlin.String): A +public operator fun kotlin.String.plus(): A public fun A.to(/*0*/ that: B): Pair public final class A { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ vararg attrs: Pair /*kotlin.Array>*/): A + public final operator fun get(/*0*/ vararg attrs: Pair /*kotlin.Array>*/): A public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -17,10 +17,10 @@ public final class A { public final class B { public constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ s: Pair): B - public final fun get(/*0*/ s: kotlin.String, /*1*/ q: kotlin.String): B + public final operator fun get(/*0*/ s: Pair): B + public final operator fun get(/*0*/ s: kotlin.String, /*1*/ q: kotlin.String): B public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ q: B.() -> kotlin.Unit): B + public final operator fun invoke(/*0*/ q: B.() -> kotlin.Unit): B public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -28,8 +28,8 @@ public final class B { public constructor Pair(/*0*/ first: A, /*1*/ second: B) public final val first: A public final val second: B - public final /*synthesized*/ fun component1(): A - public final /*synthesized*/ fun component2(): B + public final operator /*synthesized*/ fun component1(): A + public final operator /*synthesized*/ fun component2(): B public final /*synthesized*/ fun copy(/*0*/ first: A = ..., /*1*/ second: B = ...): Pair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.kt index 79434adae30..6d4ad857ee8 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.kt @@ -1,15 +1,15 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class C { - fun get(i: Int): C = this + operator fun get(i: Int): C = this } -fun C.plus(a: Any): C = this -fun C.plusAssign(a: Any) {} +operator fun C.plus(a: Any): C = this +operator fun C.plusAssign(a: Any) {} class C1 { - fun get(i: Int): C = C() - fun set(i: Int, v: C) {} + operator fun get(i: Int): C = C() + operator fun set(i: Int, v: C) {} } fun test() { diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.txt index c364a652ed2..b4e5df4869d 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.txt @@ -1,13 +1,13 @@ package public fun test(): kotlin.Unit -public fun C.plus(/*0*/ a: kotlin.Any): C -public fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit +public operator fun C.plus(/*0*/ a: kotlin.Any): C +public operator fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit public final class C { public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ i: kotlin.Int): C + public final operator fun get(/*0*/ i: kotlin.Int): C public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -15,8 +15,8 @@ public final class C { public final class C1 { public constructor C1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ i: kotlin.Int): C + public final operator fun get(/*0*/ i: kotlin.Int): C public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ i: kotlin.Int, /*1*/ v: C): kotlin.Unit + public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ v: C): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.kt index 0dd93d57495..f4ee40b166b 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.kt @@ -2,8 +2,8 @@ class C -fun C.plus(a: Any): C = this -fun C.plusAssign(a: Any) {} +operator fun C.plus(a: Any): C = this +operator fun C.plusAssign(a: Any) {} fun test() { val c = C() diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.txt index f5aea7f76b7..c4f4cd5d35a 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnLocal.txt @@ -1,8 +1,8 @@ package public fun test(): kotlin.Unit -public fun C.plus(/*0*/ a: kotlin.Any): C -public fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit +public operator fun C.plus(/*0*/ a: kotlin.Any): C +public operator fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit public final class C { public constructor C() diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.kt index 3e0a7ff42bb..3717b5046c1 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.kt @@ -4,8 +4,8 @@ class C { val c: C = C() } -fun C.plus(a: Any): C = this -fun C.plusAssign(a: Any) {} +operator fun C.plus(a: Any): C = this +operator fun C.plusAssign(a: Any) {} class C1 { var c: C = C() diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.txt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.txt index dcf5c11375b..eae41870d5f 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.txt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnProperty.txt @@ -1,8 +1,8 @@ package public fun test(): kotlin.Unit -public fun C.plus(/*0*/ a: kotlin.Any): C -public fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit +public operator fun C.plus(/*0*/ a: kotlin.Any): C +public operator fun C.plusAssign(/*0*/ a: kotlin.Any): kotlin.Unit public final class C { public constructor C() diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt index 951251b949f..81459c66ebd 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.kt @@ -17,8 +17,7 @@ public class J { // FILE: k.kt fun test() { - J.staticNN() - J.staticN() - J.staticJ() -} - + J.staticNN() + J.staticN() + J.staticJ() +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt index 996ce6fc410..0fe77165de8 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt @@ -26,8 +26,7 @@ fun test() { // platform type with no annotation val platformJ = J.staticJ - val (a1, b1) = platformNN + val (a1, b1) = platformNN val (a2, b2) = platformN - val (a3, b3) = platformJ -} - + val (a3, b3) = platformJ +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.kt index 7c4f02a8cd2..a854d652825 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.kt @@ -23,5 +23,5 @@ fun test() { fun foo(a: Any) {} class Bar { - fun invoke(a: Any) {} + operator fun invoke(a: Any) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.txt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.txt index c42b780ee69..06031ea77c0 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullAssertionInCall.txt @@ -7,7 +7,7 @@ public final class Bar { public constructor Bar() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ a: kotlin.Any): kotlin.Unit + public final operator fun invoke(/*0*/ a: kotlin.Any): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.kt index ab1f846dcbf..abdfb54d12e 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.kt @@ -24,5 +24,5 @@ fun test() { fun foo(a: Any) {} class Bar { - fun invoke(a: Any) {} + operator fun invoke(a: Any) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.txt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.txt index c42b780ee69..06031ea77c0 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/uselessElvisInCall.txt @@ -7,7 +7,7 @@ public final class Bar { public constructor Bar() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ a: kotlin.Any): kotlin.Unit + public final operator fun invoke(/*0*/ a: kotlin.Any): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt b/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt index df9f659e917..30ad017adf2 100644 --- a/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt +++ b/compiler/testData/diagnostics/tests/reflection/noReflectionInClassPath.kt @@ -11,8 +11,8 @@ fun n04(p: KProperty0) = p.get() fun n05(p: KMutableProperty0) = p.set("") fun n06(p: KProperty0) = p.get() fun n07(p: KFunction) = p.name -fun n08(p: KProperty1) = p[""] -fun n09(p: KProperty2) = p["", ""] +fun n08(p: KProperty1) = p.get("") +fun n09(p: KProperty2) = p.get("", "") fun n10() = (Foo::func).invoke(Foo("")) fun n11() = (Foo::func)(Foo("")) diff --git a/compiler/testData/diagnostics/tests/regressions/kt235.kt b/compiler/testData/diagnostics/tests/regressions/kt235.kt index 98626d92f20..836961e4f95 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt235.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt235.kt @@ -35,15 +35,15 @@ fun main(args: Array) { } class MyArray() { - fun get(i: Int): Int = 1 - fun set(i: Int, value: Int): Int = 1 + operator fun get(i: Int): Int = 1 + operator fun set(i: Int, value: Int): Int = 1 } class MyArray1() { - fun get(i: Int): Int = 1 - fun set(i: Int, value: Int) {} + operator fun get(i: Int): Int = 1 + operator fun set(i: Int, value: Int) {} } class MyNumber() { - fun inc(): MyNumber = MyNumber() + operator fun inc(): MyNumber = MyNumber() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt235.txt b/compiler/testData/diagnostics/tests/regressions/kt235.txt index f769884c98b..5a30ba0be4c 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt235.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt235.txt @@ -6,18 +6,18 @@ package kt235 { public final class MyArray { public constructor MyArray() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun get(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ i: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Int + public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public final class MyArray1 { public constructor MyArray1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun get(/*0*/ i: kotlin.Int): kotlin.Int + public final operator fun get(/*0*/ i: kotlin.Int): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun set(/*0*/ i: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit + public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ value: kotlin.Int): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -25,7 +25,7 @@ package kt235 { public constructor MyNumber() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun inc(): kt235.MyNumber + public final operator fun inc(): kt235.MyNumber public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt258.kt b/compiler/testData/diagnostics/tests/regressions/kt258.kt index 7a5252fd74e..7ea51cec00d 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt258.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt258.kt @@ -7,4 +7,4 @@ fun test() { attributes["href"] = "1" // inference fails, but it shouldn't } -fun MutableMap.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file +operator fun MutableMap.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt258.txt b/compiler/testData/diagnostics/tests/regressions/kt258.txt index 5d943ec814b..612f1a96e9f 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt258.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt258.txt @@ -1,4 +1,4 @@ package public fun test(): kotlin.Unit -public fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): kotlin.Unit +public operator fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/regressions/kt282.kt b/compiler/testData/diagnostics/tests/regressions/kt282.kt index 3b56e15f32a..f6c2f81433a 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt282.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt282.kt @@ -1,12 +1,12 @@ // KT-282 Nullability in extension functions and in binary calls class Set { - fun contains(x : Int) : Boolean = true + operator fun contains(x : Int) : Boolean = true } -fun Set?.plus(x : Int) : Int = 1 +operator fun Set?.plus(x : Int) : Int = 1 -fun Int?.contains(x : Int) : Boolean = false +operator fun Int?.contains(x : Int) : Boolean = false fun f(): Unit { var set : Set? = null diff --git a/compiler/testData/diagnostics/tests/regressions/kt282.txt b/compiler/testData/diagnostics/tests/regressions/kt282.txt index e618b22b157..365c0c6d9b8 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt282.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt282.txt @@ -1,12 +1,12 @@ package public fun f(): kotlin.Unit -public fun kotlin.Int?.contains(/*0*/ x: kotlin.Int): kotlin.Boolean -public fun Set?.plus(/*0*/ x: kotlin.Int): kotlin.Int +public operator fun kotlin.Int?.contains(/*0*/ x: kotlin.Int): kotlin.Boolean +public operator fun Set?.plus(/*0*/ x: kotlin.Int): kotlin.Int public final class Set { public constructor Set() - public final fun contains(/*0*/ x: kotlin.Int): kotlin.Boolean + public final operator fun contains(/*0*/ x: kotlin.Int): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/regressions/kt459.kt b/compiler/testData/diagnostics/tests/regressions/kt459.kt index b300e3b232b..c2b93e0e6a1 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt459.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt459.kt @@ -5,4 +5,4 @@ fun test() { attributes["href"] = "1" // inference fails, but it shouldn't } -fun Map.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file +operator fun Map.set(key : K, value : V) {}//= this.put(key, value) \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt459.txt b/compiler/testData/diagnostics/tests/regressions/kt459.txt index 48da8ad00fa..316786523da 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt459.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt459.txt @@ -1,4 +1,4 @@ package public fun test(): kotlin.Unit -public fun kotlin.Map.set(/*0*/ key: K, /*1*/ value: V): kotlin.Unit +public operator fun kotlin.Map.set(/*0*/ key: K, /*1*/ value: V): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/regressions/kt469.kt b/compiler/testData/diagnostics/tests/regressions/kt469.kt index 1341919aff3..716cda78433 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt469.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt469.kt @@ -11,7 +11,7 @@ fun bar(list : MutableList) { System.out.println(list) } -fun MutableList.plusAssign(t : T) { +operator fun MutableList.plusAssign(t : T) { add(t) } @@ -22,7 +22,7 @@ fun foo() { } class MyNumber(var i: Int) { - fun minusAssign(m : MyNumber) { + operator fun minusAssign(m : MyNumber) { i -= m.i } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt469.txt b/compiler/testData/diagnostics/tests/regressions/kt469.txt index dd3e7939c92..4ceb445a5a9 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt469.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt469.txt @@ -3,14 +3,14 @@ package package kt469 { public fun bar(/*0*/ list: kotlin.MutableList): kotlin.Unit public fun foo(): kotlin.Unit - public fun kotlin.MutableList.plusAssign(/*0*/ t: T): kotlin.Unit + public operator fun kotlin.MutableList.plusAssign(/*0*/ t: T): kotlin.Unit public final class MyNumber { public constructor MyNumber(/*0*/ i: kotlin.Int) public final var i: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun minusAssign(/*0*/ m: kt469.MyNumber): kotlin.Unit + public final operator fun minusAssign(/*0*/ m: kt469.MyNumber): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt597.kt b/compiler/testData/diagnostics/tests/regressions/kt597.kt index c42637c3887..53870c1423f 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt597.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt597.kt @@ -6,7 +6,7 @@ fun Array?.get(i: Int) : T { else throw NullPointerException() } -fun Int?.inc() : Int { +operator fun Int?.inc() : Int { if (this != null) return this.inc() else diff --git a/compiler/testData/diagnostics/tests/regressions/kt597.txt b/compiler/testData/diagnostics/tests/regressions/kt597.txt index 5eb2cf88bf0..0953ace85d5 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt597.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt597.txt @@ -2,4 +2,4 @@ package public fun test(): kotlin.Unit public fun kotlin.Array?.get(/*0*/ i: kotlin.Int): T -public fun kotlin.Int?.inc(): kotlin.Int +public operator fun kotlin.Int?.inc(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/regressions/kt618.kt b/compiler/testData/diagnostics/tests/regressions/kt618.kt index 8f6d26f493b..9ec89637b0e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt618.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt618.kt @@ -1,19 +1,19 @@ package lol class B() { - fun plusAssign(other : B) : String { + operator fun plusAssign(other : B) : String { return "s" } - fun minusAssign(other : B) : String { + operator fun minusAssign(other : B) : String { return "s" } - fun modAssign(other : B) : String { + operator fun modAssign(other : B) : String { return "s" } - fun divAssign(other : B) : String { + operator fun divAssign(other : B) : String { return "s" } - fun timesAssign(other : B) : String { + operator fun timesAssign(other : B) : String { return "s" } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt618.txt b/compiler/testData/diagnostics/tests/regressions/kt618.txt index c3e100964d0..cbbc7461f93 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt618.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt618.txt @@ -5,13 +5,13 @@ package lol { public final class B { public constructor B() - public final fun divAssign(/*0*/ other: lol.B): kotlin.String + public final operator fun divAssign(/*0*/ other: lol.B): kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun minusAssign(/*0*/ other: lol.B): kotlin.String - public final fun modAssign(/*0*/ other: lol.B): kotlin.String - public final fun plusAssign(/*0*/ other: lol.B): kotlin.String - public final fun timesAssign(/*0*/ other: lol.B): kotlin.String + public final operator fun minusAssign(/*0*/ other: lol.B): kotlin.String + public final operator fun modAssign(/*0*/ other: lol.B): kotlin.String + public final operator fun plusAssign(/*0*/ other: lol.B): kotlin.String + public final operator fun timesAssign(/*0*/ other: lol.B): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt629.kt b/compiler/testData/diagnostics/tests/regressions/kt629.kt index 7f32a12dd75..188b68b2e21 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt629.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt629.kt @@ -4,7 +4,7 @@ package kt629 class A() { var p = "yeah" - fun mod(other : A) : A { + operator fun mod(other : A) : A { return A(); } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt629.txt b/compiler/testData/diagnostics/tests/regressions/kt629.txt index 27656d0b239..27a69640167 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt629.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt629.txt @@ -9,7 +9,7 @@ package kt629 { public final var p: kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun mod(/*0*/ other: kt629.A): kt629.A + public final operator fun mod(/*0*/ other: kt629.A): kt629.A public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt7585/base.txt b/compiler/testData/diagnostics/tests/regressions/kt7585/base.txt index d7ede2dbf70..81a235f2eca 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt7585/base.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt7585/base.txt @@ -28,8 +28,8 @@ public final class MyWrapper : Wrapper { public constructor Pair(/*0*/ a: T, /*1*/ b: T) public final val a: T public final val b: T - public final /*synthesized*/ fun component1(): T - public final /*synthesized*/ fun component2(): T + public final operator /*synthesized*/ fun component1(): T + public final operator /*synthesized*/ fun component2(): T public final /*synthesized*/ fun copy(/*0*/ a: T = ..., /*1*/ b: T = ...): Pair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/regressions/kt7585/java.txt b/compiler/testData/diagnostics/tests/regressions/kt7585/java.txt index 0e2c97d9f34..2ab80c3d350 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt7585/java.txt +++ b/compiler/testData/diagnostics/tests/regressions/kt7585/java.txt @@ -28,8 +28,8 @@ public final class MyWrapper : Wrapper { public constructor Pair(/*0*/ a: T, /*1*/ b: T) public final val a: T public final val b: T - public final /*synthesized*/ fun component1(): T - public final /*synthesized*/ fun component2(): T + public final operator /*synthesized*/ fun component1(): T + public final operator /*synthesized*/ fun component2(): T public final /*synthesized*/ fun copy(/*0*/ a: T = ..., /*1*/ b: T = ...): Pair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.kt index af608fada30..a299fbfb273 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class My { - private fun Int.invoke(s: String) {} + private operator fun Int.invoke(s: String) {} } fun My.foo(i: Int) { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.txt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.txt index d196073b25b..1754fe17cdd 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.txt @@ -7,5 +7,5 @@ public final class My { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - private final fun kotlin.Int.invoke(/*0*/ s: kotlin.String): kotlin.Unit + private final operator fun kotlin.Int.invoke(/*0*/ s: kotlin.String): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt index acb016330d7..9addabddf66 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.kt @@ -2,7 +2,7 @@ class A -fun T.invoke(a: A) {} +operator fun T.invoke(a: A) {} fun foo(s: String, ai: A) { 1(ai) diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.txt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.txt index 3daf743ea73..922e963f414 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/typeInferenceErrorForInvoke.txt @@ -1,7 +1,7 @@ package public fun foo(/*0*/ s: kotlin.String, /*1*/ ai: A): kotlin.Unit -public fun T.invoke(/*0*/ a: A): kotlin.Unit +public operator fun T.invoke(/*0*/ a: A): kotlin.Unit public final class A { public constructor A() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt index c45368415e2..042551c1249 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -fun String.invoke(i: Int) {} +operator fun String.invoke(i: Int) {} fun foo(s: String?) { s(1) diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.txt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.txt index e9786ce8725..b9af4b7bf4b 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.txt @@ -1,4 +1,4 @@ package public fun foo(/*0*/ s: kotlin.String?): kotlin.Unit -public fun kotlin.String.invoke(/*0*/ i: kotlin.Int): kotlin.Unit +public operator fun kotlin.String.invoke(/*0*/ i: kotlin.Int): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt index 34e25109c11..378cee5d3da 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.kt @@ -1,6 +1,6 @@ class Foo {} -fun Foo.invoke() {} +operator fun Foo.invoke() {} //no variable fun test(foo: Foo) { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt index b91b2d51e6b..86bd81e7326 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsExtension.txt @@ -6,7 +6,7 @@ public fun test(/*0*/ b: B): kotlin.Unit public fun test(/*0*/ d: D, /*1*/ c: C): kotlin.Unit public fun test(/*0*/ foo: Foo): kotlin.Unit public fun with(/*0*/ receiver: T, /*1*/ f: T.() -> R): R -public fun Foo.invoke(): kotlin.Unit +public operator fun Foo.invoke(): kotlin.Unit public interface A { public abstract val foo: Foo diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt index 82451afac38..6ef10cec845 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.kt @@ -1,5 +1,5 @@ class Foo { - fun invoke() {} + operator fun invoke() {} } //no variable diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt index b89540c4d3e..4f249d54635 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMember.txt @@ -38,6 +38,6 @@ public final class Foo { public constructor Foo() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): kotlin.Unit + public final operator fun invoke(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt index ea3d5fb4220..77469d22af0 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.kt @@ -2,7 +2,7 @@ class Foo //no variable interface A { - fun Foo.invoke() {} + operator fun Foo.invoke() {} fun test(foo: Foo) { foo() @@ -15,7 +15,7 @@ interface B { } class C { - fun Foo.invoke() {} + operator fun Foo.invoke() {} fun test(b: B) { b.foo() @@ -44,7 +44,7 @@ val D.foo: Foo get() = Foo() class E { - fun Foo.invoke() {} + operator fun Foo.invoke() {} fun test(d: D) { d.foo() @@ -70,7 +70,7 @@ interface F interface G { val F.foo: Foo - fun Foo.invoke() + operator fun Foo.invoke() fun test(f: F) { f.foo() @@ -99,7 +99,7 @@ interface U { } interface V { - fun Foo.invoke() {} + operator fun Foo.invoke() {} fun U.test(x: X) { x.foo() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt index ee95690f256..182c275f87d 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtension.txt @@ -12,7 +12,7 @@ public interface A { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open fun test(/*0*/ foo: Foo): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public open fun Foo.invoke(): kotlin.Unit + public open operator fun Foo.invoke(): kotlin.Unit } public interface B { @@ -28,7 +28,7 @@ public final class C { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun test(/*0*/ b: B): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public final fun Foo.invoke(): kotlin.Unit + public final operator fun Foo.invoke(): kotlin.Unit } public interface D { @@ -43,7 +43,7 @@ public final class E { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun test(/*0*/ d: D): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public final fun Foo.invoke(): kotlin.Unit + public final operator fun Foo.invoke(): kotlin.Unit } public interface F { @@ -65,7 +65,7 @@ public interface G { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open fun test(/*0*/ f: F): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public abstract fun Foo.invoke(): kotlin.Unit + public abstract operator fun Foo.invoke(): kotlin.Unit } public interface U { @@ -79,7 +79,7 @@ public interface V { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public open fun Foo.invoke(): kotlin.Unit + public open operator fun Foo.invoke(): kotlin.Unit public open fun U.test(/*0*/ x: X): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt index 6957b44b076..eec18dafdb9 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.kt @@ -1,6 +1,6 @@ interface A interface Foo { - fun A.invoke() + operator fun A.invoke() } fun test(a: A, foo: Foo) { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.txt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.txt index afa9ff621c2..d2f628ab34a 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAsMemberExtensionToExplicitReceiver.txt @@ -13,5 +13,5 @@ public interface Foo { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public abstract fun A.invoke(): kotlin.Unit + public abstract operator fun A.invoke(): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.kt index a4f863cbd30..a948ccb44a8 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.kt @@ -2,11 +2,11 @@ package bar open class A { - public fun invoke(f: A.() -> Unit) {} + public operator fun invoke(f: A.() -> Unit) {} } class B { - public fun invoke(f: B.() -> Unit) {} + public operator fun invoke(f: B.() -> Unit) {} } open class C diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.txt b/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.txt index 36d7be126df..8ce9b878615 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt3772.txt @@ -9,7 +9,7 @@ package bar { public constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ f: bar.A.() -> kotlin.Unit): kotlin.Unit + public final operator fun invoke(/*0*/ f: bar.A.() -> kotlin.Unit): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } @@ -17,7 +17,7 @@ package bar { public constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(/*0*/ f: bar.B.() -> kotlin.Unit): kotlin.Unit + public final operator fun invoke(/*0*/ f: bar.B.() -> kotlin.Unit): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt index 39a538eaf91..fb4cdeecaa0 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.kt @@ -17,7 +17,7 @@ class Either1 { class X { - fun invoke() { + operator fun invoke() { } } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.txt b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.txt index 9f4c9f8739c..6dddbdffde0 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt3833-invokeInsideNestedClass.txt @@ -52,7 +52,7 @@ package m { public constructor X() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): kotlin.Unit + public final operator fun invoke(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt index 1356cbaec06..658d5f35e63 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.kt @@ -6,13 +6,13 @@ import DOMElementTestClasses.cls2 enum class DOMElementTestClasses { cls1, cls2; - fun invoke() {} + operator fun invoke() {} } // use case 2 interface EnumStyleClass { - fun invoke() {} + operator fun invoke() {} } enum class TestClasses : EnumStyleClass { cls diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.txt b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.txt index 41843495c1e..93b5a9b6803 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.txt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt4321InvokeOnEnum.txt @@ -12,7 +12,7 @@ public final enum class DOMElementTestClasses : kotlin.Enum class Bar { - fun invoke(): Foo = throw Exception() + operator fun invoke(): Foo = throw Exception() } class A { diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.txt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.txt index 017ef74bd4e..4526ea3a633 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.txt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.txt @@ -15,7 +15,7 @@ public final class Bar { public constructor Bar() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): Foo + public final operator fun invoke(): Foo public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt index 3b15b06a080..57f3ef708a1 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt @@ -48,8 +48,8 @@ public sealed class Sealed { public constructor Tuple(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) public final val x: kotlin.Int public final val y: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): Sealed.Tuple public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.txt b/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.txt index 4524d738d8a..0520c1a6954 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.txt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/dataClasses.txt @@ -4,7 +4,7 @@ package public constructor A1() public constructor A1(/*0*/ x: kotlin.String) public final val x: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ...): A1 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -16,8 +16,8 @@ package public constructor A2(/*0*/ y: kotlin.String, /*1*/ z: kotlin.Int) public final val y: kotlin.String public final val z: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ y: kotlin.String = ..., /*1*/ z: kotlin.Int = ...): A2 public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.kt b/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.kt index 97ae30fc2b6..9a3513f1316 100644 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.kt +++ b/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.kt @@ -2,8 +2,8 @@ public inline fun Array(n: Int, block: (Int) -> T): Array = null!! class A { - fun component1() = 42 - fun component2() = 42 + operator fun component1() = 42 + operator fun component2() = 42 } fun foo(a: A, c: Int) { diff --git a/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.txt b/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.txt index ce922263a52..1aea448c2db 100644 --- a/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.txt +++ b/compiler/testData/diagnostics/tests/shadowing/ShadowMultiDeclarationWithFunParameter.txt @@ -5,8 +5,8 @@ public fun foo(/*0*/ a: A, /*1*/ c: kotlin.Int): kotlin.Unit public final class A { public constructor A() - public final fun component1(): kotlin.Int - public final fun component2(): kotlin.Int + public final operator fun component1(): kotlin.Int + public final operator fun component2(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.kt b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.kt index 258c1db6e12..7ef3af274b9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.kt @@ -2,7 +2,7 @@ // Advancement of KT-9126 class My(val x: Int?) { - fun plus(y: My) = if (this.x != null) this else y + operator fun plus(y: My) = if (this.x != null) this else y } fun foo() { diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.txt b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.txt index 5671067439d..7c00cdeadf6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.txt @@ -7,6 +7,6 @@ public final class My { public final val x: kotlin.Int? public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun plus(/*0*/ y: My): My + public final operator fun plus(/*0*/ y: My): My public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.kt index 0e0d62d5952..930f44a6ffc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.kt @@ -33,7 +33,7 @@ public data class Tag(public var tagName: String) { //from library -fun MutableMap.set(key : K, value : V) = this.put(key, value) +operator fun MutableMap.set(key : K, value : V) = this.put(key, value) fun arrayListOf(vararg values: T): MutableList = throw Exception() diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.txt b/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.txt index 81b842a7b43..8cba4186338 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/kt1355.txt @@ -3,7 +3,7 @@ package package a { public fun arrayListOf(/*0*/ vararg values: T /*kotlin.Array*/): kotlin.MutableList public fun foo(/*0*/ map: kotlin.MutableMap, /*1*/ value: kotlin.String?): kotlin.Unit - public fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? + public operator fun kotlin.MutableMap.set(/*0*/ key: K, /*1*/ value: V): V? @kotlin.data() public final class Tag { public constructor Tag(/*0*/ tagName: kotlin.String) @@ -11,7 +11,7 @@ package a { public final val contents: kotlin.MutableList public final var id: kotlin.String? public final var tagName: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ tagName: kotlin.String = ...): a.Tag public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt index 44190e099e4..cf7e8f8de06 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2865.kt @@ -1,4 +1,4 @@ -fun MutableMap.set(k: K, v: V) {} +operator fun MutableMap.set(k: K, v: V) {} fun foo(a: MutableMap, x: String?) { a[x!!] = x diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt2865.txt b/compiler/testData/diagnostics/tests/smartCasts/kt2865.txt index 0a9c5972d2f..a7485cad132 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt2865.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt2865.txt @@ -2,4 +2,4 @@ package public fun foo(/*0*/ a: kotlin.MutableMap, /*1*/ x: kotlin.String?): kotlin.Unit public fun foo1(/*0*/ a: kotlin.MutableMap, /*1*/ x: kotlin.String?): kotlin.Unit -public fun kotlin.MutableMap.set(/*0*/ k: K, /*1*/ v: V): kotlin.Unit +public operator fun kotlin.MutableMap.set(/*0*/ k: K, /*1*/ v: V): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt3711.txt b/compiler/testData/diagnostics/tests/smartCasts/kt3711.txt index 790d9564d06..815dd3b0dfc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt3711.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt3711.txt @@ -7,8 +7,8 @@ public fun kotlin.String.to(/*0*/ second: kotlin.String): StringPair public constructor StringPair(/*0*/ first: kotlin.String, /*1*/ second: kotlin.String) public final val first: kotlin.String public final val second: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ first: kotlin.String = ..., /*1*/ second: kotlin.String = ...): StringPair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt3899.txt b/compiler/testData/diagnostics/tests/smartCasts/kt3899.txt index ce216e8a0f5..357936f623f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt3899.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt3899.txt @@ -8,8 +8,8 @@ public fun kotlin.String.to(/*0*/ second: kotlin.String): StringPair public constructor StringPair(/*0*/ first: kotlin.String, /*1*/ second: kotlin.String) public final val first: kotlin.String public final val second: kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ first: kotlin.String = ..., /*1*/ second: kotlin.String = ...): StringPair public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/property.txt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/property.txt index 72210d2d93f..037a3e6223f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/property.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/property.txt @@ -5,7 +5,7 @@ public fun foo(/*0*/ y: MyClass): kotlin.Int @kotlin.data() public final class MyClass { public constructor MyClass(/*0*/ x: kotlin.String?) public final val x: kotlin.String? - public final /*synthesized*/ fun component1(): kotlin.String? + public final operator /*synthesized*/ fun component1(): kotlin.String? public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String? = ...): MyClass public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/doWhileWithBreak.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/doWhileWithBreak.txt index d9b98db5773..9caee9631f6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/doWhileWithBreak.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/doWhileWithBreak.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): kotlin.Unit @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.txt index 87938085f3b..ccc372a0a90 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEach.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): SomeObject @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.txt index 87938085f3b..ccc372a0a90 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithBreak.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): SomeObject @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.txt index 87938085f3b..ccc372a0a90 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/forEachWithContinue.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): SomeObject @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/infiniteWhileWithBreak.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/infiniteWhileWithBreak.txt index d9b98db5773..9caee9631f6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/infiniteWhileWithBreak.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/infiniteWhileWithBreak.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): kotlin.Unit @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/iterations.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/iterations.txt index 43c5b93250a..4086efde3da 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/iterations.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/iterations.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): kotlin.Unit @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt index 375c9579e7c..90aa70feef2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.kt @@ -1,7 +1,7 @@ class MyClass // In principle it is not correct, MyClass? is not a subtype of MyClass -fun MyClass.inc(): MyClass? { return null } +operator fun MyClass.inc(): MyClass? { return null } public fun box() : MyClass? { var i : MyClass? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.txt index 1bfb4a05271..93b1c9a20fe 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNotnullClassIncrement.txt @@ -1,7 +1,7 @@ package public fun box(): MyClass? -public fun MyClass.inc(): MyClass? +public operator fun MyClass.inc(): MyClass? public final class MyClass { public constructor MyClass() diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.kt index d1df0830ba0..92db4492a90 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.kt @@ -1,7 +1,7 @@ class MyClass // Correct at compile time but wrong at run-time -fun MyClass?.inc(): MyClass? { return null } +operator fun MyClass?.inc(): MyClass? { return null } public fun box() : MyClass? { var i : MyClass? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.txt index 56dfdbb361e..65b38601050 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableClassIncrement.txt @@ -1,7 +1,7 @@ package public fun box(): MyClass? -public fun MyClass?.inc(): MyClass? +public operator fun MyClass?.inc(): MyClass? public final class MyClass { public constructor MyClass() diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt index fa1b5d96fbc..452815a072d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt @@ -1,4 +1,4 @@ -fun Int?.inc(): Int? { return this } +operator fun Int?.inc(): Int? { return this } public fun box(arg: Int?) : Int? { var i : Int? = arg diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.txt index 01ea8f20d97..521a6694bab 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.txt @@ -1,4 +1,4 @@ package public fun box(/*0*/ arg: kotlin.Int?): kotlin.Int? -public fun kotlin.Int?.inc(): kotlin.Int? +public operator fun kotlin.Int?.inc(): kotlin.Int? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt index 88355dc61f1..26e87880923 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.kt @@ -1,7 +1,7 @@ class MyClass // In principle it is not correct, MyClass? is not a subtype of MyClass -fun MyClass.inc(): MyClass? { return null } +operator fun MyClass.inc(): MyClass? { return null } public fun box() { var i : MyClass? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.txt index 7f0a2946002..172966df78d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNotnullClassIncrement.txt @@ -1,7 +1,7 @@ package public fun box(): kotlin.Unit -public fun MyClass.inc(): MyClass? +public operator fun MyClass.inc(): MyClass? public final class MyClass { public constructor MyClass() diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt index d1dab95d697..ed45c89bd94 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt @@ -1,7 +1,7 @@ class MyClass // Correct at compile time but wrong at run-time -fun MyClass?.inc(): MyClass? { return null } +operator fun MyClass?.inc(): MyClass? { return null } public fun box() { var i : MyClass? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.txt index 05808163906..6cd13341925 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.txt @@ -1,7 +1,7 @@ package public fun box(): kotlin.Unit -public fun MyClass?.inc(): MyClass? +public operator fun MyClass?.inc(): MyClass? public final class MyClass { public constructor MyClass() diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt index a5781bcefc0..21b83aab131 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt @@ -1,4 +1,4 @@ -fun Int?.inc(): Int? { return this } +operator fun Int?.inc(): Int? { return this } public fun box(arg: Int?) : Int? { var i = arg diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.txt index 01ea8f20d97..521a6694bab 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.txt @@ -1,4 +1,4 @@ package public fun box(/*0*/ arg: kotlin.Int?): kotlin.Int? -public fun kotlin.Int?.inc(): kotlin.Int? +public operator fun kotlin.Int?.inc(): kotlin.Int? diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt index e876420dc28..531693040ff 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.kt @@ -1,10 +1,10 @@ fun create(): Map = null!! -fun Map.iterator(): Iterator> = null!! +operator fun Map.iterator(): Iterator> = null!! -fun Map.Entry.component1() = getKey() +operator fun Map.Entry.component1() = getKey() -fun Map.Entry.component2() = getValue() +operator fun Map.Entry.component2() = getValue() class MyClass { private var m: Map? = null diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.txt index 1b4d28b42ba..638d2e7ecb0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.txt @@ -1,9 +1,9 @@ package public fun create(): kotlin.Map -public fun kotlin.Map.Entry.component1(): K -public fun kotlin.Map.Entry.component2(): V -public fun kotlin.Map.iterator(): kotlin.Iterator> +public operator fun kotlin.Map.Entry.component1(): K +public operator fun kotlin.Map.Entry.component2(): V +public operator fun kotlin.Map.iterator(): kotlin.Iterator> public final class MyClass { public constructor MyClass() diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/whileWithBreak.txt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/whileWithBreak.txt index d9b98db5773..9caee9631f6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/whileWithBreak.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/whileWithBreak.txt @@ -5,7 +5,7 @@ public fun list(/*0*/ start: SomeObject): kotlin.Unit @kotlin.data() public final class SomeObject { public constructor SomeObject(/*0*/ n: SomeObject?) public final val n: SomeObject? - public final /*synthesized*/ fun component1(): SomeObject? + public final operator /*synthesized*/ fun component1(): SomeObject? public final /*synthesized*/ fun copy(/*0*/ n: SomeObject? = ...): SomeObject public final fun doSomething(): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt index deb516ef8d3..d2849500d72 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.kt @@ -44,13 +44,13 @@ val Any.extVal: () -> Unit get() = null!! val Any.extExtVal: Any.() -> Unit get() = null!! -fun Any.invoke() {} +operator fun Any.invoke() {} -fun Any.plus(a: Any) {} +operator fun Any.plus(a: Any) {} class C { - fun String.invoke() {} + operator fun String.invoke() {} val foo: String.() -> Unit = null!! val s: String = "" @@ -70,5 +70,5 @@ class C { } class WithInvoke { - fun invoke() {} + operator fun invoke() {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.txt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.txt index 777c9150aa5..d4a61a76738 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.txt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/staticCallsInDynamicContext.txt @@ -6,8 +6,8 @@ public val kotlin.Any.extVal: () -> kotlin.Unit public val kotlin.Any.extValFun: () -> kotlin.Unit public fun bar(): kotlin.Unit public fun kotlin.Any.ext(): kotlin.Unit -public fun kotlin.Any.invoke(): kotlin.Unit -public fun kotlin.Any.plus(/*0*/ a: kotlin.Any): kotlin.Unit +public operator fun kotlin.Any.invoke(): kotlin.Unit +public operator fun kotlin.Any.plus(/*0*/ a: kotlin.Any): kotlin.Unit public fun dynamic.test(): kotlin.Unit public final class C { @@ -18,7 +18,7 @@ public final class C { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - public final fun kotlin.String.invoke(): kotlin.Unit + public final operator fun kotlin.String.invoke(): kotlin.Unit public final fun dynamic.test(): kotlin.Unit } @@ -26,6 +26,6 @@ public final class WithInvoke { public constructor WithInvoke() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun invoke(): kotlin.Unit + public final operator fun invoke(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.txt b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.txt index 12882dfac09..aa6c6146023 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/functionLiterals/pseudocodeMemoryOverhead.txt @@ -38,9 +38,9 @@ public final class BigInteger { public final val f: CompileTimeType public final val functionName: kotlin.String public final val g: CompileTimeType - public final /*synthesized*/ fun component1(): CompileTimeType - public final /*synthesized*/ fun component2(): CompileTimeType - public final /*synthesized*/ fun component3(): kotlin.String + public final operator /*synthesized*/ fun component1(): CompileTimeType + public final operator /*synthesized*/ fun component2(): CompileTimeType + public final operator /*synthesized*/ fun component3(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ f: CompileTimeType = ..., /*1*/ g: CompileTimeType = ..., /*2*/ functionName: kotlin.String = ...): BinaryOperationKey public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -58,8 +58,8 @@ private final class CompileTimeType { public constructor UnaryOperationKey(/*0*/ f: CompileTimeType, /*1*/ functionName: kotlin.String) public final val f: CompileTimeType public final val functionName: kotlin.String - public final /*synthesized*/ fun component1(): CompileTimeType - public final /*synthesized*/ fun component2(): kotlin.String + public final operator /*synthesized*/ fun component1(): CompileTimeType + public final operator /*synthesized*/ fun component2(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ f: CompileTimeType = ..., /*1*/ functionName: kotlin.String = ...): UnaryOperationKey public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/ea66827_dataClassWrongToString.txt b/compiler/testData/diagnostics/testsWithStdLib/regression/ea66827_dataClassWrongToString.txt index 248ec6155b1..00a61a89dd5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/ea66827_dataClassWrongToString.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/ea66827_dataClassWrongToString.txt @@ -3,7 +3,7 @@ package @kotlin.data() public final class A { public constructor A(/*0*/ x: kotlin.Int) public final val x: kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): A public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classes/DataClass.txt b/compiler/testData/loadJava/compiledKotlin/annotations/classes/DataClass.txt index 15954e14d4b..2c08958dd8a 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classes/DataClass.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classes/DataClass.txt @@ -4,6 +4,6 @@ package test /*primary*/ public constructor My(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public final fun (): kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): test.My } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/MixedComponents.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/MixedComponents.txt index 38dfbd5a03e..5bf1d501386 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/MixedComponents.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/MixedComponents.txt @@ -7,7 +7,7 @@ package test public final fun (/*0*/ : kotlin.String): kotlin.Unit public final val z: kotlin.Double public final fun (): kotlin.Double - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.Double + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.Double public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ..., /*1*/ y: kotlin.Int, /*2*/ z: kotlin.Double = ...): test.DataClass } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/OneVal.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/OneVal.txt index 3f09cd405db..eae153ff388 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/OneVal.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/OneVal.txt @@ -4,6 +4,6 @@ package test /*primary*/ public constructor DataClass(/*0*/ x: kotlin.String) public final val x: kotlin.String public final fun (): kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ...): test.DataClass } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/OpenDataClass.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/OpenDataClass.txt index 49c20fee518..d6080a50b98 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/OpenDataClass.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/OpenDataClass.txt @@ -4,6 +4,6 @@ package test /*primary*/ public constructor DataClass(/*0*/ x: kotlin.String) public final val x: kotlin.String public final fun (): kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ...): test.DataClass } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/OpenPropertyFinalComponent.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/OpenPropertyFinalComponent.txt index 78914b563e9..8a7c772016c 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/OpenPropertyFinalComponent.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/OpenPropertyFinalComponent.txt @@ -4,6 +4,6 @@ package test /*primary*/ public constructor DataClass(/*0*/ x: kotlin.String) public open val x: kotlin.String public open fun (): kotlin.String - public final /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component1(): kotlin.String public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ...): test.DataClass } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/ParamNameSameToField.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/ParamNameSameToField.txt index 197e9c914e4..9bc2a187819 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/ParamNameSameToField.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/ParamNameSameToField.txt @@ -8,6 +8,6 @@ package test public final fun (): kotlin.String public final val other: kotlin.Long public final fun (): kotlin.Long - public final /*synthesized*/ fun component1(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ foo: kotlin.String, /*1*/ bar: kotlin.Int = ..., /*2*/ other: kotlin.Long): test.A } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVals.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVals.txt index 40bb9f98451..0ef5c0617ea 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVals.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVals.txt @@ -6,7 +6,7 @@ package test public final fun (): kotlin.String public final val y: kotlin.Int public final fun (): kotlin.Int - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ..., /*1*/ y: kotlin.Int = ...): test.DataClass } diff --git a/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVars.txt b/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVars.txt index bedce5aaa2d..892deef4705 100644 --- a/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVars.txt +++ b/compiler/testData/loadJava/compiledKotlin/dataClass/TwoVars.txt @@ -8,7 +8,7 @@ package test public final var y: kotlin.Int public final fun (): kotlin.Int public final fun (/*0*/ : kotlin.Int): kotlin.Unit - public final /*synthesized*/ fun component1(): kotlin.String - public final /*synthesized*/ fun component2(): kotlin.Int + public final operator /*synthesized*/ fun component1(): kotlin.String + public final operator /*synthesized*/ fun component2(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.String = ..., /*1*/ y: kotlin.Int = ...): test.DataClass } diff --git a/compiler/testData/psi/examples/BitArith.kt b/compiler/testData/psi/examples/BitArith.kt index 6587c7687a8..7fbe10d02e5 100644 --- a/compiler/testData/psi/examples/BitArith.kt +++ b/compiler/testData/psi/examples/BitArith.kt @@ -23,7 +23,11 @@ fun Int.matchMask(mask : Int) = this and mask == mask open class INumber : IComparable { val bits : Int - @operator fun plus(other : This) : This - @operator fun shl(bits : Int) : This + + @Operator + fun plus(other : This) : This + + @Operator + fun shl(bits : Int) : This // ... } \ No newline at end of file diff --git a/compiler/testData/psi/examples/BitArith.txt b/compiler/testData/psi/examples/BitArith.txt index 1ec047b087f..9e1688256ce 100644 --- a/compiler/testData/psi/examples/BitArith.txt +++ b/compiler/testData/psi/examples/BitArith.txt @@ -554,7 +554,7 @@ JetFile: BitArith.kt USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Int') - PsiWhiteSpace('\n ') + PsiWhiteSpace('\n\n ') FUN MODIFIER_LIST ANNOTATION_ENTRY @@ -563,8 +563,8 @@ JetFile: BitArith.kt TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('operator') - PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Operator') + PsiWhiteSpace('\n ') PsiElement(fun)('fun') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('plus') @@ -585,7 +585,7 @@ JetFile: BitArith.kt TYPE_REFERENCE SELF_TYPE PsiElement(This)('This') - PsiWhiteSpace('\n ') + PsiWhiteSpace('\n\n ') FUN MODIFIER_LIST ANNOTATION_ENTRY @@ -594,8 +594,8 @@ JetFile: BitArith.kt TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION - PsiElement(IDENTIFIER)('operator') - PsiWhiteSpace(' ') + PsiElement(IDENTIFIER)('Operator') + PsiWhiteSpace('\n ') PsiElement(fun)('fun') PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('shl') @@ -620,4 +620,4 @@ JetFile: BitArith.kt PsiWhiteSpace('\n ') PsiComment(EOL_COMMENT)('// ...') PsiWhiteSpace('\n') - PsiElement(RBRACE)('}') + PsiElement(RBRACE)('}') \ No newline at end of file diff --git a/compiler/testData/resolvedCalls/differentCallElements/simpleArrayAccess.txt b/compiler/testData/resolvedCalls/differentCallElements/simpleArrayAccess.txt index 57b0edb6b1d..becbf17bef7 100644 --- a/compiler/testData/resolvedCalls/differentCallElements/simpleArrayAccess.txt +++ b/compiler/testData/resolvedCalls/differentCallElements/simpleArrayAccess.txt @@ -5,7 +5,7 @@ fun foo(array: Array) { Resolved call: -Resulting descriptor: fun get(index: Int): Int defined in kotlin.Array +Resulting descriptor: operator fun get(index: Int): Int defined in kotlin.Array Explicit receiver kind = DISPATCH_RECEIVER Dispatch receiver = array {Array} diff --git a/idea/testData/checker/Builders.kt b/idea/testData/checker/Builders.kt index 9ee7e42b4d1..bc228db3304 100644 --- a/idea/testData/checker/Builders.kt +++ b/idea/testData/checker/Builders.kt @@ -24,7 +24,7 @@ import java.util.* } abstract class TagWithText(name : String) : Tag(name) { - fun String.plus() { + operator fun String.plus() { children.add(TextElement(this)) } } @@ -78,7 +78,7 @@ import java.util.* } } - fun MutableMap.set(key : String, value : String) = this.put(key, value) + operator fun MutableMap.set(key : String, value : String) = this.put(key, value) fun html(init : HTML.() -> Unit) : HTML { val html = HTML() diff --git a/idea/testData/checker/ExtensionFunctions.kt b/idea/testData/checker/ExtensionFunctions.kt index a4005739317..c5113158532 100644 --- a/idea/testData/checker/ExtensionFunctions.kt +++ b/idea/testData/checker/ExtensionFunctions.kt @@ -13,7 +13,7 @@ fun T.foo(x : E, y : A) : T { class A -fun A.plus(a : Any) { +operator fun A.plus(a : Any) { 1.foo() true.foo() @@ -21,7 +21,7 @@ fun A.plus(a : Any) { 1 } -fun A.plus(a : Int) { +operator fun A.plus(a : Int) { 1 } @@ -46,7 +46,7 @@ fun Int.foo() = this val foo : Int = 0 } - fun Any.equals(other : Any?) : Boolean = true + operator fun Any.equals(other : Any?) : Boolean = true fun Any?.equals1(other : Any?) : Boolean = true fun Any.equals2(other : Any?) : Boolean = true diff --git a/idea/testData/checker/ForRangeConventions.kt b/idea/testData/checker/ForRangeConventions.kt index da0c48a03b2..508d61767e0 100644 --- a/idea/testData/checker/ForRangeConventions.kt +++ b/idea/testData/checker/ForRangeConventions.kt @@ -7,64 +7,64 @@ class NotRange1() { } abstract class NotRange2() { - abstract fun iterator() : Unit + abstract operator fun iterator() : Unit } abstract class ImproperIterator1 { - abstract fun hasNext() : Boolean + abstract operator fun hasNext() : Boolean } abstract class NotRange3() { - abstract fun iterator() : ImproperIterator1 + abstract operator fun iterator() : ImproperIterator1 } abstract class ImproperIterator2 { - abstract fun next() : Boolean + abstract operator fun next() : Boolean } abstract class NotRange4() { - abstract fun iterator() : ImproperIterator2 + abstract operator fun iterator() : ImproperIterator2 } abstract class ImproperIterator3 { - abstract fun hasNext() : Int - abstract fun next() : Int + abstract operator fun hasNext() : Int + abstract operator fun next() : Int } abstract class NotRange5() { - abstract fun iterator() : ImproperIterator3 + abstract operator fun iterator() : ImproperIterator3 } abstract class AmbiguousHasNextIterator { - abstract fun hasNext() : Boolean + abstract operator fun hasNext() : Boolean val hasNext : Boolean get() = false - abstract fun next() : Int + abstract operator fun next() : Int } abstract class NotRange6() { - abstract fun iterator() : AmbiguousHasNextIterator + abstract operator fun iterator() : AmbiguousHasNextIterator } abstract class ImproperIterator4 { val hasNext : Int get() = 1 - abstract fun next() : Int + abstract operator fun next() : Int } abstract class NotRange7() { - abstract fun iterator() : ImproperIterator3 + abstract operator fun iterator() : ImproperIterator3 } abstract class GoodIterator { - abstract fun hasNext() : Boolean - abstract fun next() : Int + abstract operator fun hasNext() : Boolean + abstract operator fun next() : Int } abstract class Range0() { - abstract fun iterator() : GoodIterator + abstract operator fun iterator() : GoodIterator } abstract class Range1() { - abstract fun iterator() : Iterator + abstract operator fun iterator() : Iterator } fun test(notRange1: NotRange1, notRange2: NotRange2, notRange3: NotRange3, notRange4: NotRange4, notRange5: NotRange5, notRange6: NotRange6, notRange7: NotRange7, range0: Range0, range1: Range1) { diff --git a/idea/testData/checker/IncDec.kt b/idea/testData/checker/IncDec.kt index 32d8e05f6d3..6e1589b445c 100644 --- a/idea/testData/checker/IncDec.kt +++ b/idea/testData/checker/IncDec.kt @@ -1,6 +1,6 @@ class IncDec() { - fun inc() : IncDec = this - fun dec() : IncDec = this + operator fun inc() : IncDec = this + operator fun dec() : IncDec = this } fun testIncDec() { @@ -16,8 +16,8 @@ fun testIncDec() { } class WrongIncDec() { - fun inc() : Int = 1 - fun dec() : Int = 1 + operator fun inc() : Int = 1 + operator fun dec() : Int = 1 } fun testWrongIncDec() { @@ -29,8 +29,8 @@ fun testWrongIncDec() { } class UnitIncDec() { - fun inc() : Unit {} - fun dec() : Unit {} + operator fun inc() : Unit {} + operator fun dec() : Unit {} } fun testUnitIncDec() { diff --git a/idea/testData/checker/Shadowing.kt b/idea/testData/checker/Shadowing.kt index 478b1f9d8ea..800941d3716 100644 --- a/idea/testData/checker/Shadowing.kt +++ b/idea/testData/checker/Shadowing.kt @@ -1,6 +1,6 @@ class A { - fun component1() = 42 - fun component2() = 42 + operator fun component1() = 42 + operator fun component2() = 42 } fun arrayA(): Array = null!! diff --git a/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt b/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt index 6da9cbf05bd..82a38a2011b 100644 --- a/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt +++ b/idea/testData/decompiler/stubBuilder/DataClass/DataClass.txt @@ -46,7 +46,7 @@ PsiJetFileStubImpl[package=a.b.c] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=String] FUN:[fqName=a.b.c.DataClass.component1, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=component1] - MODIFIER_LIST:[public final] + MODIFIER_LIST:[public final operator] VALUE_PARAMETER_LIST: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] @@ -54,7 +54,7 @@ PsiJetFileStubImpl[package=a.b.c] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Int] FUN:[fqName=a.b.c.DataClass.component2, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=false, name=component2] - MODIFIER_LIST:[public final] + MODIFIER_LIST:[public final operator] VALUE_PARAMETER_LIST: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/highlighter/VariablesAsFunctions.kt b/idea/testData/highlighter/VariablesAsFunctions.kt index 8c153a6d901..e6ba967f55a 100644 --- a/idea/testData/highlighter/VariablesAsFunctions.kt +++ b/idea/testData/highlighter/VariablesAsFunctions.kt @@ -1,5 +1,5 @@ interface FunctionLike { - fun invoke() { + operator fun invoke() { } } diff --git a/idea/testData/highlighter/deprecated/Get.kt b/idea/testData/highlighter/deprecated/Get.kt index 6999c072a3a..0a4c6ab9c3a 100644 --- a/idea/testData/highlighter/deprecated/Get.kt +++ b/idea/testData/highlighter/deprecated/Get.kt @@ -1,6 +1,6 @@ class MyClass {} -@Deprecated("Use A instead") fun MyClass.get(i: MyClass): MyClass { return i } +@Deprecated("Use A instead") operator fun MyClass.get(i: MyClass): MyClass { return i } fun test() { val x1 = MyClass() diff --git a/idea/testData/highlighter/deprecated/Inc.kt b/idea/testData/highlighter/deprecated/Inc.kt index 374260bfc0b..2bfdc67aba8 100644 --- a/idea/testData/highlighter/deprecated/Inc.kt +++ b/idea/testData/highlighter/deprecated/Inc.kt @@ -2,7 +2,7 @@ class MyClass { val i = 0 } -@Deprecated("Use A instead") fun MyClass.inc(): MyClass { return MyClass() } +@Deprecated("Use A instead") operator fun MyClass.inc(): MyClass { return MyClass() } fun test() { var x3 = MyClass() diff --git a/idea/testData/highlighter/deprecated/Invoke.kt b/idea/testData/highlighter/deprecated/Invoke.kt index c72707e942d..3b51ab494db 100644 --- a/idea/testData/highlighter/deprecated/Invoke.kt +++ b/idea/testData/highlighter/deprecated/Invoke.kt @@ -1,6 +1,6 @@ class MyRunnable() {} -@Deprecated("Use A instead") fun MyRunnable.invoke() { +@Deprecated("Use A instead") operator fun MyRunnable.invoke() { } fun test() { diff --git a/idea/testData/highlighter/deprecated/Operation.kt b/idea/testData/highlighter/deprecated/Operation.kt index ef759e99b8f..b1ed6a6a215 100644 --- a/idea/testData/highlighter/deprecated/Operation.kt +++ b/idea/testData/highlighter/deprecated/Operation.kt @@ -2,18 +2,18 @@ class MyClass { val i = 0 } -@Deprecated("Use A instead") fun MyClass.minus(i: MyClass) { i.i } -@Deprecated("Use A instead") fun MyClass.div(i: MyClass) { i.i } -@Deprecated("Use A instead") fun MyClass.times(i: MyClass) { i.i } +@Deprecated("Use A instead") operator fun MyClass.minus(i: MyClass) { i.i } +@Deprecated("Use A instead") operator fun MyClass.div(i: MyClass) { i.i } +@Deprecated("Use A instead") operator fun MyClass.times(i: MyClass) { i.i } -@Deprecated("Use A instead") fun MyClass.not() { } -@Deprecated("Use A instead") fun MyClass.plus() { } +@Deprecated("Use A instead") operator fun MyClass.not() { } +@Deprecated("Use A instead") operator fun MyClass.plus() { } -@Deprecated("Use A instead") fun MyClass.contains(i: MyClass): Boolean { i.i; return false } +@Deprecated("Use A instead") operator fun MyClass.contains(i: MyClass): Boolean { i.i; return false } -@Deprecated("Use A instead") fun MyClass.plusAssign(i: MyClass) { i.i } +@Deprecated("Use A instead") operator fun MyClass.plusAssign(i: MyClass) { i.i } -@Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): IntRange { return IntRange(i.i, i.i) } +@Deprecated("Use A instead") operator fun MyClass.rangeTo(i: MyClass): IntRange { return IntRange(i.i, i.i) } fun test() { val x1 = MyClass() diff --git a/idea/testData/highlighter/deprecated/RangeTo.kt b/idea/testData/highlighter/deprecated/RangeTo.kt index 39df32d1f93..e9a5544e1d0 100644 --- a/idea/testData/highlighter/deprecated/RangeTo.kt +++ b/idea/testData/highlighter/deprecated/RangeTo.kt @@ -2,7 +2,7 @@ class MyClass { val i = 1 } -@Deprecated("Use A instead") fun MyClass.rangeTo(i: MyClass): Iterable { +@Deprecated("Use A instead") operator fun MyClass.rangeTo(i: MyClass): Iterable { i.i throw Exception() } diff --git a/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt b/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt index 00582dd97e4..cef7089e603 100644 --- a/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt +++ b/idea/testData/intentions/convertNegatedExpressionWithDemorgansLaw/inapplicableOperator.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
fun foo(a: Boolean, b: Boolean) : Boolean { return !(!a + b) } diff --git a/idea/testData/quickfix/autoImports/plusOperator.after.kt b/idea/testData/quickfix/autoImports/plusOperator.after.kt index 6c98780c5ea..551b72e86c6 100644 --- a/idea/testData/quickfix/autoImports/plusOperator.after.kt +++ b/idea/testData/quickfix/autoImports/plusOperator.after.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
package h diff --git a/idea/testData/quickfix/autoImports/plusOperator.before.Dependency.kt b/idea/testData/quickfix/autoImports/plusOperator.before.Dependency.kt index df27b906194..d5a5d86fc7e 100644 --- a/idea/testData/quickfix/autoImports/plusOperator.before.Dependency.kt +++ b/idea/testData/quickfix/autoImports/plusOperator.before.Dependency.kt @@ -1,3 +1,3 @@ package util -fun h.H?.plus(s: String) = "" \ No newline at end of file +operator fun h.H?.plus(s: String) = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt index 476a4d30fdb..ed96dd2c9da 100644 --- a/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt +++ b/idea/testData/quickfix/autoImports/plusOperator.before.Main.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
package h diff --git a/idea/testData/quickfix/autoImports/timesAssign.before.Dependency.kt b/idea/testData/quickfix/autoImports/timesAssign.before.Dependency.kt index 31a360111a3..f4ed09816af 100644 --- a/idea/testData/quickfix/autoImports/timesAssign.before.Dependency.kt +++ b/idea/testData/quickfix/autoImports/timesAssign.before.Dependency.kt @@ -1,4 +1,4 @@ package util -fun h.H.div(i: Int) = 3 -fun h.H.timesAssign(i: Int) {} \ No newline at end of file +operator fun h.H.div(i: Int) = 3 +operator fun h.H.timesAssign(i: Int) {} \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Dependency.kt b/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Dependency.kt index 55b6c6746b6..0a543bc5b03 100644 --- a/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Dependency.kt +++ b/idea/testData/quickfix/autoImports/unaryMinusOperator.before.Dependency.kt @@ -1,3 +1,3 @@ package util -fun h.H?.minus() = "" \ No newline at end of file +operator fun h.H?.minus() = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt index 199115ad317..ae4c44c89e1 100644 --- a/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.after.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun h.A.plus(): kotlin.Int defined in h
  • public fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun h.A.plus(): kotlin.Int defined in h
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
package h @@ -13,4 +13,4 @@ fun f(h: H?) { class A() -fun A.plus(): Int = 3 \ No newline at end of file +operator fun A.plus(): Int = 3 \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Dependency.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Dependency.kt index 336a1ff68bd..fb64b4a74d8 100644 --- a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Dependency.kt +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Dependency.kt @@ -1,3 +1,3 @@ package util -fun h.H.plus() = "" \ No newline at end of file +operator fun h.H.plus() = "" \ No newline at end of file diff --git a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt index 2e15fb97bd4..94d474eb74d 100644 --- a/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt +++ b/idea/testData/quickfix/autoImports/unaryPlusOperator.before.Main.kt @@ -1,5 +1,5 @@ // "Import" "true" -// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public fun h.A.plus(): kotlin.Int defined in h
  • public fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
+// ERROR: Unresolved reference.
None of the following candidates is applicable because of receiver type mismatch:
  • public operator fun h.A.plus(): kotlin.Int defined in h
  • public operator fun kotlin.String?.plus(other: kotlin.Any?): kotlin.String defined in kotlin
package h @@ -11,4 +11,4 @@ fun f(h: H?) { class A() -fun A.plus(): Int = 3 \ No newline at end of file +operator fun A.plus(): Int = 3 \ No newline at end of file diff --git a/idea/testData/quickfix/changeSignature/addParameterNotAvailableForBuiltins.kt b/idea/testData/quickfix/changeSignature/addParameterNotAvailableForBuiltins.kt index c86af94bc09..a41b0d55e51 100644 --- a/idea/testData/quickfix/changeSignature/addParameterNotAvailableForBuiltins.kt +++ b/idea/testData/quickfix/changeSignature/addParameterNotAvailableForBuiltins.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddFunctionParametersFix" "false" -// ERROR: Too many arguments for public open fun equals(other: kotlin.Any?): kotlin.Boolean defined in kotlin.Any +// ERROR: Too many arguments for public open operator fun equals(other: kotlin.Any?): kotlin.Boolean defined in kotlin.Any fun f(d: Any) { d.equals("a", "b") diff --git a/idea/testData/quickfix/changeSignature/notAvailableForSynthesized.kt b/idea/testData/quickfix/changeSignature/notAvailableForSynthesized.kt index 72e6bbf36f2..8d04f7215a1 100644 --- a/idea/testData/quickfix/changeSignature/notAvailableForSynthesized.kt +++ b/idea/testData/quickfix/changeSignature/notAvailableForSynthesized.kt @@ -1,5 +1,5 @@ // "class org.jetbrains.kotlin.idea.quickfix.AddFunctionParametersFix" "false" -//ERROR: Too many arguments for public final fun component1(): kotlin.Int defined in Data +//ERROR: Too many arguments for public final operator fun component1(): kotlin.Int defined in Data data class Data(val i: Int) {} diff --git a/idea/testData/unifier/equivalence/expressions/conventions/containsRuntime.kt b/idea/testData/unifier/equivalence/expressions/conventions/containsRuntime.kt index 0aaa6030d9c..974bcc95fec 100644 --- a/idea/testData/unifier/equivalence/expressions/conventions/containsRuntime.kt +++ b/idea/testData/unifier/equivalence/expressions/conventions/containsRuntime.kt @@ -1,6 +1,6 @@ // DISABLE-ERRORS val array = Array(2) { it } -fun Array.contains(t: T): Boolean = false +operator fun Array.contains(t: T): Boolean = false val a = 1 in array val b = array.contains(1)