From bfc7eb7bab9bd352acd4025118ed64f32d30e814 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Wed, 24 Mar 2021 23:26:15 -0700 Subject: [PATCH] FIR checker: fix REFERENCE_BY_QUALIFIED positioning strategy to consider callable reference --- .../resolve/expresssions/errCallable.kt | 4 +- .../references/referenceToExtension.kt | 8 ++-- .../callableReferences/beyoundCalls.kt | 2 +- .../callableReferences/companions.kt | 4 +- ...nNoApplicableCallableReferenceCandidate.kt | 2 +- ...bleReferenceDependingOnInferredReceiver.kt | 2 +- .../eagerAndPostponedCallableReferences.kt | 2 +- .../moreSpecificAmbiguousExtensions.kt | 6 +-- ...llableReferencesAfterAllSimpleArguments.kt | 4 +- .../callableReferences/implicitTypes.kt | 2 +- .../manyInnermanyOuterCandidatesAmbiguity.kt | 2 +- .../LightTreePositioningStrategies.kt | 13 +++--- .../diagnostics/PositioningStrategies.kt | 1 + .../annotationRenderingInTypes.fir.kt | 2 +- .../bound/expressionWithNullableType.fir.kt | 10 ++--- .../bound/functionCallWithoutArguments.fir.kt | 2 +- .../bound/innerNested.fir.kt | 9 ---- .../callableReference/bound/innerNested.kt | 1 + .../callableReference/bound/kt12843.fir.kt | 4 +- .../referenceToStaticMethodOnInstance.fir.kt | 14 ------ .../referenceToStaticMethodOnInstance.kt | 1 + .../bound/reservedExpressionSyntax.fir.kt | 6 +-- .../bound/reservedExpressionSyntax2.fir.kt | 2 +- ...nstraintFromLHSWithCorrectDirection.fir.kt | 2 +- ...intFromLHSWithCorrectDirectionError.fir.kt | 2 +- ...expectedTypeAsSubtypeOfFunctionType.fir.kt | 2 +- .../function/abstractClassConstructors.fir.kt | 6 +-- .../ambiguityTopLevelVsTopLevel.fir.kt | 4 +- .../annotationClassConstructor.fir.kt | 5 --- .../function/annotationClassConstructor.kt | 1 + ...lassMemberVsConstructorLikeFunction.fir.kt | 16 ------- .../classMemberVsConstructorLikeFunction.kt | 1 + .../constructorOfNestedClassInObject.fir.kt | 4 +- .../function/differentPackageExtension.fir.kt | 31 ------------- .../function/differentPackageExtension.kt | 1 + .../extensionInClassDisallowed.fir.kt | 20 --------- .../function/extensionInClassDisallowed.kt | 1 + .../function/innerConstructorFromClass.fir.kt | 4 +- .../innerConstructorFromExtension.fir.kt | 23 ---------- .../function/innerConstructorFromExtension.kt | 1 + .../innerConstructorFromTopLevel.fir.kt | 14 ------ .../function/innerConstructorFromTopLevel.kt | 1 + .../nestedConstructorFromClass.fir.kt | 33 -------------- .../function/nestedConstructorFromClass.kt | 1 + .../nestedConstructorFromExtension.fir.kt | 21 --------- .../nestedConstructorFromExtension.kt | 1 + .../noAmbiguityMemberVsTopLevel.fir.kt | 4 +- .../function/unresolved.fir.kt | 16 +++---- .../generic/dependOnArgumentType.fir.kt | 4 +- .../generic/explicitTypeArguments.fir.kt | 2 +- .../generic/genericExtensionFunction.fir.kt | 4 +- .../callableReference/generic/kt11075.fir.kt | 2 +- .../generic/nestedCallWithOverload.fir.kt | 2 +- ...ionGenericCallableWithNullableTypes.fir.kt | 6 +-- .../resolutionWithGenericCallable.fir.kt | 8 ++-- ...nericCallWithReferenceAgainstVararg.fir.kt | 2 +- .../kt7430_wrongClassOnLHS.fir.kt | 12 ----- .../kt7430_wrongClassOnLHS.kt | 1 + ...sionsImportedFromObjectsUnsupported.fir.kt | 14 +++--- .../property/javaInstanceField.fir.kt | 4 +- .../property/javaStaticFieldViaImport.fir.kt | 4 +- .../property/kt7945_unrelatedClass.fir.kt | 2 +- ...jectMemberViaClassNameCompatibility.fir.kt | 2 +- ...pplicableCallableReferenceCandidate.fir.kt | 4 +- ...ambiguityWithBoundExtensionReceiver.fir.kt | 2 +- .../resolve/ambiguousWithVararg.fir.kt | 6 +-- .../resolve/byGenericArgType.fir.kt | 2 +- .../resolve/byValType.fir.kt | 4 +- ...eferenceDependingOnInferredReceiver.fir.kt | 4 +- ...eagerAndPostponedCallableReferences.fir.kt | 4 +- .../resolve/kt35887_simple.fir.kt | 2 +- .../moreSpecificAmbiguousExtensions.fir.kt | 8 ++-- .../resolve/overloads.fir.kt | 4 +- ...leReferencesAfterAllSimpleArguments.fir.kt | 4 +- .../callableReference/resolve/withAs.fir.kt | 4 +- .../resolve/withExtFun.fir.kt | 4 +- .../resolve/withGenericFun.fir.kt | 2 +- .../resolve/withPlaceholderTypes.fir.kt | 4 +- .../withQuestionMarks.fir.kt | 32 +++++++------- ...ideDelegateOnFunctionalTypeWithThis.fir.kt | 4 +- .../illegalSelectorCallableReference.fir.kt | 4 +- ...proximateContravariantCapturedTypes.fir.kt | 4 +- .../tests/inference/kt39220.fir.kt | 44 +++++++++---------- .../inference/regressions/kt32862_both.fir.kt | 2 +- .../inference/regressions/kt32862_none.fir.kt | 2 +- .../inference/regressions/kt34282.fir.kt | 2 +- ...boutUnresolvedReferenceAsUnresolved.fir.kt | 4 +- .../reportingImprovements/kt42620.fir.kt | 4 +- .../specialCallsWithCallableReferences.fir.kt | 24 +++++----- .../properties/fieldPropertyOverloads.fir.kt | 4 +- .../fieldPropertyOverloadsDisabled.fir.kt | 4 +- .../fieldPropertyOverloadsNI.fir.kt | 4 +- ...nceToSamFunctionAgainstExpectedType.fir.kt | 2 +- .../kt21515/callableReferencesNew.fir.kt | 28 ++++++------ .../kt21515/callableReferencesOld.fir.kt | 28 ++++++------ .../callableReferencesOldComplexCases.fir.kt | 8 ++-- .../calleeExpressionAsCallExpression.fir.kt | 2 +- .../nullCalleeExpression.fir.kt | 2 +- .../tests/regressions/kt13685.fir.kt | 2 +- .../tests/regressions/kt31975.fir.kt | 2 +- ...JavaClassReferenceInKClassExtension.fir.kt | 2 +- ...spendConversionForCallableReference.fir.kt | 2 +- .../typealias/typeAliasesInQualifiers.fir.kt | 6 +-- .../tests/varargs/varargViewedAsArray.fir.kt | 10 ++--- .../callableReferenceOnUnresolvedLHS.fir.kt | 4 +- ...pendConversionForCallableReferences.fir.kt | 4 +- ...callableReferenceToASuspendFunction.fir.kt | 4 +- .../callableReferenceOnParameter.fir.kt | 2 +- .../callableReferences.fir.kt | 2 +- .../testsWithStdLib/inference/kt42620.fir.kt | 4 +- .../p-3/neg/1.1.fir.kt | 10 ++--- .../p-1/neg/1.2.fir.kt | 4 +- .../p-1/neg/1.3.fir.kt | 4 +- .../p-1/neg/1.4.fir.kt | 4 +- .../p-1/neg/1.5.fir.kt | 6 +-- .../p-1/pos/1.2.fir.kt | 2 +- 116 files changed, 272 insertions(+), 455 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/innerNested.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt index b637a3cbbaf..43a3910522d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt @@ -4,10 +4,10 @@ class Your { class My { fun foo() { - val x = ::Nested // Should be error + val x = ::Nested // Should be error } } fun Your.foo() { - val x = ::Nested // Still should be error + val x = ::Nested // Still should be error } diff --git a/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt b/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt index d91187bb763..f4ad623b289 100644 --- a/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt +++ b/compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt @@ -17,8 +17,8 @@ class GenericTest { } fun test_2() { - val extensionValRef = B<*>::extensionVal - val extensionFunRef = B<*>::extensionFun + val extensionValRef = B<*>::extensionVal + val extensionFunRef = B<*>::extensionFun } } @@ -36,8 +36,8 @@ class NoGenericTest { fun B.extensionFun(): A = A() fun test_1() { - val extensionValRef = B::extensionVal - val extensionFunRef = B::extensionFun + val extensionValRef = B::extensionVal + val extensionFunRef = B::extensionFun } fun test_2() { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt index 7a07fc0a08a..a024636d858 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt @@ -6,7 +6,7 @@ fun foobaz(x: T): R = TODO() fun foo() { val x: (String) -> Int = ::bar - val y = ::bar + val y = ::bar val z = ::baz val w: (String) -> Int = ::foobaz diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt index 17ef4ed5510..a7546dddafb 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt @@ -34,13 +34,13 @@ fun main() { foo3(KotlinClass::baz) // Type mismatch - foo1(KotlinClass::bar) + foo1(KotlinClass::bar) foo2(KotlinClass::bar) foo3(KotlinClass::bar) foo1(KotlinClass2::bar) // Type mismatch - foo2(KotlinClass2::bar) + foo2(KotlinClass2::bar) foo3(KotlinClass2::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/ambiguityWhenNoApplicableCallableReferenceCandidate.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/ambiguityWhenNoApplicableCallableReferenceCandidate.kt index a099366542b..1658c58ff58 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/ambiguityWhenNoApplicableCallableReferenceCandidate.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/ambiguityWhenNoApplicableCallableReferenceCandidate.kt @@ -4,5 +4,5 @@ fun foo(y: String) {} fun bar(f: (T) -> Unit) {} fun test() { - bar(::foo) + bar(::foo) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/chooseCallableReferenceDependingOnInferredReceiver.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/chooseCallableReferenceDependingOnInferredReceiver.kt index 199dc5cd859..422a8629932 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/chooseCallableReferenceDependingOnInferredReceiver.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/chooseCallableReferenceDependingOnInferredReceiver.kt @@ -25,7 +25,7 @@ fun test() { val t3 = bar(::baz) - bar(::foo) + bar(::foo) } } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/eagerAndPostponedCallableReferences.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/eagerAndPostponedCallableReferences.kt index 64e511f2492..b12818aff18 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/eagerAndPostponedCallableReferences.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/eagerAndPostponedCallableReferences.kt @@ -22,5 +22,5 @@ fun test() { val a6 = foo(::singleA, ::singleB) - foo(::multiple, ::multiple) + foo(::multiple, ::multiple) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/moreSpecificAmbiguousExtensions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/moreSpecificAmbiguousExtensions.kt index 025d3b59b5b..2abbd279642 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/moreSpecificAmbiguousExtensions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/moreSpecificAmbiguousExtensions.kt @@ -6,14 +6,14 @@ fun IB.extFun(x: IA) {} fun test() { val extFun1 = IA::extFun - val extFun2 = IB::extFun + val extFun2 = IB::extFun } fun testWithExpectedType() { // NB: should be resolved to kotlin/FunctionX, not kotlin/reflect/FunctionX val extFun_AB_A: IA.(IB) -> Unit = IA::extFun - val extFun_AA_B: IA.(IA) -> Unit = IB::extFun + val extFun_AA_B: IA.(IA) -> Unit = IB::extFun val extFun_BB_A: IB.(IB) -> Unit = IA::extFun val extFun_BA_B: IB.(IA) -> Unit = IB::extFun - val extFun_BB_B: IB.(IB) -> Unit = IB::extFun + val extFun_BB_B: IB.(IB) -> Unit = IB::extFun } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt index b2332695285..1cc17a775ec 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt @@ -7,6 +7,6 @@ fun bar(f: (T) -> Unit, e: T) {} fun baz(e: T, f: (T) -> Unit) {} fun test(a: A, b: B) { - baz(a, ::fooB) - bar(::fooB, a) + baz(a, ::fooB) + bar(::fooB, a) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt index 189e45d3611..590d4b2f871 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt @@ -3,5 +3,5 @@ fun use(x: (T) -> R): (T) -> R = x fun foo() = use(::bar) fun bar(x: String) = 1 -fun loop1() = use(::loop2) +fun loop1() = use(::loop2) fun loop2() = loop1() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt index 10944f406ca..f1e01b0d817 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt @@ -6,5 +6,5 @@ fun bar(): Int = 1 fun bar(x: String): Int = 1 fun main() { - foo(::bar) + foo(::bar) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index a0286a9e52b..9c2bb1bcd9e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -378,7 +378,10 @@ object LightTreePositioningStrategies { if (node.tokenType == KtNodeTypes.CALL_EXPRESSION || node.tokenType == KtNodeTypes.CONSTRUCTOR_DELEGATION_CALL) { return markElement(tree.referenceExpression(node) ?: node, startOffset, endOffset, tree, node) } - if (node.tokenType != KtNodeTypes.DOT_QUALIFIED_EXPRESSION && node.tokenType != KtNodeTypes.SAFE_ACCESS_EXPRESSION) { + if (node.tokenType != KtNodeTypes.DOT_QUALIFIED_EXPRESSION && + node.tokenType != KtNodeTypes.SAFE_ACCESS_EXPRESSION && + node.tokenType != KtNodeTypes.CALLABLE_REFERENCE_EXPRESSION + ) { return super.mark(node, startOffset, endOffset, tree) } val selector = tree.selector(node) @@ -533,14 +536,14 @@ fun FlyweightCapableTreeStructure.selector(node: LighterASTNode) val childrenRef = Ref>() getChildren(node, childrenRef) val children = childrenRef.get() ?: return null - var dotFound = false + var dotOrDoubleColonFound = false for (child in children) { if (child == null) continue - if (child.tokenType == KtTokens.DOT) { - dotFound = true + if (child.tokenType == KtTokens.DOT || child.tokenType == KtTokens.COLONCOLON) { + dotOrDoubleColonFound = true continue } - if (dotFound && (child.tokenType == KtNodeTypes.CALL_EXPRESSION || child.tokenType == KtNodeTypes.REFERENCE_EXPRESSION)) { + if (dotOrDoubleColonFound && (child.tokenType == KtNodeTypes.CALL_EXPRESSION || child.tokenType == KtNodeTypes.REFERENCE_EXPRESSION)) { return child } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index 8a3112afedd..6fecd098e27 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -753,6 +753,7 @@ object PositioningStrategies { is KtReferenceExpression -> return mark(selectorExpression) } } + is KtCallableReferenceExpression -> return mark(element.callableReference) is KtCallExpression -> return mark(element.calleeExpression ?: element) is KtConstructorDelegationCall -> return mark(element.calleeExpression ?: element) is KtSuperTypeCallEntry -> return mark(element.calleeExpression) diff --git a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt index 713b48eea87..4a84aaf69cc 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt @@ -4,7 +4,7 @@ fun f1(x: String) {} fun f2(f: () -> Unit) {} -fun test1() = f2(::f1) +fun test1() = f2(::f1) @Target(AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.fir.kt index 90bcf400396..7f33b4cbd4c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/expressionWithNullableType.fir.kt @@ -6,10 +6,10 @@ public interface J { // FILE: test.kt -fun f1(x: Int?): Any = x::hashCode -fun f2(t: T): Any = t::hashCode -fun f3(s: S): Any = s::hashCode -fun f4(u: U?): Any = u::hashCode -fun f5(c: List<*>): Any = c[0]::hashCode +fun f1(x: Int?): Any = x::hashCode +fun f2(t: T): Any = t::hashCode +fun f3(s: S): Any = s::hashCode +fun f4(u: U?): Any = u::hashCode +fun f5(c: List<*>): Any = c[0]::hashCode fun f6(j: J): Any = j.platformString()::hashCode diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt index 2bd5ea09f15..484d232daf5 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt @@ -1 +1 @@ -fun test() = ("").hashCode::hashCode +fun test() = ("").hashCode::hashCode diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.fir.kt deleted file mode 100644 index 38d896fa31a..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -class Outer { - class Nested - inner class Inner -} - -fun test() { - Outer()::Inner - Outer()::Nested -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.kt b/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.kt index da7d41b32b6..334e7b88579 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/innerNested.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Outer { class Nested inner class Inner diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt index 6c25be049d7..d8c6f0dafcf 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/kt12843.fir.kt @@ -1,6 +1,6 @@ class Foo { fun bar() {} - fun f() = Unresolved()::bar + fun f() = Unresolved()::bar } -val f: () -> Unit = Unresolved()::foo +val f: () -> Unit = Unresolved()::foo diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.fir.kt deleted file mode 100644 index 85ad58b93c1..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// FILE: A.java - -public class A { - public static void test() {} -} - -// FILE: test.kt - -enum class E { EN } - -fun test() { - A()::test - E.EN::valueOf -} diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.kt b/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.kt index 1cedd8e2e99..0b47afcc966 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/referenceToStaticMethodOnInstance.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt index c20100f6b22..6fd31355395 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax.fir.kt @@ -18,9 +18,9 @@ class Test { val List.b: Int? get() = size fun List.testCallable1(): () -> Unit = a::foo - fun List.testCallable2(): () -> Unit = b?::foo - fun List.testCallable3(): () -> Unit = b::foo - fun List.testCallable4(): () -> Unit = b?::foo + fun List.testCallable2(): () -> Unit = b?::foo + fun List.testCallable3(): () -> Unit = b::foo + fun List.testCallable4(): () -> Unit = b?::foo fun List.testClassLiteral1() = a::class fun List.testClassLiteral2() = b?::class diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax2.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax2.fir.kt index 7a3f93a01f9..1a8ec946b8a 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax2.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/reservedExpressionSyntax2.fir.kt @@ -4,4 +4,4 @@ package test fun nullableFun(): Int? = null fun Int.foo() {} -val test1 = nullableFun()?::foo \ No newline at end of file +val test1 = nullableFun()?::foo diff --git a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt index baf517a2cdb..4c3d9378ae1 100644 --- a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt @@ -19,6 +19,6 @@ fun B.star(p: KProperty1<*, V>): B = TODO() fun B.test(){ foo(A::bla) bar(A::bla) - baz(A::bla) + baz(A::bla) star(A::bla) } diff --git a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt index 1559616828c..1493ca6a61f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt @@ -15,5 +15,5 @@ fun B.foo(p: KProperty1) {} class C : A fun B.test(){ - foo(C::bla) + foo(C::bla) } diff --git a/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt index 32bc59ebb43..b271e0ba01a 100644 --- a/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt @@ -8,6 +8,6 @@ fun takeIt(x: T, f: SubFunction) {} fun cr() {} fun test() { - takeIt(42, ::cr) + takeIt(42, ::cr) takeIt(42, { }) } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/abstractClassConstructors.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/abstractClassConstructors.fir.kt index c86e4aabb4a..312d98eb1ec 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/abstractClassConstructors.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/abstractClassConstructors.fir.kt @@ -5,8 +5,8 @@ annotation class C enum class D fun main() { - ::A + ::A ::B - ::C // KT-3465 - ::D + ::C // KT-3465 + ::D } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.fir.kt index 6ecf2acaf76..e7b263890b0 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/ambiguityTopLevelVsTopLevel.fir.kt @@ -3,7 +3,7 @@ fun foo(x: Int, y: Any) = x fun foo(x: Any, y: Int) = y fun main() { - ::foo + ::foo - val fooRef: (Int, Any) -> Unit = ::foo + val fooRef: (Int, Any) -> Unit = ::foo } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.fir.kt deleted file mode 100644 index e8a359fe020..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -annotation class Ann(val prop: String) - -val annCtorRef = ::Ann -val annClassRef = Ann::class -val annPropRef = Ann::prop diff --git a/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.kt b/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.kt index 249ee1a7094..fd506046ab6 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/annotationClassConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class Ann(val prop: String) val annCtorRef = ::Ann diff --git a/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.fir.kt deleted file mode 100644 index 32a416ccb01..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FILE: Foo.kt - -package test - -class Foo { - fun bar() {} -} - -// FILE: test.kt - -import test.Foo - -fun Foo(): String = "" - -val f = Foo::bar -val g = Foo::length diff --git a/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.kt b/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.kt index a0062c04fa4..dd36983c8da 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/classMemberVsConstructorLikeFunction.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Foo.kt package test diff --git a/compiler/testData/diagnostics/tests/callableReference/function/constructorOfNestedClassInObject.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/constructorOfNestedClassInObject.fir.kt index 80272aa2263..265ae213587 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/constructorOfNestedClassInObject.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/constructorOfNestedClassInObject.fir.kt @@ -16,6 +16,6 @@ fun test() { Outer.Companion::Wrapper (Outer.Companion)::Wrapper - Outer::Wrapper - (Outer)::Wrapper + Outer::Wrapper + (Outer)::Wrapper } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.fir.kt deleted file mode 100644 index 67f25303cc8..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.fir.kt +++ /dev/null @@ -1,31 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -// FILE: a.kt - -package first - -import checkSubtype - -class A - -fun A.foo() {} -fun A.bar() {} -fun A.baz() {} - -// FILE: b.kt - -package other - -import kotlin.reflect.KFunction1 - -import first.A -import first.foo -import checkSubtype - -fun main() { - val x = first.A::foo - first.A::bar - A::baz - - checkSubtype>(x) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.kt b/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.kt index 13d0f4e6cc4..14be36803b7 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/differentPackageExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION // FILE: a.kt diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.fir.kt deleted file mode 100644 index 179edb9c2f0..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.fir.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION -class A { - fun Int.extInt() = 42 - fun A.extA(x: String) = x - - fun main() { - Int::extInt - A::extA - - eat(Int::extInt) - eat(A::extA) - } -} - -fun eat(value: Any) {} - -fun main() { - A::extInt - A::extA -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt index 680fec1fb6b..a39b02a3868 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/extensionInClassDisallowed.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION class A { fun Int.extInt() = 42 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromClass.fir.kt index 1834f7ca424..17977615bd5 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromClass.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromClass.fir.kt @@ -26,9 +26,9 @@ class A { class B { fun main() { - ::Inner + ::Inner val y = A::Inner checkSubtype>(y) } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.fir.kt deleted file mode 100644 index 790224bd8eb..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.fir.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -// !LANGUAGE: +CallableReferencesToClassMembersWithEmptyLHS - -import kotlin.reflect.KFunction1 - -class A { - inner class Inner -} - -fun A.main() { - ::Inner - val y = A::Inner - - checkSubtype>(y) -} - -fun Int.main() { - ::Inner - val y = A::Inner - - checkSubtype>(y) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.kt b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.kt index 90c304bd862..5516d86377e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION // !LANGUAGE: +CallableReferencesToClassMembersWithEmptyLHS diff --git a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.fir.kt deleted file mode 100644 index 486f0e3b38c..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -import kotlin.reflect.KFunction1 - -class A { - inner class Inner -} - -fun main() { - ::Inner - val y = A::Inner - - checkSubtype>(y) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.kt b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.kt index b606d6dbd27..a8e42b0ae3b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/innerConstructorFromTopLevel.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION import kotlin.reflect.KFunction1 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.fir.kt deleted file mode 100644 index 33e0fe03898..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.fir.kt +++ /dev/null @@ -1,33 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -import kotlin.reflect.KFunction0 - -class A { - class Nested - - fun main() { - val x = ::Nested - val y = A::Nested - - checkSubtype>(x) - checkSubtype>(y) - } - - companion object { - fun main() { - ::Nested - val y = A::Nested - - checkSubtype>(y) - } - } -} - -class B { - fun main() { - ::Nested - val y = A::Nested - - checkSubtype>(y) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.kt index 8fa9274b0ee..c4311325753 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.fir.kt deleted file mode 100644 index 68f56eb0ae7..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_EXPRESSION -import kotlin.reflect.KFunction0 - -class A { - class Nested -} - -fun A.main() { - ::Nested - val y = A::Nested - - checkSubtype>(y) -} - -fun Int.main() { - ::Nested - val y = A::Nested - - checkSubtype>(y) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt index 41a533aaeae..687ac2b1878 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/nestedConstructorFromExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_EXPRESSION import kotlin.reflect.KFunction0 diff --git a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt index 9c4a1d310b3..f7eb0039da3 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt @@ -25,7 +25,7 @@ class A { expectFunction0Unit(::foo) expectFunction0String(::foo) - expectFunction1Unit(::foo) - expectFunction1String(::foo) + expectFunction1Unit(::foo) + expectFunction1String(::foo) } } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt index 90d03179700..87a57d66c59 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/unresolved.fir.kt @@ -4,21 +4,21 @@ class A fun test1() { - val foo = ::foo + val foo = ::foo - ::bar + ::bar - A::bar + A::bar - B::bar + B::bar } fun test2() { fun foo(x: Any) {} fun foo() {} - Unresolved::foo - foo(Unresolved::foo) - foo(Unresolved::unresolved) - ::unresolved + Unresolved::foo + foo(Unresolved::foo) + foo(Unresolved::unresolved) + ::unresolved } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt index 7d16ea0ea71..941d327880d 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt @@ -16,14 +16,14 @@ fun bar(s: T) {} fun complex(t: T, f: (T) -> Unit) {} fun test1() { - foo(1, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE + foo(1, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE foo(1, ::bar) complex(1, ::bar) } fun test2(x: R) { - foo(x, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE + foo(x, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE foo(x, ::bar) complex(x, ::bar) diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt index 32246c43e29..d9af7bc2c50 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt @@ -14,7 +14,7 @@ fun Wrapper.baz(transform: (T) -> Unit): T = TODO() fun test() { takeFun(::foo) - takeFun(::fooInt) + takeFun(::fooInt) callFun>(::createWrapper) callFun>(::createWrapper) diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt index 1fcb1e71a55..2723d83fbbb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt @@ -23,8 +23,8 @@ fun test1() { fun test2() { bar(Wrapper::fooReturnString).checkType { _>() } bar(Wrapper::fooReturnString).checkType { _>() } - bar(Wrapper::fooReturnString) - bar(Wrapper::fooReturnString) + bar(Wrapper::fooReturnString) + bar(Wrapper::fooReturnString) bar(Wrapper::fooTakeInt).checkType { _>() } bar(Wrapper::fooTakeInt).checkType { _>() } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/kt11075.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/kt11075.fir.kt index eca63b0f1d1..ea2a7c6a71b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/kt11075.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/kt11075.fir.kt @@ -6,5 +6,5 @@ object TestCallableReferences { fun test0(): (String) -> String = TestCallableReferences::foo - fun test1(): (List) -> List = TestCallableReferences::foo + fun test1(): (List) -> List = TestCallableReferences::foo } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.fir.kt index e2ee9d919a5..15a6e2081a9 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/nestedCallWithOverload.fir.kt @@ -11,7 +11,7 @@ fun test() { val x2: (Int) -> Unit = baz(id(::foo), ::foo) val x3: (Int) -> Unit = baz(id(::foo), id(id(::foo))) val x4: (String) -> Unit = baz(id(::foo), id(id(::foo))) - val x5: (Double) -> Unit = baz(id(::foo), id(id(::foo))) + val x5: (Double) -> Unit = baz(id(::foo), id(id(::foo))) id<(Int) -> Unit>(id(id(::foo))) diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt index fa9a235ea18..da379751848 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionGenericCallableWithNullableTypes.fir.kt @@ -17,7 +17,7 @@ fun test1() { baz(::foo).checkType { _() } baz(::foo).checkType { _() } - val b1: Int = baz(::foo) - val b2: String = baz(::foo) - val b3: Boolean = baz(::foo) + val b1: Int = baz(::foo) + val b2: String = baz(::foo) + val b3: Boolean = baz(::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.fir.kt index f5d5de415b5..4b0510c4ce5 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/resolutionWithGenericCallable.fir.kt @@ -5,9 +5,9 @@ fun test() { val a1: Array Double> = arrayOf(Double::plus, Double::minus) val a2: Array Double> = arrayOf(Double::plus, Double::minus) - val a3: Array Double> = arrayOf(Double::plus, Double::minus) - val a4: Array Double> = arrayOf(Int::plus, Double::minus) - val a5: Array Double> = arrayOf(Double::plus, Int::minus) + val a3: Array Double> = arrayOf(Double::plus, Double::minus) + val a4: Array Double> = arrayOf(Int::plus, Double::minus) + val a5: Array Double> = arrayOf(Double::plus, Int::minus) } fun foo(x: Int) {} @@ -18,5 +18,5 @@ fun bar(x: T, f: (T) -> Unit) {} fun test2() { bar(1, ::foo) bar("", ::foo) - bar(1.0, ::foo) + bar(1.0, ::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt index 0129151a7b0..e31a75d69cf 100644 --- a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt @@ -5,7 +5,7 @@ fun foo(vararg ints: Int) {} fun test(i: IntArray) { myLet(i, ::foo) myLet(::foo) - myLet(::foo) + myLet(::foo) myLet(::foo) myLetExplicit1(::foo) myLetExplicit2(::foo) diff --git a/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.fir.kt b/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.fir.kt deleted file mode 100644 index 48901ace5f8..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION - -class Unrelated() - -class Test(val name: String = "") { - init { - Unrelated::name - Unrelated::foo - } - - fun foo() {} -} diff --git a/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.kt b/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.kt index 0abc63d8894..d0c9efc77e5 100644 --- a/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.kt +++ b/compiler/testData/diagnostics/tests/callableReference/kt7430_wrongClassOnLHS.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION class Unrelated() diff --git a/compiler/testData/diagnostics/tests/callableReference/memberExtensionsImportedFromObjectsUnsupported.fir.kt b/compiler/testData/diagnostics/tests/callableReference/memberExtensionsImportedFromObjectsUnsupported.fir.kt index 77eb76a3ed4..acb5d9506f8 100644 --- a/compiler/testData/diagnostics/tests/callableReference/memberExtensionsImportedFromObjectsUnsupported.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/memberExtensionsImportedFromObjectsUnsupported.fir.kt @@ -14,13 +14,13 @@ class A { } fun test() { - String::ext - Obj::ext + String::ext + Obj::ext - String::ext2 - A.Companion::ext2 - A::ext2 + String::ext2 + A.Companion::ext2 + A::ext2 - A::foo - A::bar + A::foo + A::bar } diff --git a/compiler/testData/diagnostics/tests/callableReference/property/javaInstanceField.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/javaInstanceField.fir.kt index e749304016b..e2c3f36339b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/javaInstanceField.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/javaInstanceField.fir.kt @@ -21,6 +21,6 @@ fun test() { val pubMutRef: KMutableProperty1 = JavaClass::publicMutable val protFinRef: KProperty1 = JavaClass::protectedFinal val protMutRef: KMutableProperty1 = JavaClass::protectedMutable - val privFinRef: KProperty1 = JavaClass::privateFinal - val privMutRef: KMutableProperty1 = JavaClass::privateMutable + val privFinRef: KProperty1 = JavaClass::privateFinal + val privMutRef: KMutableProperty1 = JavaClass::privateMutable } diff --git a/compiler/testData/diagnostics/tests/callableReference/property/javaStaticFieldViaImport.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/javaStaticFieldViaImport.fir.kt index ecc1e7ee486..e5362097048 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/javaStaticFieldViaImport.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/javaStaticFieldViaImport.fir.kt @@ -23,6 +23,6 @@ fun test() { val pubMutRef: KMutableProperty0 = ::publicMutable val protFinRef: KProperty = ::protectedFinal val protMutRef: KMutableProperty = ::protectedMutable - val privFinRef: KProperty = ::privateFinal - val privMutRef: KMutableProperty = ::privateMutable + val privFinRef: KProperty = ::privateFinal + val privMutRef: KMutableProperty = ::privateMutable } diff --git a/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.fir.kt b/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.fir.kt index cfa47d0096c..baf3c7af422 100644 --- a/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/property/kt7945_unrelatedClass.fir.kt @@ -7,5 +7,5 @@ class TestClass(var prop: Int) open class OtherClass fun OtherClass.test(prop: KProperty1): Unit = throw Exception() class OtherClass2: OtherClass() { - val result = test(TestClass::result) + val result = test(TestClass::result) } diff --git a/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassNameCompatibility.fir.kt b/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassNameCompatibility.fir.kt index 8ad8bae69a0..1a2786cf95f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassNameCompatibility.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassNameCompatibility.fir.kt @@ -22,7 +22,7 @@ fun B.foo(): Double = 0.0 fun call(a: Any) {} fun testA(a: A) { - call(A::foo) + call(A::foo) call(A.Companion::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWhenNoApplicableCallableReferenceCandidate.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWhenNoApplicableCallableReferenceCandidate.fir.kt index 42cc26544a0..8666eea3136 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWhenNoApplicableCallableReferenceCandidate.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWhenNoApplicableCallableReferenceCandidate.fir.kt @@ -7,5 +7,5 @@ fun foo(y: String) {} fun bar(f: (T) -> Unit) {} fun test() { - bar(::foo) -} \ No newline at end of file + bar(::foo) +} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWithBoundExtensionReceiver.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWithBoundExtensionReceiver.fir.kt index 3529dca196d..2acdf445a48 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWithBoundExtensionReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguityWithBoundExtensionReceiver.fir.kt @@ -10,6 +10,6 @@ fun A.foo() = "" class A { fun main() { - bar(::foo) checkType { _() } + bar(::foo) checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguousWithVararg.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguousWithVararg.fir.kt index ba5ac78cc8c..eb20864dd5e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguousWithVararg.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/ambiguousWithVararg.fir.kt @@ -3,14 +3,14 @@ fun fun1() {} fun fun1(x: Int) {} -val ref1 = ::fun1 +val ref1 = ::fun1 fun fun2(vararg x: Int) {} fun fun2(x: Int) {} -val ref2 = ::fun2 +val ref2 = ::fun2 fun fun3(x0: Int, vararg xs: Int) {} fun fun3(x0: String, vararg xs: String) {} -val ref3 = ::fun3 +val ref3 = ::fun3 diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.fir.kt index 8d341599ee2..d64b9cc5222 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/byGenericArgType.fir.kt @@ -8,4 +8,4 @@ fun foo(s: String) {} val x1 = ofType<() -> Unit>(::foo) val x2 = ofType<(String) -> Unit>(::foo) -val x3 = ofType<(Int) -> Unit>(::foo) +val x3 = ofType<(Int) -> Unit>(::foo) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/byValType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/byValType.fir.kt index 1ce622c783a..5c7a34df0f0 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/byValType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/byValType.fir.kt @@ -3,7 +3,7 @@ fun foo() {} fun foo(s: String) {} -val x1 = ::foo +val x1 = ::foo val x2: () -> Unit = ::foo val x3: (String) -> Unit = ::foo -val x4: (Int) -> Unit = ::foo \ No newline at end of file +val x4: (Int) -> Unit = ::foo diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseCallableReferenceDependingOnInferredReceiver.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseCallableReferenceDependingOnInferredReceiver.fir.kt index 04df73cbe96..7eea1faa468 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/chooseCallableReferenceDependingOnInferredReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/chooseCallableReferenceDependingOnInferredReceiver.fir.kt @@ -31,9 +31,9 @@ fun test() { val t3 = bar(::baz) t3 - bar(::foo) + bar(::foo) } } } -inline fun myWith(receiver: T, block: T.() -> R): R = TODO() \ No newline at end of file +inline fun myWith(receiver: T, block: T.() -> R): R = TODO() diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/eagerAndPostponedCallableReferences.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/eagerAndPostponedCallableReferences.fir.kt index 56770d43dd3..ef03a9f1c31 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/eagerAndPostponedCallableReferences.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/eagerAndPostponedCallableReferences.fir.kt @@ -31,5 +31,5 @@ fun test() { val a6 = foo(::singleA, ::singleB) a6 - foo(::multiple, ::multiple) -} \ No newline at end of file + foo(::multiple, ::multiple) +} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt index f70a9b5d307..5b9bf3ff347 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt @@ -6,4 +6,4 @@ import kotlin.reflect.KProperty0 object A fun property0(property: KProperty0) = A -val K.key get() : A = property0(Map.Entry::key) // should be forbidden +val K.key get() : A = property0(Map.Entry::key) // should be forbidden diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/moreSpecificAmbiguousExtensions.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/moreSpecificAmbiguousExtensions.fir.kt index a3ba638c686..a75b761ebc6 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/moreSpecificAmbiguousExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/moreSpecificAmbiguousExtensions.fir.kt @@ -9,13 +9,13 @@ fun IB.extFun(x: IA) {} fun test() { val extFun1 = IA::extFun - val extFun2 = IB::extFun + val extFun2 = IB::extFun } fun testWithExpectedType() { val extFun_AB_A: IA.(IB) -> Unit = IA::extFun - val extFun_AA_B: IA.(IA) -> Unit = IB::extFun + val extFun_AA_B: IA.(IA) -> Unit = IB::extFun val extFun_BB_A: IB.(IB) -> Unit = IA::extFun val extFun_BA_B: IB.(IA) -> Unit = IB::extFun - val extFun_BB_B: IB.(IB) -> Unit = IB::extFun -} \ No newline at end of file + val extFun_BB_B: IB.(IB) -> Unit = IB::extFun +} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt index cbd6c75128d..45d92cebcae 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/overloads.fir.kt @@ -24,7 +24,7 @@ fun test() { B::bar checkType { _>() } - B::bas + B::bas - ::fas + ::fas } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt index 45505c9a927..fea145e1be9 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt @@ -11,6 +11,6 @@ fun baz(e: T, f: (T) -> Unit) {} fun test(a: A, b: B) { // Note that diagnostic is always on callable references as they are resolved after simple arguments - baz(a, ::fooB) - bar(::fooB, a) + baz(a, ::fooB) + bar(::fooB, a) } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withAs.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withAs.fir.kt index b0708a92797..c2608845f67 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withAs.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withAs.fir.kt @@ -6,5 +6,5 @@ fun foo(s: String) {} fun bar(f: () -> Unit) = 1 fun bar(f: (String) -> Unit) = 2 -val x1 = ::foo as () -> Unit -val x2 = bar(::foo as (String) -> Unit) \ No newline at end of file +val x1 = ::foo as () -> Unit +val x2 = bar(::foo as (String) -> Unit) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.fir.kt index 6d5fab08587..a9800bade40 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withExtFun.fir.kt @@ -14,14 +14,14 @@ class A { fun A.foo(): String = "A" -val x0 = A::foo +val x0 = A::foo val x1 = ofType<(A) -> Unit>(A::foo) val x2 = ofType>(A::foo) val x3: KProperty1 = A::foo val x4: (A) -> String = A::foo -val y0 = A::bar +val y0 = A::bar val y1 = ofType<(A) -> Unit>(A::bar) val y2 = ofType>(A::bar) val y3: KProperty1 = A::bar diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.fir.kt index 892f9b83286..1939aa09385 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.fir.kt @@ -9,4 +9,4 @@ fun foo(s: String) {} val x1 = apply(1, ::foo) val x2 = apply("hello", ::foo) -val x3 = apply(true, ::foo) +val x3 = apply(true, ::foo) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt index ec722c9bba5..2ce974ab1be 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt @@ -22,7 +22,7 @@ val x1 = fn1(1, ::foo, ::foo) val x2 = fn1(1, ::foo, ::bar) val x3 = fn2(::bar, ::foo) -val x4 = fn2(::foo, ::bar) -val x5 = fn2(::foo, ::foo) +val x4 = fn2(::foo, ::bar) +val x5 = fn2(::foo, ::foo) val x6 = fn3(1, ::qux) diff --git a/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt b/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt index f4318eb68f7..7e4d0e46fd0 100644 --- a/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/withQuestionMarks.fir.kt @@ -4,24 +4,24 @@ fun foo() {} fun main() { - val x1 = logger::info?::print - val x2 = logger?::info?::print - val x3 = logger?::info::print - val x4 = logger?::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print - val x5 = logger::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print - val x6 = logger!!::info?::print?::print - val x7 = logger::info!!::print?::print - val x8 = logger?::info!!::print?::print - val x9 = logger!!::info?::print?::print - val x10 = logger::info?::print!!::print - val x11 = logger!!::info!!::print!!::print - val x12 = logger?::info!!::print!!::print - val x13 = 42?::unresolved?::print + val x1 = logger::info?::print + val x2 = logger?::info?::print + val x3 = logger?::info::print + val x4 = logger?::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print + val x5 = logger::info?::print?::print?::print?::print?::print?::print?::print?::print?::print?::print + val x6 = logger!!::info?::print?::print + val x7 = logger::info!!::print?::print + val x8 = logger?::info!!::print?::print + val x9 = logger!!::info?::print?::print + val x10 = logger::info?::print!!::print + val x11 = logger!!::info!!::print!!::print + val x12 = logger?::info!!::print!!::print + val x13 = 42?::unresolved?::print val x14 = logger?!!::info?::print?::print - val x15 = logger::info?!!::print?::print - val x16 = logger!!?::info?::print?::print - val x17 = logger::info!!?::print?::print + val x15 = logger::info?!!::print?::print + val x16 = logger!!?::info?::print?::print + val x17 = logger::info!!?::print?::print // It must be OK val x18 = String?::hashCode ?: ::foo diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt index 9b80648ff3b..0e530390d01 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/provideDelegate/provideDelegateOnFunctionalTypeWithThis.fir.kt @@ -13,10 +13,10 @@ fun wrong(arg: Wrong) {} class Wrong class Right { - val prop: () -> Unit by ::wrong + val prop: () -> Unit by ::wrong } fun box(): String { Right().prop() return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/incompleteCode/illegalSelectorCallableReference.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/illegalSelectorCallableReference.fir.kt index f628947f48b..fd1c9dba1ec 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/illegalSelectorCallableReference.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/illegalSelectorCallableReference.fir.kt @@ -1,8 +1,8 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION fun test() { - "a"."b"::foo + "a"."b"::foo "a"."b"::class - "a"."b"."c"::foo + "a"."b"."c"::foo "a"."b"."c"::class } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/approximateContravariantCapturedTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/approximateContravariantCapturedTypes.fir.kt index f309d330487..7b36c7a0a02 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/approximateContravariantCapturedTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/approximateContravariantCapturedTypes.fir.kt @@ -24,7 +24,7 @@ fun Foo2.setX(y: T): T { fun Float.bar() {} fun test1() { - val fooSetRef = Foo<*>::setX + val fooSetRef = Foo<*>::setX val foo = Foo(1f) fooSetRef.invoke(foo, 1) @@ -42,7 +42,7 @@ fun test2() { } fun test3() { - val fooSetRef = Foo2<*>::setX + val fooSetRef = Foo2<*>::setX val foo = Foo2(1) fooSetRef.invoke(foo, "") diff --git a/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt b/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt index 10dbcc218b1..9e37b8bf22d 100644 --- a/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt @@ -27,22 +27,22 @@ interface Foo { // CR on property with to receivers are forbidden fun test() { // with LHS and property - bar8(Foo::x1) - bar8(Foo::x1) - bar8(Foo::x1) + bar8(Foo::x1) + bar8(Foo::x1) + bar8(Foo::x1) // with LHS and mutable property - bar8(Foo::x2) - bar8(Foo::x2) - bar8(Foo::x2) + bar8(Foo::x2) + bar8(Foo::x2) + bar8(Foo::x2) // with LHS and propery + mutable property (mixed) - bar8(Foo::x3) - bar8(Foo::x3) - bar8(Foo::x3) - bar9(Foo::x3) - bar9(Foo::x3) - bar9(Foo::x3) + bar8(Foo::x3) + bar8(Foo::x3) + bar8(Foo::x3) + bar9(Foo::x3) + bar9(Foo::x3) + bar9(Foo::x3) } } @@ -84,14 +84,14 @@ fun main() { bar1(::resolve) // OK // with LHS and conflicting projection - bar2(Foo::resolve) - bar2(Foo::resolve) - bar2(Foo::resolve) + bar2(Foo::resolve) + bar2(Foo::resolve) + bar2(Foo::resolve) // with LHS and Any? expected type - bar3(Foo::resolve) - bar3(Foo::resolve) - bar3(Foo::resolve) + bar3(Foo::resolve) + bar3(Foo::resolve) + bar3(Foo::resolve) // with LHS and `Function` expected type bar4(Foo::resolve) // ERROR before the fix in NI @@ -114,14 +114,14 @@ fun main() { bar7(Foo::resolve) // OK // with LHS and sentension function expected type - bar10(Int::x1) // ERROR before the fix in NI + bar10(Int::x1) // ERROR before the fix in NI bar10(Int::x1) // OK bar10(Int::x1) // OK fun Int.ext() { // with LHS and sentension function expected type - bar10(::x1) // ERROR before the fix in NI - bar10(::x1) // OK - bar10(::x1) // OK + bar10(::x1) // ERROR before the fix in NI + bar10(::x1) // OK + bar10(::x1) // OK } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.fir.kt index 5f41403ca68..d887e36ef47 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_both.fir.kt @@ -12,5 +12,5 @@ fun G.foo(vararg values: V2) = build() fun forReference(ref: Any?) {} fun test() { - forReference(G::foo) + forReference(G::foo) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.fir.kt index 1a40bd0ff89..9f6b4b06592 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt32862_none.fir.kt @@ -7,5 +7,5 @@ fun foo(i: Long) {} fun bar(f: (Boolean) -> Unit) {} fun test() { - bar(::foo) + bar(::foo) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt34282.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt34282.fir.kt index 3697a669688..129001733f8 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt34282.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt34282.fir.kt @@ -6,5 +6,5 @@ fun foo(x: Float) = 10f fun foo(x: String) = "" fun main() { - bar(::foo) // no report about unresolved callable reference for `foo` + bar(::foo) // no report about unresolved callable reference for `foo` } diff --git a/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.fir.kt b/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.fir.kt index ece51b0e384..aa0854e2744 100644 --- a/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/reportAboutUnresolvedReferenceAsUnresolved.fir.kt @@ -3,5 +3,5 @@ fun T.map(f: (T) -> U) = f(this) fun consume(s: String) {} fun test() { - consume(1.map(::foo)) -} \ No newline at end of file + consume(1.map(::foo)) +} diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.fir.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.fir.kt index 46cc6249346..7b78f02cca0 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/kt42620.fir.kt @@ -3,13 +3,13 @@ class Foo fun main1() = when { - else -> Foo::plus + else -> Foo::plus } fun main2() = if (true) Foo::minus else Foo::times fun main3() = if (true) { Foo::minus } else { Foo::times } -fun main4() = try { Foo::minus } finally { Foo::times } +fun main4() = try { Foo::minus } finally { Foo::times } fun main5() = Foo::minus ?: Foo::times diff --git a/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.fir.kt b/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.fir.kt index 729572ad9eb..5f065dee813 100644 --- a/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/specialCallsWithCallableReferences.fir.kt @@ -129,7 +129,7 @@ fun poll36(flag: Boolean) { } fun poll4() { - val inv = try { ::bar } finally { ::foo } + val inv = try { ::bar } finally { ::foo } inv() } @@ -139,7 +139,7 @@ fun poll41() { } fun poll42() { - val inv = try { ::bar3 } finally { ::foo3 } + val inv = try { ::bar3 } finally { ::foo3 } inv() } @@ -149,7 +149,7 @@ fun poll43() { } fun poll44() { - val inv = try { ::bar5 } finally { ::foo5 } + val inv = try { ::bar5 } finally { ::foo5 } inv() } @@ -164,7 +164,7 @@ fun poll46() { } fun poll5() { - val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo } + val inv = try { ::bar } catch (e: Exception) { ::foo } finally { ::foo } inv() } @@ -174,7 +174,7 @@ fun poll51() { } fun poll52() { - val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 } + val inv = try { ::bar3 } catch (e: Exception) { ::foo3 } finally { ::foo3 } inv() } @@ -184,7 +184,7 @@ fun poll53() { } fun poll54() { - val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 } + val inv = try { ::bar5 } catch (e: Exception) { ::foo5 } finally { ::foo5 } inv() } @@ -199,7 +199,7 @@ fun poll56() { } fun poll6() { - val inv = ::bar + val inv = ::bar inv } @@ -209,7 +209,7 @@ fun poll61() { } fun poll62() { - val inv = ::bar3 + val inv = ::bar3 inv } @@ -219,7 +219,7 @@ fun poll63() { } fun poll64() { - val inv = ::bar5 + val inv = ::bar5 inv } @@ -269,7 +269,7 @@ fun poll76() { } fun poll8() { - val inv = ::bar in setOf(::foo) + val inv = ::bar in setOf(::foo) inv() } @@ -279,7 +279,7 @@ fun poll81() { } fun poll82() { - val inv = ::bar3 in setOf(::foo3) + val inv = ::bar3 in setOf(::foo3) inv() } @@ -289,7 +289,7 @@ fun poll83() { } fun poll84() { - val inv = ::bar5 in setOf(::foo5) + val inv = ::bar5 in setOf(::foo5) inv } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt index 80760d8daf3..6e0cc2b4eed 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt @@ -22,6 +22,6 @@ fun main(c: CollectionWithSize) { CompressionType.ZIP.name checkType { _() } c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt index aa113f16ee1..54137c0e6d6 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt @@ -23,6 +23,6 @@ fun main(c: CollectionWithSize) { CompressionType.ZIP.name checkType { _() } c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt index df77b661fc5..c13949bbd50 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt @@ -22,6 +22,6 @@ fun main(c: CollectionWithSize) { CompressionType.ZIP.name checkType { _() } c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt index 65798d88144..18cda240d71 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt @@ -18,7 +18,7 @@ public class Inv { fun test(inv: Inv) { val m: ((String) -> String) -> Inv = inv::map - take(inv::map) + take(inv::map) } fun take(f: ((String) -> String) -> Inv) {} diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt index ac17886b6d9..e77ba8ad817 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesNew.fir.kt @@ -115,28 +115,28 @@ class C : O.B() { val n = FromCompanionC::foo // INVISIBLE: direct superclasses themselves. - val a = A::foo - val b = A::foo + val a = A::foo + val b = A::foo // DEPRECATED: Classifiers from companions of direct superclasses - val e = FromCompanionA::foo - val f = FromCompanionB::foo + val e = FromCompanionA::foo + val f = FromCompanionB::foo // INVISIBLE: "cousin" supertypes themselves - val g = Alpha::foo - val h = Beta::foo - val i = Gamma::foo + val g = Alpha::foo + val h = Beta::foo + val i = Gamma::foo // DEPRECATED: classifiers from "cousin" superclasses - val k = FromAlpha::foo - val l = FromBeta::foo - val m = FromGamma::foo + val k = FromAlpha::foo + val l = FromBeta::foo + val m = FromGamma::foo // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = FromCompanionAlpha::foo - val p = FromCompanionBeta::foo - val q = FromCompanionGamma::foo + val o = FromCompanionAlpha::foo + val p = FromCompanionBeta::foo + val q = FromCompanionGamma::foo // DEPRECATED: Classifiers from supertypes of our own companion - val r = FromDelta::foo + val r = FromDelta::foo } diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt index e258166f58b..56f5b1df034 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOld.fir.kt @@ -115,28 +115,28 @@ class C : O.B() { val n = FromCompanionC::foo // INVISIBLE: direct superclasses themselves. - val a = A::foo - val b = A::foo + val a = A::foo + val b = A::foo // DEPRECATED: Classifiers from companions of direct superclasses - val e = FromCompanionA::foo - val f = FromCompanionB::foo + val e = FromCompanionA::foo + val f = FromCompanionB::foo // INVISIBLE: "cousin" supertypes themselves - val g = Alpha::foo - val h = Beta::foo - val i = Gamma::foo + val g = Alpha::foo + val h = Beta::foo + val i = Gamma::foo // DEPRECATED: classifiers from "cousin" superclasses - val k = FromAlpha::foo - val l = FromBeta::foo - val m = FromGamma::foo + val k = FromAlpha::foo + val l = FromBeta::foo + val m = FromGamma::foo // INVISIBLE: We don't see classifiers from companions of "cousin" superclasses - val o = FromCompanionAlpha::foo - val p = FromCompanionBeta::foo - val q = FromCompanionGamma::foo + val o = FromCompanionAlpha::foo + val p = FromCompanionBeta::foo + val q = FromCompanionGamma::foo // DEPRECATED: Classifiers from supertypes of our own companion - val r = FromDelta::foo + val r = FromDelta::foo } diff --git a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt index 04396ecf509..132c34e31b7 100644 --- a/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt +++ b/compiler/testData/diagnostics/tests/objects/kt21515/callableReferencesOldComplexCases.fir.kt @@ -12,7 +12,7 @@ object A { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } @@ -30,7 +30,7 @@ object B { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } @@ -48,7 +48,7 @@ object C { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } @@ -64,6 +64,6 @@ object D { } class Derived : Base() { - val a = FromBaseCompanion::foo + val a = FromBaseCompanion::foo } } diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt index e1d94c8f043..5bc68c265e7 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/calleeExpressionAsCallExpression.fir.kt @@ -1,2 +1,2 @@ // !WITH_NEW_INFERENCE -val unwrapped = some<sdf()()::unwrap +val unwrapped = some<sdf()()::unwrap diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt index 1f624d4c7ca..c413fd0249e 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.fir.kt @@ -1,4 +1,4 @@ // !WITH_NEW_INFERENCE // NI_EXPECTED_FILE -val unwrapped = some.<cabc$Wrapper<out Any>::unwrap +val unwrapped = some.<cabc$Wrapper<out Any>::unwrap diff --git a/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt index 71b6485cce8..11a5eda6d23 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt13685.fir.kt @@ -3,5 +3,5 @@ fun foo() { val text: List = null!! - text.map Any?::toString + text.map Any?::toString } diff --git a/compiler/testData/diagnostics/tests/regressions/kt31975.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt31975.fir.kt index 7d2a4307a45..16b68bfe678 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt31975.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt31975.fir.kt @@ -11,7 +11,7 @@ interface TypeConstructor class Refiner { val memoizedFunctionLambda = createMemoizedFunction { it.foo() } // error type infered, no diagnostic, BAD, backend fails - val memoizedFunctionReference = createMemoizedFunction(TypeConstructor::foo) // EXTENSION_IN_CLASS_REFERENCE_IS_NOT_ALLOWED, fine + val memoizedFunctionReference = createMemoizedFunction(TypeConstructor::foo) // EXTENSION_IN_CLASS_REFERENCE_IS_NOT_ALLOWED, fine val memoizedFunctionTypes = createMemoizedFunction { it.foo() } // works fine private fun TypeConstructor.foo(): Boolean = true diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt index 4dab9e8908b..fbac2590086 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/noBoundCallableReferences/qualifiedJavaClassReferenceInKClassExtension.fir.kt @@ -6,5 +6,5 @@ val KClass.java: Class get() = null!! val KClass.foo: Any? get() { - return java.lang.Integer::hashCode + return java.lang.Integer::hashCode } diff --git a/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt b/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt index 0dbf408b74a..6592ddccb2d 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt @@ -14,5 +14,5 @@ fun test() { foo2(42, ::bar2) foo2("str", ::bar2) - foo2(42, ::bar1) + foo2(42, ::bar1) } diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt index 71d617e6796..bd188bbbf8d 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasesInQualifiers.fir.kt @@ -53,7 +53,7 @@ fun foo( test.ClassAlias::func test.ClassSample.Nested::func - test.ClassAlias.Nested::func + test.ClassAlias.Nested::func test.ObjectSample::Nested test.ObjectAlias::Nested @@ -62,7 +62,7 @@ fun foo( test.ObjectAlias::func test.ObjectSample.Nested::func - test.ObjectAlias.Nested::func + test.ObjectAlias.Nested::func test.EnumSample::Nested test.EnumAlias::Nested @@ -71,5 +71,5 @@ fun foo( test.EnumAlias::func test.EnumSample.Nested::func - test.EnumAlias.Nested::func + test.EnumAlias.Nested::func } diff --git a/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt b/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt index e8c30e4d3bb..83342193987 100644 --- a/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt @@ -21,9 +21,9 @@ fun test() { useStringArray(::stringVararg) useIntArray(::numberVararg) usePrimitiveIntArray(::intVararg) - useIntArray(::intVararg) - useMixedStringArgs1(::stringVararg) - useMixedStringArgs2(::stringVararg) - useMixedStringArgs3(::stringVararg) - useTwoStringArrays(::stringVararg) + useIntArray(::intVararg) + useMixedStringArgs1(::stringVararg) + useMixedStringArgs2(::stringVararg) + useMixedStringArgs3(::stringVararg) + useTwoStringArrays(::stringVararg) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt index ec428e324d1..5c477341c78 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt @@ -6,8 +6,8 @@ class Impl : Inv class Scope(private val implClass: j.Class) { fun foo(c: Collection) { val hm = c.asSequence() - .filter(implClass::isInstance) - .map(implClass::cast) + .filter(implClass::isInstance) + .map(implClass::cast) .toSet() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt index 007a8e58ec5..5cf8520da78 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt @@ -11,7 +11,7 @@ suspend fun String.id(): String = this fun box() { val x = "f" builder { - go1(x::id) - go2(x::id) + go1(x::id) + go2(x::id) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt index 6e52c567b70..5e9c154ae78 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt @@ -15,8 +15,8 @@ suspend fun bar(x: Int) {} fun test() { test0(::foo) - test1(::foo) + test1(::foo) - test0(::bar) + test0(::bar) test1(::bar) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt index 3c88ff3809b..f4ed2812b6d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt @@ -3,6 +3,6 @@ internal class Z { val map = HashMap() inline fun compute(key: String, producer: () -> String): String { - return map.getOrPut(key, ::producer) + return map.getOrPut(key, ::producer) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/callableReferences.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/callableReferences.fir.kt index 9edfb2eded2..7a1581ae9dd 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/callableReferences.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/callableReferences.fir.kt @@ -49,7 +49,7 @@ fun main() { select(id(")!>::foo4), id { x: A -> }, id { it }) select(id(")!>::foo4), id { x: B -> }, id { it }) // Expected ambiguity - select(id(::foo4), id { x: A -> }, id { x: B -> }, id { it }) + select(id(::foo4), id { x: A -> }, id { x: B -> }, id { it }) select(id(::foo5), id { x: A -> }, id { x: B -> }, id { it }) diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt42620.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt42620.fir.kt index 46cc6249346..7b78f02cca0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt42620.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt42620.fir.kt @@ -3,13 +3,13 @@ class Foo fun main1() = when { - else -> Foo::plus + else -> Foo::plus } fun main2() = if (true) Foo::minus else Foo::times fun main3() = if (true) { Foo::minus } else { Foo::times } -fun main4() = try { Foo::minus } finally { Foo::times } +fun main4() = try { Foo::minus } finally { Foo::times } fun main5() = Foo::minus ?: Foo::times diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt index a6de1866748..8522b1443a5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt @@ -11,7 +11,7 @@ class Case1() { } fun case() { - Companion(::x) + Companion(::x) } val x = "" @@ -27,7 +27,7 @@ class Case2() { } fun case() { - Companion(::x) + Companion(::x) } val x = C() @@ -54,8 +54,8 @@ class Case3() : I { fun x() = "" as CharSequence fun case() { - I.invoke(::x) - I(::x) - Case3(::x) + I.invoke(::x) + I(::x) + Case3(::x) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.2.fir.kt index 1e4813643df..e86b50ac5f0 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.2.fir.kt @@ -11,7 +11,7 @@ import libCase1.* import kotlin.text.format fun case1() { - val y1 =(String)::format + val y1 =(String)::format } // FILE: LibCase1.kt @@ -28,7 +28,7 @@ import libCase2.* import kotlin.text.* fun case2() { - val y1 =(String)::format + val y1 =(String)::format } // FILE: LibCase2.kt diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.3.fir.kt index 53e7f88f613..bf8698d6627 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.3.fir.kt @@ -10,7 +10,7 @@ package testsCase1 import libCase1.* fun case1() { - val y1 =(A)::boo + val y1 =(A)::boo } // FILE: LibCase1.kt @@ -31,7 +31,7 @@ import libCase2.A import libCase2.boo fun case2() { - val y1 =(A)::boo + val y1 =(A)::boo } // FILE: LibCase2.kt diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.4.fir.kt index a5b7960181c..1b144653f61 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.4.fir.kt @@ -11,7 +11,7 @@ package testsCase1 import libCase1.boo fun case1() { - val y1 =1::boo + val y1 =1::boo } // FILE: LibCase1.kt @@ -27,7 +27,7 @@ package testsCase2 import libCase2.* fun case2() { - val y1 =1::boo + val y1 =1::boo } // FILE: LibCase2.kt diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.5.fir.kt index ffb7b14862a..09d5eaf1ab5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.5.fir.kt @@ -11,7 +11,7 @@ package testsCase1 import libCase1.boo fun case1() { - val y1 =::boo + val y1 =::boo } // FILE: LibCase1.kt @@ -27,7 +27,7 @@ package testsCase2 import libCase2.* fun case2() { - val y1 =::boo + val y1 =::boo } val boo: String @@ -46,7 +46,7 @@ package testsCase3 import libCase3.* fun case3() { - val y1 =::boo + val y1 =::boo } val boo: String diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt index a8fd4601329..e5e9f7e214d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt @@ -11,7 +11,7 @@ import libCase1.* import kotlin.text.format fun case1() { - val y2 : () ->String =(String)::format + val y2 : () ->String =(String)::format } // FILE: LibCase1.kt