From d39d36b94c0354f325fe5b139f0bf00dc04f8db3 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Mon, 27 Jun 2016 14:44:36 +0300 Subject: [PATCH] Render unabbreviated part of type wrapped in common comments It's necessary for preserving DescriptorRenderer invariant, namely only valid code should be generated --- ...oundsViolationInDeepTypeAliasExpansion.txt | 8 +++---- .../boundsViolationInTypeAliasExpansion.txt | 16 ++++++------- .../typealias/conflictingProjections.txt | 4 ++-- .../typealias/genericTypeAliasObject.txt | 2 +- .../diagnostics/tests/typealias/import.txt | 6 ++--- .../tests/typealias/inSupertypesList.txt | 4 ++-- .../typealias/inheritedNestedTypeAlias.kt | 2 +- .../typealias/inheritedNestedTypeAlias.txt | 2 +- .../tests/typealias/isAsWithTypeAlias.txt | 4 ++-- .../diagnostics/tests/typealias/nested.txt | 8 +++---- .../nestedCapturingTypeParameters.txt | 8 +++---- .../tests/typealias/nestedSubstituted.txt | 2 +- ...ximationInTypeAliasArgumentSubstitution.kt | 2 +- ...imationInTypeAliasArgumentSubstitution.txt | 8 +++---- .../tests/typealias/parameterRestrictions.txt | 2 +- .../tests/typealias/parameterSubstitution.kt | 2 +- .../tests/typealias/parameterSubstitution.txt | 8 +++---- ...nTypeNothingShouldBeSpecifiedExplicitly.kt | 2 +- ...TypeNothingShouldBeSpecifiedExplicitly.txt | 6 ++--- .../tests/typealias/simpleTypeAlias.kt | 2 +- .../tests/typealias/simpleTypeAlias.txt | 8 +++---- .../starProjectionInTypeAliasArgument.txt | 4 ++-- .../tests/typealias/substitutionVariance.kt | 2 +- .../tests/typealias/substitutionVariance.txt | 2 +- .../typeAliasArgumentsInConstructor.txt | 2 +- .../tests/typealias/typeAliasConstructor.txt | 4 ++-- .../tests/typealias/typeAliasObject.txt | 4 ++-- .../compiledKotlin/typealias/Basic.txt | 24 +++++++++---------- .../compiledKotlin/typealias/Generic.txt | 12 +++++----- .../kotlin/renderer/DescriptorRendererImpl.kt | 2 +- 30 files changed, 81 insertions(+), 81 deletions(-) diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.txt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.txt index 0182f6c987c..92a9728bc87 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.txt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInDeepTypeAliasExpansion.txt @@ -6,10 +6,10 @@ public val test5: TColl> public val test7: TColl> public val test8: TColl> -public fun test1(/*0*/ x: TC2> [= TColl>]): kotlin.Unit -public fun test2(/*0*/ x: TC2> [= TColl>]): kotlin.Unit -public fun test3(/*0*/ x: TC2> [= TColl>]): kotlin.Unit -public fun test4(/*0*/ x: TC2> [= TColl>]): kotlin.Unit +public fun test1(/*0*/ x: TC2> /* = TColl> */): kotlin.Unit +public fun test2(/*0*/ x: TC2> /* = TColl> */): kotlin.Unit +public fun test3(/*0*/ x: TC2> /* = TColl> */): kotlin.Unit +public fun test4(/*0*/ x: TC2> /* = TColl> */): kotlin.Unit public final class TColl> { public constructor TColl>() diff --git a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.txt b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.txt index b3832314919..d2532a87819 100644 --- a/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.txt +++ b/compiler/testData/diagnostics/tests/typealias/boundsViolationInTypeAliasExpansion.txt @@ -11,14 +11,14 @@ public val test5: Num public val test6: Num public val test7: NumColl> public val test8: NumColl> -public fun test1(/*0*/ x: NA [= Num]): kotlin.Unit -public fun test10(/*0*/ x: TC> [= TColl>]): kotlin.Unit -public fun test11(/*0*/ x: TC> [= TColl>]): kotlin.Unit -public fun test12(/*0*/ x: TC> [= TColl>]): kotlin.Unit -public fun test2(/*0*/ x: NA [= Num]): kotlin.Unit -public fun test3(/*0*/ x: NL [= NumColl>]): kotlin.Unit -public fun test4(/*0*/ x: NL [= NumColl>]): kotlin.Unit -public fun test9(/*0*/ x: TC> [= TColl>]): kotlin.Unit +public fun test1(/*0*/ x: NA /* = Num */): kotlin.Unit +public fun test10(/*0*/ x: TC> /* = TColl> */): kotlin.Unit +public fun test11(/*0*/ x: TC> /* = TColl> */): kotlin.Unit +public fun test12(/*0*/ x: TC> /* = TColl> */): kotlin.Unit +public fun test2(/*0*/ x: NA /* = Num */): kotlin.Unit +public fun test3(/*0*/ x: NL /* = NumColl> */): kotlin.Unit +public fun test4(/*0*/ x: NL /* = NumColl> */): kotlin.Unit +public fun test9(/*0*/ x: TC> /* = TColl> */): kotlin.Unit public final class Num { public constructor Num() diff --git a/compiler/testData/diagnostics/tests/typealias/conflictingProjections.txt b/compiler/testData/diagnostics/tests/typealias/conflictingProjections.txt index 646157b019b..4ed25bbc357 100644 --- a/compiler/testData/diagnostics/tests/typealias/conflictingProjections.txt +++ b/compiler/testData/diagnostics/tests/typealias/conflictingProjections.txt @@ -6,8 +6,8 @@ public typealias TestInForOut = Out public typealias TestInForOutWithinAlias = OutAlias public typealias TestOutForIn = In public typealias TestOutForInWithinAlias = InAlias -public fun testInForOutWithinResolvedType(/*0*/ x: OutAlias [= Out]): kotlin.Unit -public fun testOutForInWithinResolvedType(/*0*/ x: InAlias [= In]): kotlin.Unit +public fun testInForOutWithinResolvedType(/*0*/ x: OutAlias /* = Out */): kotlin.Unit +public fun testOutForInWithinResolvedType(/*0*/ x: InAlias /* = In */): kotlin.Unit public interface In { public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/typealias/genericTypeAliasObject.txt b/compiler/testData/diagnostics/tests/typealias/genericTypeAliasObject.txt index 3f60329f87b..7f103c47e00 100644 --- a/compiler/testData/diagnostics/tests/typealias/genericTypeAliasObject.txt +++ b/compiler/testData/diagnostics/tests/typealias/genericTypeAliasObject.txt @@ -3,7 +3,7 @@ package public typealias GenericTestObject = AnObject public typealias TestGCWC = GenericClassWithCompanion public val test11: AnObject -public val test12: GenericTestObject<*> [= AnObject] +public val test12: GenericTestObject<*> /* = AnObject */ public val test13: kotlin.String = "OK" public val test14: kotlin.String public val test25: GenericClassWithCompanion.Companion diff --git a/compiler/testData/diagnostics/tests/typealias/import.txt b/compiler/testData/diagnostics/tests/typealias/import.txt index 1a889dbfad4..acb072c19a4 100644 --- a/compiler/testData/diagnostics/tests/typealias/import.txt +++ b/compiler/testData/diagnostics/tests/typealias/import.txt @@ -17,7 +17,7 @@ package package2 { } package package3 { - public val testA: package2.Outer.A [= kotlin.Any] - public val testI: package2.I [= kotlin.Int] = 42 - public val testS: package1.S [= kotlin.String] = "" + public val testA: package2.Outer.A /* = kotlin.Any */ + public val testI: package2.I /* = kotlin.Int */ = 42 + public val testS: package1.S /* = kotlin.String */ = "" } diff --git a/compiler/testData/diagnostics/tests/typealias/inSupertypesList.txt b/compiler/testData/diagnostics/tests/typealias/inSupertypesList.txt index d511347179f..245f7fbfc92 100644 --- a/compiler/testData/diagnostics/tests/typealias/inSupertypesList.txt +++ b/compiler/testData/diagnostics/tests/typealias/inSupertypesList.txt @@ -8,14 +8,14 @@ public interface IBase { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public final class Test1 : B [= IBase] { +public final class Test1 : B /* = IBase */ { public constructor Test1() 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 : IBase, B [= IBase] { +public final class Test2 : IBase, B /* = IBase */ { public constructor Test2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt index 25a5802e858..e0f1aae317d 100644 --- a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.kt @@ -17,4 +17,4 @@ class Derived : Base() { val test1: CT = Cell(42) val test2: Base.CT = Cell(42) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt index 2f82081dc3b..d155d1d2dec 100644 --- a/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt +++ b/compiler/testData/diagnostics/tests/typealias/inheritedNestedTypeAlias.txt @@ -27,7 +27,7 @@ public final class Cell : ICell { public final class Derived : Base { public constructor Derived() public final val test1: [ERROR : CT] - public final val test2: Base.CT [= Cell] + public final val test2: Base.CT /* = Cell */ public final val x1: [ERROR : InnerCell] public final val x2: Base.InnerCell public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean diff --git a/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.txt b/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.txt index 3ec3a2794ff..3c2e33cd6c7 100644 --- a/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.txt +++ b/compiler/testData/diagnostics/tests/typealias/isAsWithTypeAlias.txt @@ -2,5 +2,5 @@ package public typealias S = kotlin.String public fun test1(/*0*/ x: kotlin.Any): kotlin.Boolean -public fun test2(/*0*/ x: kotlin.Any): S [= kotlin.String] -public fun test3(/*0*/ x: kotlin.Any): S? [= kotlin.String?] +public fun test2(/*0*/ x: kotlin.Any): S /* = kotlin.String */ +public fun test3(/*0*/ x: kotlin.Any): S? /* = kotlin.String? */ diff --git a/compiler/testData/diagnostics/tests/typealias/nested.txt b/compiler/testData/diagnostics/tests/typealias/nested.txt index cceebed74f3..ca38892dcd4 100644 --- a/compiler/testData/diagnostics/tests/typealias/nested.txt +++ b/compiler/testData/diagnostics/tests/typealias/nested.txt @@ -3,17 +3,17 @@ package public val p1: Pair public val test1: kotlin.Int public val test2: kotlin.Int -public fun C.testExtFun1(/*0*/ x: C.P2 [= Pair]): C.P2 [= Pair] -public fun C.testExtFun2(): C.P2 [= Pair] +public fun C.testExtFun1(/*0*/ x: C.P2 /* = Pair */): C.P2 /* = Pair */ +public fun C.testExtFun2(): C.P2 /* = Pair */ public final class C { public typealias P2 = Pair public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun first(/*0*/ p: C.P2 [= Pair]): kotlin.Int + public final fun first(/*0*/ p: C.P2 /* = Pair */): kotlin.Int public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun p(): Pair - public final fun second(/*0*/ p: C.P2 [= Pair]): kotlin.Int + public final fun second(/*0*/ p: C.P2 /* = Pair */): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.txt b/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.txt index 96a6c73839a..0d1da4efc02 100644 --- a/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.txt +++ b/compiler/testData/diagnostics/tests/typealias/nestedCapturingTypeParameters.txt @@ -12,11 +12,11 @@ public final class C { public typealias PT2 /*captured type parameters: /*1*/ T*/ = Pair public constructor C() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public final fun first(/*0*/ p: C.P2 [= Pair]): T - public final fun first2(/*0*/ p: C.PT2 [= Pair]): T + public final fun first(/*0*/ p: C.P2 /* = Pair */): T + public final fun first2(/*0*/ p: C.PT2 /* = Pair */): T public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public final fun second(/*0*/ p: C.P2 [= Pair]): T - public final fun second2(/*0*/ p: C.PT2 [= Pair]): T2 + public final fun second(/*0*/ p: C.P2 /* = Pair */): T + public final fun second2(/*0*/ p: C.PT2 /* = Pair */): T2 public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } diff --git a/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.txt b/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.txt index afd7a55e076..15e3db50cfa 100644 --- a/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.txt +++ b/compiler/testData/diagnostics/tests/typealias/nestedSubstituted.txt @@ -1,6 +1,6 @@ package -public val p1: C.P2 [= Pair] +public val p1: C.P2 /* = Pair */ public final class C { public typealias P2 /*captured type parameters: /*0*/ T*/ = Pair diff --git a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt index 721f69ed1ec..f74cd8ba8fc 100644 --- a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.kt @@ -3,7 +3,7 @@ typealias Array2D = Array> fun foo1(a: Array2D) = a fun bar1(a: Array2D) = - foo1( [= Array>]; Array2D [= Array>])!>a) + foo1( /* = Array> */; Array2D /* = Array> */)!>a) typealias TMap = Map diff --git a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.txt b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.txt index 61a00d8cb99..55ccabfb05f 100644 --- a/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.txt +++ b/compiler/testData/diagnostics/tests/typealias/noApproximationInTypeAliasArgumentSubstitution.txt @@ -2,7 +2,7 @@ package public typealias Array2D = kotlin.Array> public typealias TMap = kotlin.collections.Map -public fun bar1(/*0*/ a: Array2D [= kotlin.Array>]): Array2D [= kotlin.Array>] -public fun bar2(/*0*/ m: TMap<*> [= kotlin.collections.Map<*, *>]): [ERROR : Error function type] -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 fun bar1(/*0*/ a: Array2D /* = kotlin.Array> */): Array2D /* = kotlin.Array> */ +public fun bar2(/*0*/ m: TMap<*> /* = kotlin.collections.Map<*, *> */): [ERROR : Error function type] +public fun foo1(/*0*/ a: Array2D /* = kotlin.Array> */): Array2D /* = kotlin.Array> */ +public fun foo2(/*0*/ m: TMap /* = kotlin.collections.Map */): TMap /* = kotlin.collections.Map */ diff --git a/compiler/testData/diagnostics/tests/typealias/parameterRestrictions.txt b/compiler/testData/diagnostics/tests/typealias/parameterRestrictions.txt index 88a6445fa46..45bdc321dab 100644 --- a/compiler/testData/diagnostics/tests/typealias/parameterRestrictions.txt +++ b/compiler/testData/diagnostics/tests/typealias/parameterRestrictions.txt @@ -4,4 +4,4 @@ public typealias WithBounds1 = kotlin. public typealias WithBounds2 = kotlin.Int public typealias WithBounds3 = kotlin.Int public typealias WithVariance = kotlin.Int -public val x: WithVariance [= kotlin.Int] = 0 +public val x: WithVariance /* = kotlin.Int */ = 0 diff --git a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt index 9ea1077516a..35fd6a5dd58 100644 --- a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt +++ b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.kt @@ -5,4 +5,4 @@ typealias CA = C val ca1: CA = C() val ca2: CA> = C>() val ca3: CA> = C>() -val ca4: CA = C() \ No newline at end of file +val ca4: CA = C() diff --git a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.txt b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.txt index a81d18d4dd5..c4f82e5a0bd 100644 --- a/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.txt +++ b/compiler/testData/diagnostics/tests/typealias/parameterSubstitution.txt @@ -1,10 +1,10 @@ package public typealias CA = C -public val ca1: CA [= C] -public val ca2: CA [= C]> [= C [= C]>] -public val ca3: CA> [= C>] -public val ca4: CA [= C] +public val ca1: CA /* = C */ +public val ca2: CA /* = C */> /* = C /* = C */> */ +public val ca3: CA> /* = C> */ +public val ca4: CA /* = C */ public final class C { public constructor C() diff --git a/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.kt b/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.kt index bcb9109876f..441d41bbbd2 100644 --- a/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.kt +++ b/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.kt @@ -2,4 +2,4 @@ typealias N = Nothing fun testFun(): N = null!! val testVal: N = null!! -val testValWithGetter: N get() = null!! \ No newline at end of file +val testValWithGetter: N get() = null!! diff --git a/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.txt b/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.txt index 421623ebbea..f9156cfa7ff 100644 --- a/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.txt +++ b/compiler/testData/diagnostics/tests/typealias/returnTypeNothingShouldBeSpecifiedExplicitly.txt @@ -1,6 +1,6 @@ package public typealias N = kotlin.Nothing -public val testVal: N [= kotlin.Nothing] -public val testValWithGetter: N [= kotlin.Nothing] -public fun testFun(): N [= kotlin.Nothing] +public val testVal: N /* = kotlin.Nothing */ +public val testValWithGetter: N /* = kotlin.Nothing */ +public fun testFun(): N /* = kotlin.Nothing */ diff --git a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt index 85ff5798030..65b7bc9ff00 100644 --- a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt +++ b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.kt @@ -5,4 +5,4 @@ typealias SSS = SS val s1: SSS = "" val s2: SSS? = null val s3: List? = null -val s4: List?>? = null \ No newline at end of file +val s4: List?>? = null diff --git a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.txt b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.txt index 3b95d62ed74..9f907c8b249 100644 --- a/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.txt +++ b/compiler/testData/diagnostics/tests/typealias/simpleTypeAlias.txt @@ -3,7 +3,7 @@ package public typealias S = kotlin.String public typealias SS = S public typealias SSS = SS -public val s1: SSS [= kotlin.String] = "" -public val s2: SSS? [= kotlin.String?] = null -public val s3: kotlin.collections.List? = null -public val s4: kotlin.collections.List?>? = null +public val s1: SSS /* = kotlin.String */ = "" +public val s2: SSS? /* = kotlin.String? */ = null +public val s3: kotlin.collections.List? = null +public val s4: kotlin.collections.List?>? = null diff --git a/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.txt b/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.txt index 7683a5da480..3346924858b 100644 --- a/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.txt +++ b/compiler/testData/diagnostics/tests/typealias/starProjectionInTypeAliasArgument.txt @@ -1,8 +1,8 @@ package public typealias Test = NumCharSeq -public fun getM(/*0*/ t: Test<*, *> [= NumCharSeq<*, *>]): kotlin.CharSequence -public fun getN(/*0*/ t: Test<*, *> [= NumCharSeq<*, *>]): kotlin.Number +public fun getM(/*0*/ t: Test<*, *> /* = NumCharSeq<*, *> */): kotlin.CharSequence +public fun getN(/*0*/ t: Test<*, *> /* = NumCharSeq<*, *> */): kotlin.Number public final class NumCharSeq { public constructor NumCharSeq(/*0*/ n: N, /*1*/ m: M) diff --git a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt index 92fa20a434e..f0542062fb3 100644 --- a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt +++ b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.kt @@ -17,4 +17,4 @@ typealias Inv2 = Inv typealias Inv3 = Inv typealias Inv4<T> = Inv<*> -val inv1: Inv1 = Inv() \ No newline at end of file +val inv1: Inv1 = Inv() diff --git a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.txt b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.txt index 796c4208c50..07e90caed0f 100644 --- a/compiler/testData/diagnostics/tests/typealias/substitutionVariance.txt +++ b/compiler/testData/diagnostics/tests/typealias/substitutionVariance.txt @@ -12,7 +12,7 @@ public typealias Out1 = Out public typealias Out2 = Out public typealias Out3 = Out public typealias Out4 = Out<*> -public val inv1: Inv1 [= Inv] +public val inv1: Inv1 /* = Inv */ public final class In { public constructor In() diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.txt index be1e2236d95..8a3f8912797 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.txt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasArgumentsInConstructor.txt @@ -4,7 +4,7 @@ public typealias P2 = Pair public val test1: Pair public val test1x1: kotlin.String public val test1x2: kotlin.String -public val test2: P2 [= Pair] +public val test2: P2 /* = Pair */ public val test2x1: kotlin.String public val test2x2: kotlin.String diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.txt index 62b6d167e9c..a7487719d70 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.txt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.txt @@ -4,9 +4,9 @@ public typealias TC = C public typealias TI = Interface public typealias TO = AnObject public val test1: C -public val test2: TC [= C] +public val test2: TC /* = C */ public val test3: C -public val test4: TC [= C] +public val test4: TC /* = C */ public val test5: [ERROR : Type for TC("", "")] public val test6: [ERROR : Type for TI()] public val test6a: [ERROR : Type for Interface()] diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasObject.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasObject.txt index cba213d4aaf..83f14b92a8d 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasObject.txt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasObject.txt @@ -4,11 +4,11 @@ public typealias TestCWC = ClassWithCompanion public typealias TestObject = AnObject public typealias TestObject2 = TestObject public val test11: AnObject -public val test12: TestObject [= AnObject] +public val test12: TestObject /* = AnObject */ public val test13: kotlin.String = "OK" public val test14: kotlin.String public val test21: AnObject -public val test22: TestObject2 [= AnObject] +public val test22: TestObject2 /* = AnObject */ public val test23: kotlin.String = "OK" public val test24: kotlin.String public val test35: ClassWithCompanion.Companion diff --git a/compiler/testData/loadJava/compiledKotlin/typealias/Basic.txt b/compiler/testData/loadJava/compiledKotlin/typealias/Basic.txt index da51d6a3615..a2f1b3b6cf8 100644 --- a/compiler/testData/loadJava/compiledKotlin/typealias/Basic.txt +++ b/compiler/testData/loadJava/compiledKotlin/typealias/Basic.txt @@ -3,15 +3,15 @@ package test public typealias S = kotlin.String public typealias SS = test.S public typealias SSS = test.SS -public val x1: test.S [= kotlin.String] = "" - public fun (): test.S [= kotlin.String] -public val x2: test.SS [= kotlin.String] = "" - public fun (): test.SS [= kotlin.String] -public val x3: test.SSS [= kotlin.String] = "" - public fun (): test.SSS [= kotlin.String] -public val x4: test.S? [= kotlin.String?] = "" - public fun (): test.S? [= kotlin.String?] -public val x5: test.SS? [= kotlin.String?] = "" - public fun (): test.SS? [= kotlin.String?] -public val x6: test.SSS? [= kotlin.String?] = "" - public fun (): test.SSS? [= kotlin.String?] +public val x1: test.S /* = kotlin.String */ = "" + public fun (): test.S /* = kotlin.String */ +public val x2: test.SS /* = kotlin.String */ = "" + public fun (): test.SS /* = kotlin.String */ +public val x3: test.SSS /* = kotlin.String */ = "" + public fun (): test.SSS /* = kotlin.String */ +public val x4: test.S? /* = kotlin.String? */ = "" + public fun (): test.S? /* = kotlin.String? */ +public val x5: test.SS? /* = kotlin.String? */ = "" + public fun (): test.SS? /* = kotlin.String? */ +public val x6: test.SSS? /* = kotlin.String? */ = "" + public fun (): test.SSS? /* = kotlin.String? */ diff --git a/compiler/testData/loadJava/compiledKotlin/typealias/Generic.txt b/compiler/testData/loadJava/compiledKotlin/typealias/Generic.txt index 9c3b3838fc7..0729f70a1b3 100644 --- a/compiler/testData/loadJava/compiledKotlin/typealias/Generic.txt +++ b/compiler/testData/loadJava/compiledKotlin/typealias/Generic.txt @@ -3,9 +3,9 @@ package test public typealias L = kotlin.collections.List public typealias LL = test.L public typealias LLL = test.LL -public fun test1(/*0*/ x: test.L [= kotlin.collections.List]): kotlin.Unit -public fun test2(/*0*/ x: test.LL [= kotlin.collections.List]): kotlin.Unit -public fun test3(/*0*/ x: test.LLL [= kotlin.collections.List]): kotlin.Unit -public fun test4(/*0*/ x: test.L [= kotlin.collections.List]> [= kotlin.collections.List [= kotlin.collections.List]>]): kotlin.Unit -public fun test5(/*0*/ x: test.LL [= kotlin.collections.List]> [= kotlin.collections.List [= kotlin.collections.List]>]): kotlin.Unit -public fun test6(/*0*/ x: test.LLL [= kotlin.collections.List]> [= kotlin.collections.List [= kotlin.collections.List]>]): kotlin.Unit +public fun test1(/*0*/ x: test.L /* = kotlin.collections.List */): kotlin.Unit +public fun test2(/*0*/ x: test.LL /* = kotlin.collections.List */): kotlin.Unit +public fun test3(/*0*/ x: test.LLL /* = kotlin.collections.List */): kotlin.Unit +public fun test4(/*0*/ x: test.L /* = kotlin.collections.List */> /* = kotlin.collections.List /* = kotlin.collections.List */> */): kotlin.Unit +public fun test5(/*0*/ x: test.LL /* = kotlin.collections.List */> /* = kotlin.collections.List /* = kotlin.collections.List */> */): kotlin.Unit +public fun test6(/*0*/ x: test.LLL /* = kotlin.collections.List */> /* = kotlin.collections.List /* = kotlin.collections.List */> */): kotlin.Unit diff --git a/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt b/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt index 8b324c78507..346f703b784 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/renderer/DescriptorRendererImpl.kt @@ -129,7 +129,7 @@ internal class DescriptorRendererImpl( // TODO nullability is lost for abbreviated type? val abbreviatedRendered = renderNormalizedTypeAsIs(abbreviated.abbreviation) val unabbreviatedRendered = renderNormalizedTypeAsIs(abbreviated.expandedType) - return "$abbreviatedRendered [= $unabbreviatedRendered]" + return "$abbreviatedRendered /* = $unabbreviatedRendered */" } return renderNormalizedTypeAsIs(type)