From 328c67b9e85eecb3dd54be8ebffcf5584bceb67b Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Tue, 7 Nov 2017 02:05:39 +0300 Subject: [PATCH] Add separate diagnostic renderer results for tests with NI --- .../diagnostics/tests/DeferredTypes.kt | 2 + .../diagnostics/tests/DeferredTypes.ni.txt | 8 +++ .../tests/InvokeAndRecursiveResolve.kt | 2 + .../tests/InvokeAndRecursiveResolve.ni.txt | 29 ++++++++ .../tests/RecursiveTypeInference.kt | 2 + .../tests/RecursiveTypeInference.ni.txt | 36 ++++++++++ .../resolve/withGenericFun.kt | 1 + .../resolve/withGenericFun.ni.txt | 8 +++ .../resolve/withPlaceholderTypes.kt | 1 + .../resolve/withPlaceholderTypes.ni.txt | 18 +++++ .../tests/cast/bare/UnrelatedColon.kt | 1 + .../tests/cast/bare/UnrelatedColon.ni.txt | 15 ++++ .../controlFlowAnalysis/elvisNotProcessed.kt | 1 + .../elvisNotProcessed.ni.txt | 12 ++++ .../fieldAsClassDelegate.kt | 1 + .../fieldAsClassDelegate.ni.txt | 56 +++++++++++++++ .../tests/controlFlowAnalysis/kt10805.kt | 1 + .../tests/controlFlowAnalysis/kt10805.ni.txt | 3 + .../inference/genericMethods.kt | 1 + .../inference/genericMethods.ni.txt | 34 +++++++++ .../noExpectedTypeForSupertypeConstraint.kt | 1 + ...oExpectedTypeForSupertypeConstraint.ni.txt | 18 +++++ .../delegatedProperty/propertyDefferedType.kt | 1 + .../propertyDefferedType.ni.txt | 18 +++++ .../tests/delegatedProperty/recursiveType.kt | 1 + .../delegatedProperty/recursiveType.ni.txt | 14 ++++ .../diagnostics/tests/enum/commonSupertype.kt | 1 + .../tests/enum/commonSupertype.ni.txt | 41 +++++++++++ .../return/LocalReturnUnitAndDontCareType.kt | 1 + .../LocalReturnUnitAndDontCareType.ni.txt | 6 ++ .../functionLiterals/return/SmartCast.kt | 1 + .../functionLiterals/return/SmartCast.ni.txt | 6 ++ .../capturedParameters/innerLocalClass.kt | 1 + .../capturedParameters/innerLocalClass.ni.txt | 22 ++++++ .../generics/commonSupertypeContravariant.kt | 2 + .../commonSupertypeContravariant.ni.txt | 24 +++++++ .../generics/commonSupertypeContravariant2.kt | 2 + .../commonSupertypeContravariant2.ni.txt | 24 +++++++ .../diagnostics/tests/implicitIntersection.kt | 2 + .../tests/implicitIntersection.ni.txt | 34 +++++++++ .../tests/implicitNestedIntersection.kt | 1 + .../tests/implicitNestedIntersection.ni.txt | 24 +++++++ .../fixationOrderForProperConstraints.kt | 1 + .../fixationOrderForProperConstraints.ni.txt | 4 ++ .../diagnostics/tests/inner/innerThisSuper.kt | 2 + .../tests/inner/innerThisSuper.ni.txt | 43 +++++++++++ .../inner/nestedVsInnerAccessOuterMember.kt | 2 + .../nestedVsInnerAccessOuterMember.ni.txt | 43 +++++++++++ .../qualifiedExpression/genericNestedClass.kt | 1 + .../genericNestedClass.ni.txt | 20 ++++++ .../testData/diagnostics/tests/kt13401.kt | 2 + .../testData/diagnostics/tests/kt13401.ni.txt | 32 +++++++++ .../diagnostics/tests/objects/ObjectsLocal.kt | 2 + .../tests/objects/ObjectsLocal.ni.txt | 22 ++++++ .../commonSupertype/withNothing.kt | 1 + .../commonSupertype/withNothing.ni.txt | 24 +++++++ .../inferenceFromGetters/cantBeInferred.kt | 1 + .../cantBeInferred.ni.txt | 6 ++ .../inferenceFromGetters/recursiveGetter.kt | 1 + .../recursiveGetter.ni.txt | 18 +++++ .../unsupportedInferenceFromGetters.kt | 1 + .../unsupportedInferenceFromGetters.ni.txt | 38 ++++++++++ .../nullCalleeExpression.kt | 2 + .../nullCalleeExpression.ni.txt | 3 + .../diagnostics/tests/regressions/Jet81.kt | 1 + .../tests/regressions/Jet81.ni.txt | 28 ++++++++ .../diagnostics/tests/regressions/kt10843.kt | 1 + .../tests/regressions/kt10843.ni.txt | 3 + .../dslMarkerWithTypealiasRecursion.kt | 1 + .../dslMarkerWithTypealiasRecursion.ni.txt | 28 ++++++++ .../initializerScopeOfExtensionProperty.kt | 2 + ...initializerScopeOfExtensionProperty.ni.txt | 35 +++++++++ .../constructorCallType.kt | 1 + .../constructorCallType.ni.txt | 32 +++++++++ .../tests/smartCasts/lambdaAndArgument.kt | 1 + .../tests/smartCasts/lambdaAndArgument.ni.txt | 5 ++ .../tests/smartCasts/lambdaAndArgumentFun.kt | 1 + .../smartCasts/lambdaAndArgumentFun.ni.txt | 5 ++ .../innerClassTypeAliasConstructor.kt | 2 + .../innerClassTypeAliasConstructor.ni.txt | 39 ++++++++++ ...ximationInTypeAliasArgumentSubstitution.kt | 2 + ...tionInTypeAliasArgumentSubstitution.ni.txt | 8 +++ .../tests/typealias/substitutionVariance.kt | 2 + .../typealias/substitutionVariance.ni.txt | 72 +++++++++++++++++++ .../tests/typealias/typeAliasAsQualifier.kt | 1 + .../typealias/typeAliasAsQualifier.ni.txt | 46 ++++++++++++ .../typeAliasConstructorCrazyProjections.kt | 2 + ...ypeAliasConstructorCrazyProjections.ni.txt | 17 +++++ .../typeAliasConstructorForProjection.kt | 2 + .../typeAliasConstructorForProjection.ni.txt | 18 +++++ ...eAliasConstructorTypeArgumentsInference.kt | 2 + ...asConstructorTypeArgumentsInference.ni.txt | 52 ++++++++++++++ ...orTypeArgumentsInferenceWithNestedCalls.kt | 2 + ...peArgumentsInferenceWithNestedCalls.ni.txt | 14 ++++ ...rTypeArgumentsInferenceWithNestedCalls2.kt | 2 + ...eArgumentsInferenceWithNestedCalls2.ni.txt | 28 ++++++++ ...rTypeArgumentsInferenceWithPhantomTypes.kt | 2 + ...eArgumentsInferenceWithPhantomTypes.ni.txt | 30 ++++++++ .../typeAliasConstructorWrongVisibility.kt | 2 + ...typeAliasConstructorWrongVisibility.ni.txt | 33 +++++++++ ...NumberOfArgumentsInTypeAliasConstructor.kt | 2 + ...erOfArgumentsInTypeAliasConstructor.ni.txt | 41 +++++++++++ .../diagnostics/tests/when/kt10809.kt | 1 + .../diagnostics/tests/when/kt10809.ni.txt | 37 ++++++++++ .../tests/when/whenWithNothingAndLambdas.kt | 1 + .../when/whenWithNothingAndLambdas.ni.txt | 8 +++ 106 files changed, 1358 insertions(+) create mode 100644 compiler/testData/diagnostics/tests/DeferredTypes.ni.txt create mode 100644 compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.ni.txt create mode 100644 compiler/testData/diagnostics/tests/RecursiveTypeInference.ni.txt create mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.ni.txt create mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.ni.txt create mode 100644 compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.ni.txt create mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.ni.txt create mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.ni.txt create mode 100644 compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.ni.txt create mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.ni.txt create mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.ni.txt create mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.ni.txt create mode 100644 compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.ni.txt create mode 100644 compiler/testData/diagnostics/tests/enum/commonSupertype.ni.txt create mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.ni.txt create mode 100644 compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.ni.txt create mode 100644 compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.ni.txt create mode 100644 compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.ni.txt create mode 100644 compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.ni.txt create mode 100644 compiler/testData/diagnostics/tests/implicitIntersection.ni.txt create mode 100644 compiler/testData/diagnostics/tests/implicitNestedIntersection.ni.txt create mode 100644 compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.ni.txt create mode 100644 compiler/testData/diagnostics/tests/inner/innerThisSuper.ni.txt create mode 100644 compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.ni.txt create mode 100644 compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.ni.txt create mode 100644 compiler/testData/diagnostics/tests/kt13401.ni.txt create mode 100644 compiler/testData/diagnostics/tests/objects/ObjectsLocal.ni.txt create mode 100644 compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.ni.txt create mode 100644 compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.ni.txt create mode 100644 compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.ni.txt create mode 100644 compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.ni.txt create mode 100644 compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.ni.txt create mode 100644 compiler/testData/diagnostics/tests/regressions/Jet81.ni.txt create mode 100644 compiler/testData/diagnostics/tests/regressions/kt10843.ni.txt create mode 100644 compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.ni.txt create mode 100644 compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.ni.txt create mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.ni.txt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.ni.txt create mode 100644 compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/substitutionVariance.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.ni.txt create mode 100644 compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.ni.txt create mode 100644 compiler/testData/diagnostics/tests/when/kt10809.ni.txt create mode 100644 compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.ni.txt diff --git a/compiler/testData/diagnostics/tests/DeferredTypes.kt b/compiler/testData/diagnostics/tests/DeferredTypes.kt index 5f4c82472be..dca15132c23 100644 --- a/compiler/testData/diagnostics/tests/DeferredTypes.kt +++ b/compiler/testData/diagnostics/tests/DeferredTypes.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + interface T { val a = Foo.bar() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/DeferredTypes.ni.txt b/compiler/testData/diagnostics/tests/DeferredTypes.ni.txt new file mode 100644 index 00000000000..39b468e726b --- /dev/null +++ b/compiler/testData/diagnostics/tests/DeferredTypes.ni.txt @@ -0,0 +1,8 @@ +package + +public interface T { + public open val a: kotlin.Any? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt index ec0c1c2124d..f0552332703 100644 --- a/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt +++ b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + fun test() = 3 fun proxy(t: T) = t diff --git a/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.ni.txt b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.ni.txt new file mode 100644 index 00000000000..8be0de8da56 --- /dev/null +++ b/compiler/testData/diagnostics/tests/InvokeAndRecursiveResolve.ni.txt @@ -0,0 +1,29 @@ +package + +public fun proxy(/*0*/ t: T): T +public fun test(): kotlin.Int + +public final class A { + public constructor A() + public final val test: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B { + public constructor B() + public final val test: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class C { + public constructor C() + public final val bar: kotlin.Any? + public final val test: [ERROR : Type for bar()] + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt b/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt index a14f9dde4d2..7b111c06075 100644 --- a/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt +++ b/compiler/testData/diagnostics/tests/RecursiveTypeInference.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + // FILE: f.kt package a val foo = bar() diff --git a/compiler/testData/diagnostics/tests/RecursiveTypeInference.ni.txt b/compiler/testData/diagnostics/tests/RecursiveTypeInference.ni.txt new file mode 100644 index 00000000000..e5f5ea61402 --- /dev/null +++ b/compiler/testData/diagnostics/tests/RecursiveTypeInference.ni.txt @@ -0,0 +1,36 @@ +package + +package a { + public val foo: kotlin.Any? + public fun bar(): [ERROR : Error function type] +} + +package b { + public fun bar(): [ERROR : Error function type] + public fun foo(): kotlin.Any? +} + +package c { + public fun bar(): kotlin.Any? + public fun bazz(): kotlin.Any? + public fun foo(): [ERROR : Error function type] +} + +package ok { + + package ok.a { + public val foo: kotlin.Int + public fun bar(): kotlin.Int + } + + package ok.b { + public fun bar(): kotlin.Int + public fun foo(): kotlin.Int + } + + package ok.c { + public fun bar(): kotlin.Int + public fun bazz(): kotlin.Int + public fun foo(): kotlin.Int + } +} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt index 693953125b9..9251adf33f4 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER +// NI_EXPECTED_FILE fun apply(x: T, f: (T) -> R): R = f(x) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.ni.txt b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.ni.txt new file mode 100644 index 00000000000..06a6723ae50 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withGenericFun.ni.txt @@ -0,0 +1,8 @@ +package + +public val x1: kotlin.Unit +public val x2: kotlin.Unit +public val x3: kotlin.Nothing +public fun apply(/*0*/ x: T, /*1*/ f: (T) -> R): R +public fun foo(/*0*/ i: kotlin.Int): kotlin.Unit +public fun foo(/*0*/ s: kotlin.String): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt index 831f3a9652d..e228f497915 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER,-CONFLICTING_JVM_DECLARATIONS +// NI_EXPECTED_FILE fun foo(i: Int) = "$i" fun foo(s: String) = s diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.ni.txt b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.ni.txt new file mode 100644 index 00000000000..8f3221c71e5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.ni.txt @@ -0,0 +1,18 @@ +package + +public val x1: kotlin.String +public val x2: kotlin.String +public val x3: [ERROR : Type for fn2(::bar, ::foo)] +public val x4: [ERROR : Type for fn2(::foo, ::bar)] +public val x5: [ERROR : Type for fn2(::foo, ::foo)] +public val x6: kotlin.Int +public fun bar(/*0*/ s: kotlin.String): kotlin.String +public fun fn1(/*0*/ x: kotlin.Int, /*1*/ f1: (kotlin.Int) -> kotlin.String, /*2*/ f2: (kotlin.String) -> kotlin.String): kotlin.String +public fun fn2(/*0*/ f1: (kotlin.Int) -> kotlin.Int, /*1*/ f2: (kotlin.Int) -> kotlin.String): kotlin.String +public fun fn2(/*0*/ f1: (kotlin.Int) -> kotlin.String, /*1*/ f2: (kotlin.String) -> kotlin.String): kotlin.String +public fun fn2(/*0*/ f1: (kotlin.String) -> kotlin.String, /*1*/ f2: (kotlin.String) -> kotlin.String): kotlin.String +public fun fn3(/*0*/ i: kotlin.Int, /*1*/ f: (kotlin.Int, kotlin.Int, kotlin.Int) -> kotlin.Int): kotlin.Int +public fun foo(/*0*/ i: kotlin.Int): kotlin.String +public fun foo(/*0*/ s: kotlin.String): kotlin.String +public fun qux(/*0*/ i: kotlin.Int, /*1*/ j: kotlin.Int, /*2*/ k: kotlin.Int): kotlin.Int +public fun qux(/*0*/ a: kotlin.String, /*1*/ b: kotlin.String, /*2*/ c: kotlin.String, /*3*/ d: kotlin.String): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.kt b/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.kt index 06abe2bc01c..36194813017 100644 --- a/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.kt +++ b/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.kt @@ -1,4 +1,5 @@ // !CHECK_TYPE +// NI_EXPECTED_FILE interface Tr interface G diff --git a/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.ni.txt b/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.ni.txt new file mode 100644 index 00000000000..3deb20fc81f --- /dev/null +++ b/compiler/testData/diagnostics/tests/cast/bare/UnrelatedColon.ni.txt @@ -0,0 +1,15 @@ +package + +public fun test(/*0*/ tr: Tr): Tr + +public interface G { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Tr { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt index c49465ae326..afd8c205883 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // See KT-8277 +// NI_EXPECTED_FILE val v = { true } ?: ( { true } ?: null!! ) diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.ni.txt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.ni.txt new file mode 100644 index 00000000000..2e1fad201ae --- /dev/null +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/elvisNotProcessed.ni.txt @@ -0,0 +1,12 @@ +package + +public val b: kotlin.Any +public val bb: () -> kotlin.Boolean +public val bbb: (() -> kotlin.Boolean)? +public val bbbb: (() -> kotlin.Boolean)? +public val n: () -> kotlin.Boolean +public val v: () -> kotlin.Boolean +public val w: () -> kotlin.Boolean +public val ww: () -> kotlin.Boolean +public fun f(/*0*/ x: kotlin.Long?): kotlin.Long +public fun l(): (() -> kotlin.Boolean)? diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt index 3b721d9895d..3bce43c89ff 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // See KT-15566 +// NI_EXPECTED_FILE import DefaultHttpClient.client diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.ni.txt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.ni.txt new file mode 100644 index 00000000000..cada8d78115 --- /dev/null +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/fieldAsClassDelegate.ni.txt @@ -0,0 +1,56 @@ +package + +private fun fClient(): HttpClientImpl +private fun lazy(/*0*/ init: () -> T): [ERROR : kotlin.Lazy] + +public object DefaultFqHttpClient : HttpClient { + private constructor DefaultFqHttpClient() + public final val client: HttpClientImpl + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public object DefaultHttpClient : HttpClient { + private constructor DefaultHttpClient() + public final val client: HttpClientImpl + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public object DefaultHttpClientWithBy : HttpClient { + private constructor DefaultHttpClientWithBy() + public final val client: [ERROR : Type from delegate] + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public object DefaultHttpClientWithFun : HttpClient { + private constructor DefaultHttpClientWithFun() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public object DefaultHttpClientWithGetter : HttpClient { + private constructor DefaultHttpClientWithGetter() + public final val client: HttpClientImpl + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface HttpClient { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class HttpClientImpl : HttpClient { + public constructor HttpClientImpl() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt index 54d39e6c795..b756f2953c5 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // AssertionError for nested ifs with lambdas and Nothing as results +// NI_EXPECTED_FILE val fn = if (true) { { true } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.ni.txt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.ni.txt new file mode 100644 index 00000000000..f4fb482283a --- /dev/null +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10805.ni.txt @@ -0,0 +1,3 @@ +package + +public val fn: () -> kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt index 842bc41c4d6..dd4bb974523 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER +// NI_EXPECTED_FILE import kotlin.reflect.KProperty var a: Int by A() diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.ni.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.ni.txt new file mode 100644 index 00000000000..3b6c1ca54b9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/genericMethods.ni.txt @@ -0,0 +1,34 @@ +package + +public var a: kotlin.Int +public var a1: [ERROR : Type from delegate] +public var b: kotlin.Int +public var c: kotlin.String +public val cObj: C +public operator fun B.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T +public operator inline fun C.getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T +public operator fun B.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit +public operator inline fun C.setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit + +public final class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final operator fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final operator fun setValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>, /*2*/ x: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class C { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt index e6c7cd2abd5..42d7537bd63 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE import kotlin.reflect.KProperty class A { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.ni.txt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.ni.txt new file mode 100644 index 00000000000..cfd09a74728 --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/noExpectedTypeForSupertypeConstraint.ni.txt @@ -0,0 +1,18 @@ +package + +public final class A { + public constructor A() + public final var a: kotlin.Nothing + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class MyProperty { + public constructor MyProperty() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final operator fun getValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final operator fun setValue(/*0*/ thisRef: R, /*1*/ desc: kotlin.reflect.KProperty<*>, /*2*/ t: T): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt index 9237aff75d0..cd444a26355 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER +// NI_EXPECTED_FILE import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.ni.txt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.ni.txt new file mode 100644 index 00000000000..8954c72da71 --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.ni.txt @@ -0,0 +1,18 @@ +package + +public final class B { + public constructor B() + public final val c: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Delegate { + public constructor Delegate(/*0*/ init: T) + public final val init: T + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final operator fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt index 41e4392d738..d2fc415c51e 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER +// NI_EXPECTED_FILE import kotlin.reflect.KProperty diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.ni.txt b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.ni.txt new file mode 100644 index 00000000000..cb65f7f9106 --- /dev/null +++ b/compiler/testData/diagnostics/tests/delegatedProperty/recursiveType.ni.txt @@ -0,0 +1,14 @@ +package + +public val a: kotlin.Any? +public val b: kotlin.Int +public val c: [ERROR : Type from delegate] +public val d: kotlin.Any? + +public final class Delegate { + public constructor Delegate(/*0*/ i: kotlin.Int) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final operator fun getValue(/*0*/ t: kotlin.Any?, /*1*/ p: kotlin.reflect.KProperty<*>): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/enum/commonSupertype.kt b/compiler/testData/diagnostics/tests/enum/commonSupertype.kt index 3719b7e97cc..31bda9beea4 100644 --- a/compiler/testData/diagnostics/tests/enum/commonSupertype.kt +++ b/compiler/testData/diagnostics/tests/enum/commonSupertype.kt @@ -1,4 +1,5 @@ // KT-5943 StackOverflowError from commonSupertype of two enums +// NI_EXPECTED_FILE enum class A { A } enum class B { B } diff --git a/compiler/testData/diagnostics/tests/enum/commonSupertype.ni.txt b/compiler/testData/diagnostics/tests/enum/commonSupertype.ni.txt new file mode 100644 index 00000000000..9d70472961f --- /dev/null +++ b/compiler/testData/diagnostics/tests/enum/commonSupertype.ni.txt @@ -0,0 +1,41 @@ +package + +public val x: kotlin.Enum>>>>> + +public final enum class A : kotlin.Enum { + enum entry A + + private constructor A() + public final override /*1*/ /*fake_override*/ val name: kotlin.String + public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int + protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: A): kotlin.Int + public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit + public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class! + public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + // Static members + public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): A + public final /*synthesized*/ fun values(): kotlin.Array +} + +public final enum class B : kotlin.Enum { + enum entry B + + private constructor B() + public final override /*1*/ /*fake_override*/ val name: kotlin.String + public final override /*1*/ /*fake_override*/ val ordinal: kotlin.Int + protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: B): kotlin.Int + public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + protected/*protected and package*/ final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun finalize(): kotlin.Unit + public final override /*1*/ /*fake_override*/ /*isHiddenForResolutionEverywhereBesideSupercalls*/ fun getDeclaringClass(): java.lang.Class! + public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + // Static members + public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): B + public final /*synthesized*/ fun values(): kotlin.Array +} diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt index 8af214c3061..fc388387eef 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE val flag = true // type of a was checked by txt diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.ni.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.ni.txt new file mode 100644 index 00000000000..a6d8b21e9ee --- /dev/null +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/LocalReturnUnitAndDontCareType.ni.txt @@ -0,0 +1,6 @@ +package + +public val a: kotlin.Unit +public val b: kotlin.Unit +public val c: kotlin.Any +public val flag: kotlin.Boolean = true diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt index 13828c53c60..40da50eef87 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE // KT-6822 Smart cast doesn't work inside local returned expression in lambda val a /* :(Int?) -> Int? */ = l@ { it: Int? -> // but must be (Int?) -> Int diff --git a/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.ni.txt b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.ni.txt new file mode 100644 index 00000000000..cd971ce1121 --- /dev/null +++ b/compiler/testData/diagnostics/tests/functionLiterals/return/SmartCast.ni.txt @@ -0,0 +1,6 @@ +package + +public val a: (kotlin.Int?) -> kotlin.Int? +public val b: kotlin.Int +public val c: kotlin.Int +public fun let(/*0*/ f: (kotlin.Int?) -> R): R diff --git a/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt b/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt index 7183754ea85..7a71dcf7276 100644 --- a/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt +++ b/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !CHECK_TYPE +// NI_EXPECTED_FILE private class Outer { private inner class Inner { private fun foo() = { diff --git a/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.ni.txt b/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.ni.txt new file mode 100644 index 00000000000..420a908ca0f --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/capturedParameters/innerLocalClass.ni.txt @@ -0,0 +1,22 @@ +package + +public fun magic(): T + +private final class Outer { + public constructor Outer() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + private final inner class Inner /*captured type parameters: /*1*/ E*/ { + public constructor Inner() + private final var doubleCharSequenceInt: Outer.Inner.foo..baz..Local + private final var doubleStringInt: Outer.Inner.foo..baz..Local + private final var doubleStringNumber: Outer.Inner.foo..baz..Local + private final fun bar(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + private final fun foo(): () -> Outer.Inner.foo..baz..Local + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt index bd96b300d41..4108d6dc3e6 100644 --- a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt +++ b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + interface In class En : In diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.ni.txt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.ni.txt new file mode 100644 index 00000000000..4dddbe14b5e --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.ni.txt @@ -0,0 +1,24 @@ +package + +public fun foobar(/*0*/ e: En<*>): In +public fun select(/*0*/ x: T, /*1*/ y: T): T + +public final class A : In { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class En : In { + public constructor En() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface In { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt index 27abc740e87..89a3999ae58 100644 --- a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt +++ b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + interface In class A : In class B : In diff --git a/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.ni.txt b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.ni.txt new file mode 100644 index 00000000000..c17bb395715 --- /dev/null +++ b/compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.ni.txt @@ -0,0 +1,24 @@ +package + +public fun foobar(/*0*/ a: A, /*1*/ b: B): In? +public fun select(/*0*/ x: T, /*1*/ y: T): T? + +public final class A : In { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B : In { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface In { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/implicitIntersection.kt b/compiler/testData/diagnostics/tests/implicitIntersection.kt index a384839b6d7..590eef5ab5b 100644 --- a/compiler/testData/diagnostics/tests/implicitIntersection.kt +++ b/compiler/testData/diagnostics/tests/implicitIntersection.kt @@ -1,5 +1,7 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE // See KT-10244: no intersection types in signatures + open class B interface A interface C diff --git a/compiler/testData/diagnostics/tests/implicitIntersection.ni.txt b/compiler/testData/diagnostics/tests/implicitIntersection.ni.txt new file mode 100644 index 00000000000..c28772eb4f5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/implicitIntersection.ni.txt @@ -0,0 +1,34 @@ +package + +public fun bar(/*0*/ b: B): kotlin.String +public fun foo(/*0*/ b: B): kotlin.Any? +public fun gav(/*0*/ b: B): A? + +public interface A { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class B { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface C { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class My { + public constructor My(/*0*/ b: B) + public final val x: kotlin.Any? + public final val y: C? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun foo(/*0*/ b: B): kotlin.Any? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt b/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt index 6a5e9260584..5bb27f4d68c 100644 --- a/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt +++ b/compiler/testData/diagnostics/tests/implicitNestedIntersection.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER +// NI_EXPECTED_FILE interface In open class A : In diff --git a/compiler/testData/diagnostics/tests/implicitNestedIntersection.ni.txt b/compiler/testData/diagnostics/tests/implicitNestedIntersection.ni.txt new file mode 100644 index 00000000000..ea7efe24486 --- /dev/null +++ b/compiler/testData/diagnostics/tests/implicitNestedIntersection.ni.txt @@ -0,0 +1,24 @@ +package + +public fun foo2(): In +public fun select(/*0*/ x: T, /*1*/ y: T): T + +public open class A : In { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class B : In { + public constructor B() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface In { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt index f01e2a987e7..8de287264d8 100644 --- a/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt +++ b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE fun foo(f: (Y) -> Z, g: (X) -> Y, x: X): Z = f(g(x)) // TODO: Actually, this is a bug and will work when new inference is enabled diff --git a/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.ni.txt b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.ni.txt new file mode 100644 index 00000000000..1f7b6d00801 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/fixationOrderForProperConstraints.ni.txt @@ -0,0 +1,4 @@ +package + +public fun foo(/*0*/ f: (Y) -> Z, /*1*/ g: (X) -> Y, /*2*/ x: X): Z +public fun test(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/inner/innerThisSuper.kt b/compiler/testData/diagnostics/tests/inner/innerThisSuper.kt index f2c88339197..8bfaab8ddbe 100644 --- a/compiler/testData/diagnostics/tests/inner/innerThisSuper.kt +++ b/compiler/testData/diagnostics/tests/inner/innerThisSuper.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + interface Trait { fun bar() = 42 } diff --git a/compiler/testData/diagnostics/tests/inner/innerThisSuper.ni.txt b/compiler/testData/diagnostics/tests/inner/innerThisSuper.ni.txt new file mode 100644 index 00000000000..7e9b5cea405 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inner/innerThisSuper.ni.txt @@ -0,0 +1,43 @@ +package + +public final class Outer : Trait { + public constructor Outer() + public open override /*1*/ /*fake_override*/ fun bar(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class Inner { + public constructor Inner() + public final val s: kotlin.Int + public final val t: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class Nested { + public constructor Nested() + public final val s: kotlin.Any? + public final val t: kotlin.Any? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class NestedInner { + public constructor NestedInner() + public final val s: kotlin.Any? + public final val t: kotlin.Any? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} + +public interface Trait { + public open fun bar(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.kt b/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.kt index bdcd973cbe5..77c20ac8e9a 100644 --- a/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.kt +++ b/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + class Outer { fun function() = 42 val property = "" diff --git a/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.ni.txt b/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.ni.txt new file mode 100644 index 00000000000..5ef8f1d81a4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inner/nestedVsInnerAccessOuterMember.ni.txt @@ -0,0 +1,43 @@ +package + +public final class Outer { + public constructor Outer() + public final val property: kotlin.String = "" + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun function(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class Inner { + public constructor Inner() + public final val innerProp: kotlin.String = "" + public final val innerThisProp: kotlin.String = "" + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun innerFun(): kotlin.Int + public final fun innerThisFun(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class InnerInner { + public constructor InnerInner() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun f(): kotlin.Int + public final fun g(): kotlin.String + public final fun h(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun i(): kotlin.String + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + + public final class Nested { + public constructor Nested() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun f(): [ERROR : Error function type] + public final fun g(): [ERROR : Error function type] + public final fun h(): kotlin.Any? + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public final fun i(): [ERROR : ] + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt index 178b3cd3473..f68063bc7c3 100644 --- a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE class Outer { class Nested } diff --git a/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.ni.txt b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.ni.txt new file mode 100644 index 00000000000..407fc3d2c41 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inner/qualifiedExpression/genericNestedClass.ni.txt @@ -0,0 +1,20 @@ +package + +public fun manyArguments(): Outer.Nested +public fun nested(): Outer.Nested +public fun noArguments(): Outer.Nested +public fun noArgumentsExpectedType(): Outer.Nested + +public final class Outer { + public constructor Outer() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class Nested { + public constructor Nested() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/kt13401.kt b/compiler/testData/diagnostics/tests/kt13401.kt index a04d73a0f3f..3989d8d1d37 100644 --- a/compiler/testData/diagnostics/tests/kt13401.kt +++ b/compiler/testData/diagnostics/tests/kt13401.kt @@ -1,5 +1,7 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE // See KT-13401: SOE in VarianceChecker + interface Rec> { fun t(): T } diff --git a/compiler/testData/diagnostics/tests/kt13401.ni.txt b/compiler/testData/diagnostics/tests/kt13401.ni.txt new file mode 100644 index 00000000000..0d16cd16c1c --- /dev/null +++ b/compiler/testData/diagnostics/tests/kt13401.ni.txt @@ -0,0 +1,32 @@ +package + +public final class Owner { + public constructor Owner() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun foo(/*0*/ arg: Owner.Inner<*>): T + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class Inner /*captured type parameters: /*1*/ in T*/ { + public constructor Inner(/*0*/ u: U) + public final val u: U + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun getT(): U + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +public interface Rec> { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract fun t(): T + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Super { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open fun foo(/*0*/ p: Rec<*>): Rec>>>> + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsLocal.kt b/compiler/testData/diagnostics/tests/objects/ObjectsLocal.kt index 47841bf069e..03f875e7bf2 100644 --- a/compiler/testData/diagnostics/tests/objects/ObjectsLocal.kt +++ b/compiler/testData/diagnostics/tests/objects/ObjectsLocal.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + package localObjects object A { diff --git a/compiler/testData/diagnostics/tests/objects/ObjectsLocal.ni.txt b/compiler/testData/diagnostics/tests/objects/ObjectsLocal.ni.txt new file mode 100644 index 00000000000..14150d08944 --- /dev/null +++ b/compiler/testData/diagnostics/tests/objects/ObjectsLocal.ni.txt @@ -0,0 +1,22 @@ +package + +package localObjects { + public val bb: kotlin.Any? + public fun test(): kotlin.Unit + + public object A { + private constructor A() + public final val x: kotlin.Int = 0 + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public open class Foo { + public constructor Foo() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public final fun foo(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt index 999fc892fe6..a872501ef6b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.kt @@ -2,6 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE // JAVAC_SKIP +// NI_EXPECTED_FILE // FILE: p/J.java package p; diff --git a/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.ni.txt b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.ni.txt new file mode 100644 index 00000000000..0142dd2c3dd --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/commonSupertype/withNothing.ni.txt @@ -0,0 +1,24 @@ +package + +public fun f(/*0*/ a: Out, /*1*/ b: Out, /*2*/ c: Out): T +public fun out(/*0*/ t: T): Out> +public fun test(/*0*/ a: Out, /*1*/ b: Out>): kotlin.Unit + +public interface Out { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +package p { + + public open class J { + public constructor J() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + // Static members + public open fun j(): p.J! + } +} diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt index 1cd14e50c42..3e25e40f530 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE val x get() = foo() val y get() = bar() diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.ni.txt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.ni.txt new file mode 100644 index 00000000000..cc71a5d3a8d --- /dev/null +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/cantBeInferred.ni.txt @@ -0,0 +1,6 @@ +package + +public val x: kotlin.Nothing +public val y: kotlin.collections.List +public fun bar(): kotlin.collections.List +public fun foo(): E diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt index a54d8c794c3..632b8a87ad9 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !CHECK_TYPE +// NI_EXPECTED_FILE val x get() = x diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.ni.txt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.ni.txt new file mode 100644 index 00000000000..ed4126242a5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/recursiveGetter.ni.txt @@ -0,0 +1,18 @@ +package + +public val x: [ERROR : Error function type] +public fun id(/*0*/ x: E): E +public fun l(/*0*/ x: E): kotlin.collections.List + +public final class A { + public constructor A() + public final val a: [ERROR : Error function type] + public final val b: [ERROR : Error function type] + public final val u: [ERROR : Error function type] + public final val y: [ERROR : Error function type] + public final val z1: kotlin.Nothing + public final val z2: kotlin.collections.List + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt index a32bc54fe4f..2839cfffea9 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !LANGUAGE: -ShortSyntaxForPropertyGetters +// NI_EXPECTED_FILE // blockBodyGetter.kt val x get() { diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.ni.txt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.ni.txt new file mode 100644 index 00000000000..5c6b388fc09 --- /dev/null +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/unsupportedInferenceFromGetters.ni.txt @@ -0,0 +1,38 @@ +package + +public val u: kotlin.String +public val x: [ERROR : No type, no body] +public val x1: kotlin.Nothing +public val x2: kotlin.String +public var x3: kotlin.Int +public val x4: [ERROR : Error function type] +public val x5: kotlin.Nothing? +public val y1: kotlin.collections.List +public val y2: kotlin.collections.List +public val y5: kotlin.Nothing +public val z2: kotlin.collections.List +public fun bar(): kotlin.collections.List +public fun foo(): E +public fun id(/*0*/ x: E): E +public fun l(/*0*/ x: E): kotlin.collections.List + +public final class A { + public constructor A() + public final val x: kotlin.Int + public final val y: kotlin.Int + public final val y2: kotlin.Int + public final val z: kotlin.collections.List + public final val z2: kotlin.collections.List> + public final val T.u: T + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public object Outer { + private constructor Outer() + private final var x: Outer.. + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt index 45a670c731e..407f6d15059 100644 --- a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.kt @@ -1 +1,3 @@ +// NI_EXPECTED_FILE + val unwrapped = some.<cabc$WrapperAny>::unwrap \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.ni.txt b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.ni.txt new file mode 100644 index 00000000000..6903f370368 --- /dev/null +++ b/compiler/testData/diagnostics/tests/qualifiedExpression/nullCalleeExpression.ni.txt @@ -0,0 +1,3 @@ +package + +public val unwrapped: kotlin.Any? diff --git a/compiler/testData/diagnostics/tests/regressions/Jet81.kt b/compiler/testData/diagnostics/tests/regressions/Jet81.kt index fdefbec0963..7e127490b1d 100644 --- a/compiler/testData/diagnostics/tests/regressions/Jet81.kt +++ b/compiler/testData/diagnostics/tests/regressions/Jet81.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE // JET-81 Assertion fails when processing self-referring anonymous objects class Test { diff --git a/compiler/testData/diagnostics/tests/regressions/Jet81.ni.txt b/compiler/testData/diagnostics/tests/regressions/Jet81.ni.txt new file mode 100644 index 00000000000..37a6eb2432f --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/Jet81.ni.txt @@ -0,0 +1,28 @@ +package + +public object A { + private constructor A() + public final val x: A + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Test { + public constructor Test() + private final val y: Test.y. + public final val z: [ERROR : Type for y] + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Test2 { + public constructor Test2() + private final val a: Test2.a. + public final val b: [ERROR : Type for a.x] + public final val c: kotlin.Int = 1 + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/regressions/kt10843.kt b/compiler/testData/diagnostics/tests/regressions/kt10843.kt index 9c13196cef7..a3968e8f13c 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10843.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10843.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE // See EA-76890 / KT-10843: NPE during analysis fun lambda(x : Int?) = x?.let l { y -> diff --git a/compiler/testData/diagnostics/tests/regressions/kt10843.ni.txt b/compiler/testData/diagnostics/tests/regressions/kt10843.ni.txt new file mode 100644 index 00000000000..7a788993116 --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/kt10843.ni.txt @@ -0,0 +1,3 @@ +package + +public fun lambda(/*0*/ x: kotlin.Int?): [ERROR : Error function type] diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt index 910df4bddb2..5bb908ef917 100644 --- a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE @DslMarker @Target(AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS) annotation class XMarker diff --git a/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.ni.txt b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.ni.txt new file mode 100644 index 00000000000..85b84edc4ff --- /dev/null +++ b/compiler/testData/diagnostics/tests/resolve/dslMarker/dslMarkerWithTypealiasRecursion.ni.txt @@ -0,0 +1,28 @@ +package + +public fun test(): kotlin.Unit +public fun Foo.foo(/*0*/ body: Foo.() -> kotlin.Unit): kotlin.Unit +public fun Foo.zbar(/*0*/ body: [ERROR : Recursive type alias: ZBar].() -> kotlin.Unit): kotlin.Unit + +public final class Bar { + public constructor Bar() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@XMarker public final class Foo { + public constructor Foo() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@kotlin.DslMarker @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.TYPEALIAS}) public final annotation class XMarker : kotlin.Annotation { + public constructor XMarker() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias YBar = ZBar +public typealias ZBar = YBar diff --git a/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt b/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt index f1e1252878c..ff518275169 100644 --- a/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt +++ b/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + package i val List.length = size diff --git a/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.ni.txt b/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.ni.txt new file mode 100644 index 00000000000..3ad4ff95d90 --- /dev/null +++ b/compiler/testData/diagnostics/tests/scopes/initializerScopeOfExtensionProperty.ni.txt @@ -0,0 +1,35 @@ +package + +package i { + public val i.C.bar: i.C.D + public val kotlin.String.bd: kotlin.Any? + public val kotlin.String.bd1: kotlin.String + public val i.A.foo: [ERROR : Type for ii] + public val i.C.foo: i.C.D + public val i.A.foo1: kotlin.Int + public val i.C.foo1: i.C.D + public val kotlin.collections.List.length: [ERROR : Type for size] + public val kotlin.collections.List.length1: kotlin.Int + + public final class A { + public constructor A() + public final val ii: kotlin.Int = 1 + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class C { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class D { + public constructor D() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } +} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt index b21b73351c6..7fe9f3471ea 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER +// NI_EXPECTED_FILE class A(x: Int) { constructor(x: Double): this(1) constructor(x: String): this(1) diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.ni.txt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.ni.txt new file mode 100644 index 00000000000..01b8fad31a2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.ni.txt @@ -0,0 +1,32 @@ +package + +public val x1: A +public val x2: A +public val x3: A +public val y1: B +public val y10: B +public val y2: B +public val y3: B +public val y4: B +public val y5: B +public val y6: B +public val y7: B +public val y8: B +public val y9: B + +public final class A { + public constructor A(/*0*/ x: kotlin.Double) + public constructor A(/*0*/ x: kotlin.Int) + public constructor A(/*0*/ x: kotlin.String) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class B { + public constructor B(/*0*/ x: R) + public constructor B(/*0*/ x: kotlin.String) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt index 5792a3f89a0..e4efe818d83 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -NOTHING_TO_INLINE +// NI_EXPECTED_FILE inline fun foo(t1: T, t2: T) = t1 ?: t2 diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.ni.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.ni.txt new file mode 100644 index 00000000000..ac27408f189 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgument.ni.txt @@ -0,0 +1,5 @@ +package + +public inline fun bar(/*0*/ l: (T) -> kotlin.Unit): T +public inline fun foo(/*0*/ t1: T, /*1*/ t2: T): T? +public fun use(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt index 0cbe4c4629b..fd177fa4bf1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -NOTHING_TO_INLINE +// NI_EXPECTED_FILE // See KT-9143: smart cast on a variable nulled inside a lambda argument inline fun foo(t1: T, t2: T) = t1 ?: t2 diff --git a/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.ni.txt b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.ni.txt new file mode 100644 index 00000000000..ac27408f189 --- /dev/null +++ b/compiler/testData/diagnostics/tests/smartCasts/lambdaAndArgumentFun.ni.txt @@ -0,0 +1,5 @@ +package + +public inline fun bar(/*0*/ l: (T) -> kotlin.Unit): T +public inline fun foo(/*0*/ t1: T, /*1*/ t2: T): T? +public fun use(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt index dae4b896e1e..76f6efb62fb 100644 --- a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class Outer { inner class Inner } diff --git a/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.ni.txt b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.ni.txt new file mode 100644 index 00000000000..abba77acd53 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/innerClassTypeAliasConstructor.ni.txt @@ -0,0 +1,39 @@ +package + +public fun test1(/*0*/ x: Outer): OI /* = Outer.Inner */ +public fun test2(/*0*/ x: Generic): GI /* = Generic.Inner */ +public fun test3(/*0*/ x: Generic): GI /* = Generic.Inner */ +public fun test4(/*0*/ x: Generic>): GI> /* = Generic>.Inner */ +public fun test5(/*0*/ x: Generic): [ERROR : Error function type] +public fun Generic.test6(): GIntI /* = Generic.Inner */ + +public final class Generic { + public constructor Generic() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class Inner /*captured type parameters: /*0*/ T*/ { + public constructor Inner() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + +public final class Outer { + public constructor Outer() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final inner class Inner { + public constructor Inner() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} +public typealias GI = Generic.Inner +public typealias GIntI = Generic.Inner +public typealias OI = Outer.Inner diff --git a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt index 504db72c274..527769a6374 100644 --- a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + typealias Array2D = Array> fun foo1(a: Array2D) = a diff --git a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.ni.txt b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.ni.txt new file mode 100644 index 00000000000..43169ed78e6 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.ni.txt @@ -0,0 +1,8 @@ +package + +public fun bar1(/*0*/ a: Array2D /* = kotlin.Array> */): Array2D /* = kotlin.Array> */ +public fun bar2(/*0*/ m: TMap<*> /* = kotlin.collections.Map<*, *> */): kotlin.collections.Map +public fun foo1(/*0*/ a: Array2D /* = kotlin.Array> */): Array2D /* = kotlin.Array> */ +public fun foo2(/*0*/ m: TMap /* = kotlin.collections.Map */): TMap /* = kotlin.collections.Map */ +public typealias Array2D = kotlin.Array> +public typealias TMap = kotlin.collections.Map diff --git a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt index 3bb8e0dfc19..288770ee2b3 100644 --- a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt +++ b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt @@ -1,3 +1,5 @@ +// NI_EXPECTED_FILE + class In class Out class Inv diff --git a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.ni.txt b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.ni.txt new file mode 100644 index 00000000000..a8f13f4fdfc --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.ni.txt @@ -0,0 +1,72 @@ +package + +public val inv1: Inv1 /* = Inv */ +public fun inIn_In(/*0*/ x: In2 /* = In */): In2 /* = In */ +public fun inIn_Inv(/*0*/ x: In2 /* = In */): In2 /* = In */ +public fun inIn_Out(/*0*/ x: In2 /* = In */): [ERROR : Inconsistent type: In (0 parameter has declared variance: in, but argument variance is out)] +public fun inIn_Star(/*0*/ x: In2<*> /* = In<*> */): In2<*> /* = In<*> */ +public fun inInv_In(/*0*/ x: In1 /* = In */): In1 /* = In */ +public fun inInv_Inv(/*0*/ x: In1 /* = In */): In1 /* = In */ +public fun inInv_Out(/*0*/ x: In1 /* = In */): [ERROR : Inconsistent type: In (0 parameter has declared variance: in, but argument variance is out)] +public fun inInv_Star(/*0*/ x: In1<*> /* = In<*> */): In1<*> /* = In<*> */ +public fun inOut_In(/*0*/ x: In3 /* = In */): In3 /* = In */ +public fun inOut_Inv(/*0*/ x: In3 /* = In */): [ERROR : Inconsistent type: In (0 parameter has declared variance: in, but argument variance is out)] +public fun inOut_Out(/*0*/ x: In3 /* = In */): [ERROR : Inconsistent type: In (0 parameter has declared variance: in, but argument variance is out)] +public fun inOut_Star(/*0*/ x: In3<*> /* = In<*> */): In3<*> /* = In<*> */ +public fun invIn_In(/*0*/ x: Inv2 /* = Inv */): Inv2 /* = Inv */ +public fun invIn_Inv(/*0*/ x: Inv2 /* = Inv */): Inv2 /* = Inv */ +public fun invIn_Out(/*0*/ x: Inv2 /* = Inv */): Inv2 /* = Inv */ +public fun invIn_Star(/*0*/ x: Inv2<*> /* = Inv<*> */): Inv2<*> /* = Inv<*> */ +public fun invInv_In(/*0*/ x: Inv1 /* = Inv */): Inv1 /* = Inv */ +public fun invInv_Inv(/*0*/ x: Inv1 /* = Inv */): Inv1 /* = Inv */ +public fun invInv_Out(/*0*/ x: Inv1 /* = Inv */): Inv1 /* = Inv */ +public fun invInv_Star(/*0*/ x: Inv1<*> /* = Inv<*> */): Inv1<*> /* = Inv<*> */ +public fun invOut_In(/*0*/ x: Inv3 /* = Inv */): Inv3 /* = Inv */ +public fun invOut_Inv(/*0*/ x: Inv3 /* = Inv */): Inv3 /* = Inv */ +public fun invOut_Out(/*0*/ x: Inv3 /* = Inv */): Inv3 /* = Inv */ +public fun invOut_Star(/*0*/ x: Inv3<*> /* = Inv<*> */): Inv3<*> /* = Inv<*> */ +public fun outIn_In(/*0*/ x: Out2 /* = Out */): [ERROR : Inconsistent type: Out (0 parameter has declared variance: out, but argument variance is in)] +public fun outIn_Inv(/*0*/ x: Out2 /* = Out */): [ERROR : Inconsistent type: Out (0 parameter has declared variance: out, but argument variance is in)] +public fun outIn_Out(/*0*/ x: Out2 /* = Out */): Out2 /* = Out */ +public fun outIn_Star(/*0*/ x: Out2<*> /* = Out<*> */): Out2<*> /* = Out<*> */ +public fun outInv_In(/*0*/ x: Out1 /* = Out */): [ERROR : Inconsistent type: Out (0 parameter has declared variance: out, but argument variance is in)] +public fun outInv_Inv(/*0*/ x: Out1 /* = Out */): Out1 /* = Out */ +public fun outInv_Out(/*0*/ x: Out1 /* = Out */): Out1 /* = Out */ +public fun outInv_Star(/*0*/ x: Out1<*> /* = Out<*> */): Out1<*> /* = Out<*> */ +public fun outOut_In(/*0*/ x: Out3 /* = Out */): [ERROR : Inconsistent type: Out (0 parameter has declared variance: out, but argument variance is in)] +public fun outOut_Inv(/*0*/ x: Out3 /* = Out */): Out3 /* = Out */ +public fun outOut_Out(/*0*/ x: Out3 /* = Out */): Out3 /* = Out */ +public fun outOut_Star(/*0*/ x: Out3<*> /* = Out<*> */): Out3<*> /* = Out<*> */ + +public final class In { + public constructor In() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Inv { + public constructor Inv() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Out { + public constructor Out() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias In1 = In +public typealias In2 = In +public typealias In3 = In +public typealias In4 = In<*> +public typealias Inv1 = Inv +public typealias Inv2 = Inv +public typealias Inv3 = Inv +public typealias Inv4 = Inv<*> +public typealias Out1 = Out +public typealias Out2 = Out +public typealias Out3 = Out +public typealias Out4 = Out<*> diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.kt index b8872860e74..6df08f13456 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -TOPLEVEL_TYPEALIASES_ONLY +// NI_EXPECTED_FILE class C { typealias Self = C diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.ni.txt new file mode 100644 index 00000000000..ffaeb7635c7 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasAsQualifier.ni.txt @@ -0,0 +1,46 @@ +package + +public val c: [ERROR : Type for C.Self.Self()] +public val ic: [ERROR : Type for C.Self.InCompanion()] +public val n: [ERROR : Type for C.Self.Nested()] +public val n2: kotlin.Any? +public val ok: kotlin.String = "OK" +public val x: [ERROR : Type for C.Self.X] + +public final class C { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class Nested { + public constructor Nested() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class N2 { + public constructor N2() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + public typealias Root = C + } + + public companion object X { + private constructor X() + public final val ok: kotlin.String = "OK" + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class InCompanion { + public constructor InCompanion() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + public typealias Self = C +} diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt index 12622e13209..fd3e6ec9b20 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class Bound(val x: X, val y: Y) typealias B = Bound typealias BOutIn = Bound, in T> diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.ni.txt new file mode 100644 index 00000000000..3c3f23c2efd --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorCrazyProjections.ni.txt @@ -0,0 +1,17 @@ +package + +public val test1: [ERROR : Type for BOutIn(listOf(), null!!)] +public val test2: BInIn /* = Bound, in kotlin.Any?> */ +public fun listOf(): kotlin.collections.List + +public final class Bound { + public constructor Bound(/*0*/ x: X, /*1*/ y: Y) + public final val x: X + public final val y: Y + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias B = Bound +public typealias BInIn = Bound, in T> +public typealias BOutIn = Bound, in T> diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt index 2127282891a..583629c8e44 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class C typealias CStar = C<*> diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.ni.txt new file mode 100644 index 00000000000..3ca55320c25 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorForProjection.ni.txt @@ -0,0 +1,18 @@ +package + +public val test1: CStar /* = C<*> */ +public val test2: CIn /* = C */ +public val test3: COut /* = C */ +public val test4: CT /* = C */ +public val test5: CT /* = C<*> */> /* = C /* = C<*> */> */ + +public final class C { + public constructor C() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias CIn = C +public typealias COut = C +public typealias CStar = C<*> +public typealias CT = C diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt index db5c64b5d88..33c59d94497 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class Num(val x: Tn) typealias N = Num diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.ni.txt new file mode 100644 index 00000000000..c7ba8b2d91e --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.ni.txt @@ -0,0 +1,52 @@ +package + +public val test0: N /* = Num */ +public val test1: N /* = Num */ +public val test2: C /* = Cons */ +public val test3: CC /* = Cons> */ +public val test4: CC /* = Cons> */ +public val test5: PL /* = Pair> */ +public fun testProjections1(/*0*/ x: Pair): Foo +public fun testProjections2(/*0*/ x: Pair): Foo +public fun testProjections3(/*0*/ x: Pair): Foo +public fun testProjections4(/*0*/ x: Pair): Foo + +public final class Cons { + public constructor Cons(/*0*/ head: T, /*1*/ tail: Cons?) + public final val head: T + public final val tail: Cons? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Foo { + public constructor Foo(/*0*/ p: Pair) + public final val p: Pair + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Num { + public constructor Num(/*0*/ x: Tn) + public final val x: Tn + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Pair { + public constructor Pair(/*0*/ x: X, /*1*/ y: Y) + public final val x: X + public final val y: Y + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias C = Cons +public typealias CC = C> +public typealias F = Foo +public typealias N = Num +public typealias PL = Pair> +public typealias PN = Pair> diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt index 973ce7ce1b8..0edbeb9e1d1 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class Cons(val head: T, val tail: Cons?) typealias C = Cons diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.ni.txt new file mode 100644 index 00000000000..a689b373ca5 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls.ni.txt @@ -0,0 +1,14 @@ +package + +public val test1: C /* = Cons */ +public val test2: Cons + +public final class Cons { + public constructor Cons(/*0*/ head: T, /*1*/ tail: Cons?) + public final val head: T + public final val tail: Cons? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias C = Cons diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt index 1ebe6cedc58..d18d7e9772b 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + interface Ref { var x: T } diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.ni.txt new file mode 100644 index 00000000000..ca051a6f373 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithNestedCalls2.ni.txt @@ -0,0 +1,28 @@ +package + +public val r1: LateInitNumRef +public val r1a: LateNR /* = LateInitNumRef */ +public val r2: LateInitNumRef +public val r2a: LateNR /* = LateInitNumRef */ +public val r3: LateInitNumRef +public val r3a: LateNR /* = LateInitNumRef */ +public fun test(): kotlin.Unit +public fun > update(/*0*/ r: R, /*1*/ v: V): R + +public final class LateInitNumRef : Ref { + public constructor LateInitNumRef() + public constructor LateInitNumRef(/*0*/ x: NN) + public open override /*1*/ var x: NN + private final var xx: NN? + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Ref { + public abstract var x: T + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias LateNR = LateInitNumRef diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt index bbeca5a7967..8f234c87673 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class Foo class Bar diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.ni.txt new file mode 100644 index 00000000000..b33d567e5f0 --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInferenceWithPhantomTypes.ni.txt @@ -0,0 +1,30 @@ +package + +public val test1: Test /* = Hr, Bar> */ +public val test2: Test /* = Hr, Bar> */ +public val test3: Bas /* = Hr, Bar> */ + +public final class Bar { + public constructor Bar() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Foo { + public constructor Foo() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Hr { + public constructor Hr(/*0*/ a: A, /*1*/ b: B) + public final val a: A + public final val b: B + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias Bas = Hr, Bar> +public typealias Test = Hr, Bar> diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt index 6e0332ce39e..175dd129a00 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + open class MyClass private constructor(val x: Int) { protected constructor(x: String) : this(x.length) diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.ni.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.ni.txt new file mode 100644 index 00000000000..a988147485d --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.ni.txt @@ -0,0 +1,33 @@ +package + +public val test1: MyAlias /* = MyClass */ +public val test1a: MyClass +public val test2: MyAlias /* = MyClass */ +public val test2a: MyClass +public val test3: MyAlias /* = MyClass */ +public val test3a: MyClass + +public open class MyClass { + public constructor MyClass(/*0*/ x: kotlin.Double) + private constructor MyClass(/*0*/ x: kotlin.Int) + protected constructor MyClass(/*0*/ x: kotlin.String) + public final val x: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class MyDerived : MyClass { + public constructor MyDerived() + public final val test4: [ERROR : Type for MyAlias(1)] + public final val test4a: [ERROR : Type for MyClass(1)] + public final val test5: MyAlias /* = MyClass */ + public final val test5a: MyClass + public final val test6: MyAlias /* = MyClass */ + public final val test6a: MyClass + public final override /*1*/ /*fake_override*/ val x: kotlin.Int + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias MyAlias = MyClass diff --git a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt index 42e4c577b45..c173c0f9b57 100644 --- a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt +++ b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.kt @@ -1,4 +1,6 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + class Pair(val x1: T1, val x2: T2) typealias P = Pair diff --git a/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.ni.txt b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.ni.txt new file mode 100644 index 00000000000..98114f6f7bd --- /dev/null +++ b/compiler/testData/diagnostics/tests/typealias/wrongNumberOfArgumentsInTypeAliasConstructor.ni.txt @@ -0,0 +1,41 @@ +package + +public val test0: P /* = Pair */ +public val test0p2: P2 /* = Pair */ +public val test0p2a: Pair +public val test0pr: PR /* = Pair */ +public val test1: P /* = Pair */ +public val test1p2: P2 /* = Pair */ +public val test1pr: PR /* = Pair */ +public val test2: P /* = Pair */ +public val test2p2: P2 /* = Pair */ +public val test2pr: PR /* = Pair */ +public val test2pra: PR /* = Pair */ +public val test3: P /* = Pair */ +public val test3p2: P2 /* = Pair */ +public val test3pr: Pair +public val testN0: N /* = Num */ +public val testN1: N /* = Num */ +public val testN1a: N /* = Num */ +public val testN2: N /* = Num */ + +public final class Num { + public constructor Num(/*0*/ x: T) + public final val x: T + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Pair { + public constructor Pair(/*0*/ x1: T1, /*1*/ x2: T2) + public final val x1: T1 + public final val x2: T2 + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} +public typealias N = Num +public typealias P = Pair +public typealias P2 = Pair +public typealias PR = Pair diff --git a/compiler/testData/diagnostics/tests/when/kt10809.kt b/compiler/testData/diagnostics/tests/when/kt10809.kt index eb83085bc91..b75b572a899 100644 --- a/compiler/testData/diagnostics/tests/when/kt10809.kt +++ b/compiler/testData/diagnostics/tests/when/kt10809.kt @@ -1,5 +1,6 @@ // !WITH_NEW_INFERENCE // !DIAGNOSTICS: -UNUSED_PARAMETER -DEBUG_INFO_SMARTCAST +// NI_EXPECTED_FILE interface Data interface Item diff --git a/compiler/testData/diagnostics/tests/when/kt10809.ni.txt b/compiler/testData/diagnostics/tests/when/kt10809.ni.txt new file mode 100644 index 00000000000..fa72eb2877e --- /dev/null +++ b/compiler/testData/diagnostics/tests/when/kt10809.ni.txt @@ -0,0 +1,37 @@ +package + +public fun listOf(/*0*/ vararg items: T /*kotlin.Array*/): kotlin.collections.List +public fun test1(/*0*/ o: kotlin.Any): Data? +public fun test1x(/*0*/ o: kotlin.Any): Data? +public fun test2(): Data +public fun test2x(): Data +public fun test2y(): kotlin.Any +public fun test2z(): kotlin.Any + +public interface Data { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class FlagData : Data { + public constructor FlagData(/*0*/ value: kotlin.Boolean) + public final val value: kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Item { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class ListData : Data { + public constructor ListData(/*0*/ list: kotlin.collections.List) + public final val list: kotlin.collections.List + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt index 12c7315184b..51c460c3797 100644 --- a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt +++ b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.kt @@ -1,4 +1,5 @@ // !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE val test1 = when { true -> { { true } } else -> TODO() diff --git a/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.ni.txt b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.ni.txt new file mode 100644 index 00000000000..82d3ca908b2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/when/whenWithNothingAndLambdas.ni.txt @@ -0,0 +1,8 @@ +package + +public val test1: () -> kotlin.Boolean +public val test1a: () -> kotlin.Boolean +public val test2: () -> kotlin.Boolean +public val test2a: () -> kotlin.Boolean +public val test3: () -> kotlin.Boolean +public val test3a: () -> kotlin.Boolean