KT-15748 Type alias constructor return type should have a corresponding abbreviation
This commit is contained in:
+4
-4
@@ -1,11 +1,11 @@
|
||||
package
|
||||
|
||||
public val x1: Num<kotlin.String>
|
||||
public val x2: Num<kotlin.String>
|
||||
public val x3: Num<kotlin.String>
|
||||
public val x2: N<kotlin.String> /* = Num<kotlin.String> */
|
||||
public val x3: N2<kotlin.String> /* = Num<kotlin.String> */
|
||||
public val y1: TColl<kotlin.Any, kotlin.Any>
|
||||
public val y2: TColl<kotlin.Any, kotlin.Any>
|
||||
public val y3: TColl<kotlin.Any, kotlin.Any>
|
||||
public val y2: TC<kotlin.Any, kotlin.Any> /* = TColl<kotlin.Any, kotlin.Any> */
|
||||
public val y3: TC2<kotlin.Any, kotlin.Any> /* = TColl<kotlin.Any, kotlin.Any> */
|
||||
|
||||
public final class Num</*0*/ T : kotlin.Number> {
|
||||
public constructor Num</*0*/ T : kotlin.Number>(/*0*/ x: T)
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
package
|
||||
|
||||
public val test5: TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Number>>
|
||||
public val test6: TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Int>>
|
||||
public val test7: TColl<kotlin.Number, kotlin.collections.List<kotlin.Int>>
|
||||
public val test8: TColl<kotlin.Number, kotlin.collections.List<kotlin.Any>>
|
||||
public val test5: TC2<kotlin.Number, kotlin.collections.Collection<kotlin.Number>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Number>> */
|
||||
public val test6: TC2<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> */
|
||||
public val test7: TC2<kotlin.Number, kotlin.collections.List<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.List<kotlin.Int>> */
|
||||
public val test8: TC2<kotlin.Number, kotlin.collections.List<kotlin.Any>> /* = TColl<kotlin.Number, kotlin.collections.List<kotlin.Any>> */
|
||||
public fun test1(/*0*/ x: TC2<kotlin.Number, kotlin.collections.Collection<kotlin.Number>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Number>> */): kotlin.Unit
|
||||
public fun test2(/*0*/ x: TC2<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> */): kotlin.Unit
|
||||
public fun test3(/*0*/ x: TC2<kotlin.Number, kotlin.collections.List<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.List<kotlin.Int>> */): kotlin.Unit
|
||||
|
||||
+8
-8
@@ -1,13 +1,13 @@
|
||||
package
|
||||
|
||||
public val test13: TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Number>>
|
||||
public val test14: TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Int>>
|
||||
public val test15: TColl<kotlin.Number, kotlin.collections.List<kotlin.Int>>
|
||||
public val test16: TColl<kotlin.Number, kotlin.collections.List<kotlin.Any>>
|
||||
public val test5: Num<kotlin.Int>
|
||||
public val test6: Num<kotlin.Any>
|
||||
public val test7: NumColl<kotlin.collections.List<kotlin.Int>>
|
||||
public val test8: NumColl<kotlin.collections.List<kotlin.Any>>
|
||||
public val test13: TC<kotlin.Number, kotlin.collections.Collection<kotlin.Number>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Number>> */
|
||||
public val test14: TC<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> */
|
||||
public val test15: TC<kotlin.Number, kotlin.collections.List<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.List<kotlin.Int>> */
|
||||
public val test16: TC<kotlin.Number, kotlin.collections.List<kotlin.Any>> /* = TColl<kotlin.Number, kotlin.collections.List<kotlin.Any>> */
|
||||
public val test5: NA<kotlin.Int> /* = Num<kotlin.Int> */
|
||||
public val test6: NA<kotlin.Any> /* = Num<kotlin.Any> */
|
||||
public val test7: NL<kotlin.Int> /* = NumColl<kotlin.collections.List<kotlin.Int>> */
|
||||
public val test8: NL<kotlin.Any> /* = NumColl<kotlin.collections.List<kotlin.Any>> */
|
||||
public fun test1(/*0*/ x: NA<kotlin.Int> /* = Num<kotlin.Int> */): kotlin.Unit
|
||||
public fun test10(/*0*/ x: TC<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.Collection<kotlin.Int>> */): kotlin.Unit
|
||||
public fun test11(/*0*/ x: TC<kotlin.Number, kotlin.collections.List<kotlin.Int>> /* = TColl<kotlin.Number, kotlin.collections.List<kotlin.Int>> */): kotlin.Unit
|
||||
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
package
|
||||
|
||||
public val test1: C<kotlin.String>
|
||||
public val test2: C<kotlin.String>
|
||||
public val test3: C<kotlin.String>
|
||||
public val test4: C<kotlin.String>
|
||||
public val test1: GTC<kotlin.String> /* = C<kotlin.String> */
|
||||
public val test2: GTC<kotlin.String> /* = C<kotlin.String> */
|
||||
public val test3: GTC<kotlin.String> /* = C<kotlin.String> */
|
||||
public val test4: GTC<kotlin.String> /* = C<kotlin.String> */
|
||||
|
||||
public final class C</*0*/ T> {
|
||||
public constructor C</*0*/ T>(/*0*/ x: T)
|
||||
|
||||
@@ -2,7 +2,7 @@ package
|
||||
|
||||
public val ms: MyString /* = kotlin.String */ = "MyString"
|
||||
public val msc: MyStringContainer /* = Container<MyString? /* = kotlin.String? */> */
|
||||
public val msc1: Container<MyString? /* = kotlin.String? */>
|
||||
public val msc1: MyStringContainer /* = Container<MyString? /* = kotlin.String? */> */
|
||||
public val msn: MyString? /* = kotlin.String? */ = null
|
||||
|
||||
public final class Container</*0*/ T> {
|
||||
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
package
|
||||
|
||||
public fun test1(/*0*/ x: Outer): Outer.Inner
|
||||
public fun test2(/*0*/ x: Generic<kotlin.Int>): Generic<kotlin.Int>.Inner
|
||||
public fun </*0*/ T> test3(/*0*/ x: Generic<T>): Generic<T>.Inner
|
||||
public fun </*0*/ T> test4(/*0*/ x: Generic<kotlin.collections.List<T>>): Generic<kotlin.collections.List<T>>.Inner
|
||||
public fun </*0*/ T> test5(/*0*/ x: Generic<T>): Generic<kotlin.Int>.Inner
|
||||
public fun Generic<kotlin.Int>.test6(): Generic<kotlin.Int>.Inner
|
||||
public fun test2(/*0*/ x: Generic<kotlin.Int>): GI<kotlin.Int> /* = Generic<kotlin.Int>.Inner */
|
||||
public fun </*0*/ T> test3(/*0*/ x: Generic<T>): GI<T> /* = Generic<T>.Inner */
|
||||
public fun </*0*/ T> test4(/*0*/ x: Generic<kotlin.collections.List<T>>): GI<kotlin.collections.List<T>> /* = Generic<kotlin.collections.List<T>>.Inner */
|
||||
public fun </*0*/ T> test5(/*0*/ x: Generic<T>): GIntI /* = Generic<kotlin.Int>.Inner */
|
||||
public fun Generic<kotlin.Int>.test6(): GIntI /* = Generic<kotlin.Int>.Inner */
|
||||
|
||||
public final class Generic</*0*/ T> {
|
||||
public constructor Generic</*0*/ T>()
|
||||
|
||||
+3
-3
@@ -5,9 +5,9 @@ public val test1: [ERROR : Type for C<Int>.P1<String>("", 1)]
|
||||
public val test2: [ERROR : Type for C<Int>.P2<String>(1, "")]
|
||||
public val test3: [ERROR : Type for C<Int>.P1("", 1)]
|
||||
public val test4: [ERROR : Type for C<Int>.P2(1, "")]
|
||||
public val test5: Pair<T, T>
|
||||
public val test6: Pair<kotlin.String, T>
|
||||
public val test7: Pair<T, kotlin.String>
|
||||
public val test5: C<T>.P /* = Pair<T, T> */
|
||||
public val test6: C<T>.P1<kotlin.String> /* = Pair<kotlin.String, T> */
|
||||
public val test7: C<T>.P2<kotlin.String> /* = Pair<T, kotlin.String> */
|
||||
|
||||
public final class C</*0*/ T> {
|
||||
public constructor C</*0*/ T>()
|
||||
|
||||
@@ -11,7 +11,7 @@ public final class 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, kotlin.Int> */): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final fun p(): Pair<kotlin.Int, kotlin.Int>
|
||||
public final fun p(): C.P2 /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public final fun second(/*0*/ p: C.P2 /* = Pair<kotlin.Int, kotlin.Int> */): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public typealias P2 = Pair<kotlin.Int, kotlin.Int>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package
|
||||
|
||||
public val test1: In<kotlin.String>
|
||||
public val test2: In<kotlin.String>
|
||||
public val test2: InAlias<kotlin.String> /* = In<kotlin.String> */
|
||||
|
||||
public final class In</*0*/ in T> {
|
||||
public constructor In</*0*/ in T>(/*0*/ x: kotlin.Any)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package
|
||||
|
||||
public val test1: [ERROR : Type for BOutIn(listOf(), null!!)]
|
||||
public val test2: Bound<in kotlin.collections.List<kotlin.Nothing>, in kotlin.Nothing>
|
||||
public val test2: BInIn<kotlin.Nothing> /* = Bound<in kotlin.collections.List<kotlin.Nothing>, in kotlin.Nothing> */
|
||||
public fun </*0*/ T> listOf(): kotlin.collections.List<T>
|
||||
|
||||
public final class Bound</*0*/ X, /*1*/ Y : X> {
|
||||
|
||||
+5
-5
@@ -1,10 +1,10 @@
|
||||
package
|
||||
|
||||
public val test1: C<*>
|
||||
public val test2: C<in kotlin.Int>
|
||||
public val test3: C<out kotlin.Int>
|
||||
public val test4: C<[ERROR : Star projection in a call]>
|
||||
public val test5: C<CT<*> /* = C<*> */>
|
||||
public val test1: CStar /* = C<*> */
|
||||
public val test2: CIn /* = C<in kotlin.Int> */
|
||||
public val test3: COut /* = C<out kotlin.Int> */
|
||||
public val test4: CT<[ERROR : Star projection in a call]> /* = C<[ERROR : Star projection in a call]> */
|
||||
public val test5: CT<CT<*> /* = C<*> */> /* = C<CT<*> /* = C<*> */> */
|
||||
|
||||
public final class C</*0*/ T> {
|
||||
public constructor C</*0*/ T>()
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
class Cell<T>(val x : T)
|
||||
class Pair<T1, T2>(val x1: T1, val x2: T2)
|
||||
|
||||
typealias CIntA = Cell<Int>
|
||||
typealias CA<TA> = Cell<TA>
|
||||
typealias PIntIntA = Pair<Int, Int>
|
||||
typealias PA<T1A, T2A> = Pair<T1A, T2A>
|
||||
typealias P2A<TA> = Pair<TA, TA>
|
||||
|
||||
val test1 = CIntA(10)
|
||||
val test2 = CA<Int>(10)
|
||||
val test3 = CA(10)
|
||||
val test4 = PIntIntA(10, 20)
|
||||
val test5 = PA<Int, Int>(10, 20)
|
||||
val test6 = PA(10, 20)
|
||||
val test7 = P2A<Int>(10, 20)
|
||||
val test8 = P2A(10, 20)
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package
|
||||
|
||||
public val test1: CIntA /* = Cell<kotlin.Int> */
|
||||
public val test2: CA<kotlin.Int> /* = Cell<kotlin.Int> */
|
||||
public val test3: CA<kotlin.Int> /* = Cell<kotlin.Int> */
|
||||
public val test4: PIntIntA /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test5: PA<kotlin.Int, kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test6: PA<kotlin.Int, kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test7: P2A<kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test8: P2A<kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
|
||||
public final class Cell</*0*/ T> {
|
||||
public constructor Cell</*0*/ T>(/*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</*0*/ T1, /*1*/ T2> {
|
||||
public constructor Pair</*0*/ T1, /*1*/ T2>(/*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 CA</*0*/ TA> = Cell<TA>
|
||||
public typealias CIntA = Cell<kotlin.Int>
|
||||
public typealias P2A</*0*/ TA> = Pair<TA, TA>
|
||||
public typealias PA</*0*/ T1A, /*1*/ T2A> = Pair<T1A, T2A>
|
||||
public typealias PIntIntA = Pair<kotlin.Int, kotlin.Int>
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ class Num<Tn : Number>(val x: Tn)
|
||||
typealias N<T> = Num<T>
|
||||
|
||||
val test0 = N(1)
|
||||
val test1 = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED(Type parameter bound for Tn in type inferred from type alias expansion for fun <T> <init>\(x: T\): Num<T>
|
||||
val test1 = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED(Type parameter bound for Tn in type inferred from type alias expansion for fun <T> <init>\(x: T\): N<T> /* = Num<T> */
|
||||
is not satisfied: inferred type String is not a subtype of Number)!>N<!>("1")
|
||||
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -1,11 +1,11 @@
|
||||
package
|
||||
|
||||
public val test0: Num<kotlin.Int>
|
||||
public val test0: N<kotlin.Int> /* = Num<kotlin.Int> */
|
||||
public val test1: [ERROR : Type for N("1")]
|
||||
public val test2: Cons<kotlin.Int>
|
||||
public val test2: C<kotlin.Int> /* = Cons<kotlin.Int> */
|
||||
public val test3: [ERROR : Type for CC(1, 2)]
|
||||
public val test4: Cons<Cons<kotlin.Int>>
|
||||
public val test5: Pair<kotlin.Int, kotlin.collections.List<kotlin.Int>>
|
||||
public val test4: CC<kotlin.Int> /* = Cons<Cons<kotlin.Int>> */
|
||||
public val test5: PL<kotlin.Int> /* = Pair<kotlin.Int, kotlin.collections.List<kotlin.Int>> */
|
||||
public fun testProjections1(/*0*/ x: Pair<in kotlin.Int, out kotlin.String>): [ERROR : Error function type]
|
||||
public fun testProjections2(/*0*/ x: Pair<in kotlin.Int, out kotlin.Number>): [ERROR : Error function type]
|
||||
public fun testProjections3(/*0*/ x: Pair<in kotlin.Number, out kotlin.Int>): [ERROR : Error function type]
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package
|
||||
|
||||
public val test1: Cons<kotlin.Int>
|
||||
public val test2: Cons<kotlin.Int>
|
||||
public val test1: C<kotlin.Int> /* = Cons<kotlin.Int> */
|
||||
public val test2: C<kotlin.Int> /* = Cons<kotlin.Int> */
|
||||
|
||||
public final class Cons</*0*/ T : kotlin.Number> {
|
||||
public constructor Cons</*0*/ T : kotlin.Number>(/*0*/ head: T, /*1*/ tail: Cons<T>?)
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@ package
|
||||
public val r1: Ref<in kotlin.Int>
|
||||
public val r1a: Ref<in kotlin.Int>
|
||||
public val r2: LateInitNumRef<kotlin.Int>
|
||||
public val r2a: LateInitNumRef<kotlin.Int>
|
||||
public val r2a: LateNR<kotlin.Int> /* = LateInitNumRef<kotlin.Int> */
|
||||
public val r3: LateInitNumRef<kotlin.Int>
|
||||
public val r3a: LateInitNumRef<kotlin.Int>
|
||||
public val r3a: LateNR<kotlin.Int> /* = LateInitNumRef<kotlin.Int> */
|
||||
public fun test(): kotlin.Unit
|
||||
public fun </*0*/ V, /*1*/ R : Ref<in V>> update(/*0*/ r: R, /*1*/ v: V): R
|
||||
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@ class Hr<A, B, C, D>(val a: A, val b: B)
|
||||
typealias Test<A, B> = Hr<A, B, Foo<A>, Bar<B>>
|
||||
|
||||
val test1 = Test(1, "")
|
||||
val test2 = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED(Type parameter bound for B in type inferred from type alias expansion for fun <A, B> <init>\(a: A, b: B\): Hr<A, B, Foo<A>, Bar<B>>
|
||||
val test2 = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED(Type parameter bound for B in type inferred from type alias expansion for fun <A, B> <init>\(a: A, b: B\): Test<A, B> /* = Hr<A, B, Foo<A>, Bar<B>> */
|
||||
is not satisfied: inferred type Int is not a subtype of CharSequence)!>Test<!>(1, 2)
|
||||
|
||||
|
||||
typealias Bas<T> = Hr<T, T, Foo<T>, Bar<T>>
|
||||
|
||||
val test3 = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED(Type parameter bound for B in type inferred from type alias expansion for fun <T> <init>\(a: T, b: T\): Hr<T, T, Foo<T>, Bar<T>>
|
||||
val test3 = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED(Type parameter bound for B in type inferred from type alias expansion for fun <T> <init>\(a: T, b: T\): Bas<T> /* = Hr<T, T, Foo<T>, Bar<T>> */
|
||||
is not satisfied: inferred type Int is not a subtype of CharSequence)!>Bas<!>(1, 1)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package
|
||||
|
||||
public val test1: Hr<kotlin.Int, kotlin.String, Foo<kotlin.Int>, Bar<kotlin.String>>
|
||||
public val test1: Test<kotlin.Int, kotlin.String> /* = Hr<kotlin.Int, kotlin.String, Foo<kotlin.Int>, Bar<kotlin.String>> */
|
||||
public val test2: [ERROR : Type for Test(1, 2)]
|
||||
public val test3: [ERROR : Type for Bas(1, 1)]
|
||||
|
||||
|
||||
Vendored
+17
-17
@@ -1,23 +1,23 @@
|
||||
package
|
||||
|
||||
public val test0: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test0p2: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test0p2a: Pair<kotlin.Any, kotlin.Any>
|
||||
public val test0pr: Pair<kotlin.Int, kotlin.String>
|
||||
public val test1: Pair<kotlin.Int, [ERROR : Explicit type argument expected for T2]>
|
||||
public val test1p2: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test1pr: Pair<[ERROR : Explicit type argument expected for T2], kotlin.Int>
|
||||
public val test2: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test2p2: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test2pr: Pair<kotlin.String, kotlin.Int>
|
||||
public val test2pra: Pair<kotlin.Int, kotlin.String>
|
||||
public val test3: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test3p2: Pair<kotlin.Int, kotlin.Int>
|
||||
public val test3pr: Pair<kotlin.String, kotlin.String>
|
||||
public val test0: P<kotlin.Int, kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test0p2: P2<kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test0p2a: P2<kotlin.Any> /* = Pair<kotlin.Any, kotlin.Any> */
|
||||
public val test0pr: PR<kotlin.String, kotlin.Int> /* = Pair<kotlin.Int, kotlin.String> */
|
||||
public val test1: P<kotlin.Int, [ERROR : Explicit type argument expected for T2]> /* = Pair<kotlin.Int, [ERROR : Explicit type argument expected for T2]> */
|
||||
public val test1p2: P2<kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test1pr: PR<kotlin.Int, [ERROR : Explicit type argument expected for T2]> /* = Pair<[ERROR : Explicit type argument expected for T2], kotlin.Int> */
|
||||
public val test2: P<kotlin.Int, kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test2p2: P2<kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test2pr: PR<kotlin.Int, kotlin.String> /* = Pair<kotlin.String, kotlin.Int> */
|
||||
public val test2pra: PR<kotlin.String, kotlin.Int> /* = Pair<kotlin.Int, kotlin.String> */
|
||||
public val test3: P<kotlin.Int, kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test3p2: P2<kotlin.Int> /* = Pair<kotlin.Int, kotlin.Int> */
|
||||
public val test3pr: P2<kotlin.String> /* = Pair<kotlin.String, kotlin.String> */
|
||||
public val testN0: [ERROR : Type for N("")]
|
||||
public val testN1: Num<kotlin.Int>
|
||||
public val testN1a: Num<kotlin.String>
|
||||
public val testN2: Num<kotlin.Int>
|
||||
public val testN1: N<kotlin.Int> /* = Num<kotlin.Int> */
|
||||
public val testN1a: N<kotlin.String> /* = Num<kotlin.String> */
|
||||
public val testN2: N<kotlin.Int> /* = Num<kotlin.Int> */
|
||||
|
||||
public final class Num</*0*/ T : kotlin.Number> {
|
||||
public constructor Num</*0*/ T : kotlin.Number>(/*0*/ x: T)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package
|
||||
|
||||
public var longWords: kotlin.Int
|
||||
public val smallWords: java.util.HashSet<kotlin.String>
|
||||
public val smallWords: kotlin.collections.HashSet<kotlin.String> /* = java.util.HashSet<kotlin.String> */
|
||||
public fun test1(/*0*/ word: kotlin.String): kotlin.Any
|
||||
public fun test2(/*0*/ word: kotlin.String): kotlin.Any
|
||||
public fun test3(/*0*/ word: kotlin.String): kotlin.Any?
|
||||
|
||||
@@ -2,7 +2,7 @@ package
|
||||
|
||||
public final class A {
|
||||
public constructor A()
|
||||
public final val x: java.util.ArrayList<([ERROR : A]<[ERROR : No type element]>) -> kotlin.Unit>
|
||||
public final val x: kotlin.collections.ArrayList<([ERROR : A]<[ERROR : No type element]>) -> kotlin.Unit> /* = java.util.ArrayList<([ERROR : A]<[ERROR : No type element]>) -> kotlin.Unit> */
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package
|
||||
|
||||
public val barException: java.lang.Exception
|
||||
public val fooException: java.lang.Exception
|
||||
public val barException: kotlin.Exception /* = java.lang.Exception */
|
||||
public val fooException: kotlin.Exception /* = java.lang.Exception */
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package
|
||||
|
||||
public val mutableNamesByTeam1: java.util.HashMap<kotlin.String, kotlin.collections.MutableList<kotlin.String>>
|
||||
public val mutableNamesByTeam1: HM<kotlin.String, kotlin.collections.MutableList<kotlin.String>> /* = java.util.HashMap<kotlin.String, kotlin.collections.MutableList<kotlin.String>> */
|
||||
public val mutableNamesByTeam2: java.util.HashMap<kotlin.String, kotlin.collections.MutableList<kotlin.String>>
|
||||
public val nameToTeam: kotlin.collections.List<kotlin.Pair<kotlin.String, kotlin.String>>
|
||||
public val namesByTeam: kotlin.collections.Map<kotlin.String, kotlin.collections.List<kotlin.String>>
|
||||
|
||||
@@ -90,9 +90,9 @@ FILE /classLevelProperties.kt
|
||||
thisRef: GET_VAR '<receiver: C>' type=C origin=null
|
||||
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
PROPERTY public final var test8: kotlin.Int
|
||||
FIELD DELEGATE val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
|
||||
FIELD DELEGATE val `test8$delegate`: kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */
|
||||
EXPRESSION_BODY
|
||||
CALL 'hashMapOf(): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
CALL 'hashMapOf(): HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
<K>: String
|
||||
<V>: Int
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR public final fun <get-test8>(): kotlin.Int
|
||||
@@ -100,7 +100,7 @@ FILE /classLevelProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
|
||||
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
|
||||
<V>: Int
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
receiver: GET_VAR '<receiver: C>' type=C origin=null
|
||||
thisRef: GET_VAR '<receiver: C>' type=C origin=null
|
||||
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
@@ -109,7 +109,7 @@ FILE /classLevelProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
|
||||
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
|
||||
<V>: Int
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
receiver: GET_VAR '<receiver: C>' type=C origin=null
|
||||
thisRef: GET_VAR '<receiver: C>' type=C origin=null
|
||||
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
|
||||
@@ -77,9 +77,9 @@ FILE /delegatedProperties.kt
|
||||
property: CALLABLE_REFERENCE 'test3: Any' type=kotlin.reflect.KMutableProperty1<C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
value: GET_VAR 'value-parameter <set-?>: Any' type=kotlin.Any origin=null
|
||||
PROPERTY public var test4: kotlin.Any
|
||||
FIELD DELEGATE val `test4$delegate`: java.util.HashMap<kotlin.String, kotlin.Any>
|
||||
FIELD DELEGATE val `test4$delegate`: kotlin.collections.HashMap<kotlin.String, kotlin.Any> /* = java.util.HashMap<kotlin.String, kotlin.Any> */
|
||||
EXPRESSION_BODY
|
||||
CALL 'hashMapOf(): HashMap<String, Any>' type=java.util.HashMap<kotlin.String, kotlin.Any> origin=null
|
||||
CALL 'hashMapOf(): HashMap<String, Any> /* = HashMap<String, Any> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Any> /* = java.util.HashMap<kotlin.String, kotlin.Any> */ origin=null
|
||||
<K>: String
|
||||
<V>: Any
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR public fun <get-test4>(): kotlin.Any
|
||||
@@ -87,7 +87,7 @@ FILE /delegatedProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<get-test4>(): Any'
|
||||
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Any>: Any' type=kotlin.Any origin=null
|
||||
<V>: Any
|
||||
$receiver: GET_FIELD '`test4$delegate`: HashMap<String, Any>' type=java.util.HashMap<kotlin.String, kotlin.Any> origin=null
|
||||
$receiver: GET_FIELD '`test4$delegate`: HashMap<String, Any> /* = HashMap<String, Any> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Any> /* = java.util.HashMap<kotlin.String, kotlin.Any> */ origin=null
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0<kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR public fun <set-test4>(<set-?>: kotlin.Any): kotlin.Unit
|
||||
@@ -95,7 +95,7 @@ FILE /delegatedProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<set-test4>(Any): Unit'
|
||||
CALL 'setValue(Any?, KProperty<*>, Any) on MutableMap<in String, in Any>: Unit' type=kotlin.Unit origin=null
|
||||
<V>: Any
|
||||
$receiver: GET_FIELD '`test4$delegate`: HashMap<String, Any>' type=java.util.HashMap<kotlin.String, kotlin.Any> origin=null
|
||||
$receiver: GET_FIELD '`test4$delegate`: HashMap<String, Any> /* = HashMap<String, Any> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Any> /* = java.util.HashMap<kotlin.String, kotlin.Any> */ origin=null
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'test4: Any' type=kotlin.reflect.KMutableProperty0<kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
value: GET_VAR 'value-parameter <set-?>: Any' type=kotlin.Any origin=null
|
||||
|
||||
@@ -24,8 +24,8 @@ FILE /localDelegatedProperties.kt
|
||||
FUN public fun test2(): kotlin.Unit
|
||||
BLOCK_BODY
|
||||
LOCAL_DELEGATED_PROPERTY var x: kotlin.Int
|
||||
VAR DELEGATE val `x$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
|
||||
CALL 'hashMapOf(): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
VAR DELEGATE val `x$delegate`: kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */
|
||||
CALL 'hashMapOf(): HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
<K>: String
|
||||
<V>: Int
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR local final fun <get-x>(): kotlin.Int
|
||||
@@ -33,7 +33,7 @@ FILE /localDelegatedProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
|
||||
<V>: Int
|
||||
$receiver: GET_VAR '`x$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
$receiver: GET_VAR '`x$delegate`: HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR local final fun <set-x>(value: kotlin.Int): kotlin.Int
|
||||
@@ -42,7 +42,7 @@ FILE /localDelegatedProperties.kt
|
||||
TYPE_OP origin=IMPLICIT_CAST typeOperand=kotlin.Int
|
||||
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
|
||||
<V>: Int
|
||||
$receiver: GET_VAR '`x$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
$receiver: GET_VAR '`x$delegate`: HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'x: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int origin=null
|
||||
|
||||
@@ -76,9 +76,9 @@ FILE /packageLevelProperties.kt
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
PROPERTY public var test8: kotlin.Int
|
||||
FIELD DELEGATE val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
|
||||
FIELD DELEGATE val `test8$delegate`: kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */
|
||||
EXPRESSION_BODY
|
||||
CALL 'hashMapOf(): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
CALL 'hashMapOf(): HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
<K>: String
|
||||
<V>: Int
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR public fun <get-test8>(): kotlin.Int
|
||||
@@ -86,7 +86,7 @@ FILE /packageLevelProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
|
||||
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int origin=null
|
||||
<V>: Int
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
FUN DELEGATED_PROPERTY_ACCESSOR public fun <set-test8>(<set-?>: kotlin.Int): kotlin.Unit
|
||||
@@ -94,7 +94,7 @@ FILE /packageLevelProperties.kt
|
||||
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
|
||||
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit origin=null
|
||||
<V>: Int
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> origin=null
|
||||
$receiver: GET_FIELD '`test8$delegate`: HashMap<String, Int> /* = HashMap<String, Int> */' type=kotlin.collections.HashMap<kotlin.String, kotlin.Int> /* = java.util.HashMap<kotlin.String, kotlin.Int> */ origin=null
|
||||
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int origin=null
|
||||
|
||||
@@ -22510,6 +22510,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasConstructorReturnType.kt")
|
||||
public void testTypeAliasConstructorReturnType() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasConstructorReturnType.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("typeAliasConstructorTypeArgumentsInference.kt")
|
||||
public void testTypeAliasConstructorTypeArgumentsInference() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/typealias/typeAliasConstructorTypeArgumentsInference.kt");
|
||||
|
||||
+11
-6
@@ -20,9 +20,7 @@ import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeSubstitutor
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.types.*
|
||||
|
||||
interface TypeAliasConstructorDescriptor : ConstructorDescriptor {
|
||||
val underlyingConstructorDescriptor: ClassConstructorDescriptor
|
||||
@@ -122,15 +120,22 @@ class TypeAliasConstructorDescriptorImpl private constructor(
|
||||
val valueParameters = FunctionDescriptorImpl.getSubstitutedValueParameters(typeAliasConstructor, constructor.valueParameters, substitutor, false, false)
|
||||
?: return null
|
||||
|
||||
val returnType = substitutor.substitute(constructor.returnType, Variance.INVARIANT)
|
||||
?: return null
|
||||
val returnType = run {
|
||||
val returnTypeNoAbbreviation = substitutor.substitute(constructor.returnType, Variance.INVARIANT)
|
||||
?: return null
|
||||
val abbreviation = typeAliasDescriptor.defaultType
|
||||
if (returnTypeNoAbbreviation is SimpleType && abbreviation is SimpleType)
|
||||
returnTypeNoAbbreviation.withAbbreviation(abbreviation)
|
||||
else
|
||||
returnTypeNoAbbreviation
|
||||
}
|
||||
|
||||
val receiverParameterType =
|
||||
if (withDispatchReceiver) null
|
||||
else constructor.dispatchReceiverParameter?.let { substitutor.safeSubstitute(it.type, Variance.INVARIANT) }
|
||||
|
||||
val dispatchReceiver =
|
||||
if (withDispatchReceiver) constructor.dispatchReceiverParameter?.let { it.substitute(substitutor) }
|
||||
if (withDispatchReceiver) constructor.dispatchReceiverParameter?.substitute(substitutor)
|
||||
else null
|
||||
|
||||
typeAliasConstructor.initialize(
|
||||
|
||||
@@ -43,6 +43,7 @@ class AbbreviatedType(override val delegate: SimpleType, val abbreviation: Simpl
|
||||
}
|
||||
|
||||
fun KotlinType.getAbbreviatedType(): AbbreviatedType? = unwrap() as? AbbreviatedType
|
||||
fun KotlinType.getAbbreviation(): SimpleType? = getAbbreviatedType()?.abbreviation
|
||||
|
||||
fun SimpleType.withAbbreviation(abbreviatedType: SimpleType): SimpleType {
|
||||
if (isError) return this
|
||||
|
||||
@@ -229,11 +229,21 @@ public class TypeSubstitutor {
|
||||
return originalProjection;
|
||||
}
|
||||
|
||||
KotlinType substitutedAbbreviation = null;
|
||||
SimpleType abbreviation = SpecialTypesKt.getAbbreviation(type);
|
||||
if (abbreviation != null) {
|
||||
substitutedAbbreviation = substitute(abbreviation, Variance.INVARIANT);
|
||||
}
|
||||
|
||||
List<TypeProjection> substitutedArguments = substituteTypeArguments(
|
||||
type.getConstructor().getParameters(), type.getArguments(), recursionDepth);
|
||||
|
||||
KotlinType substitutedType =
|
||||
TypeSubstitutionKt.replace(type, substitutedArguments, substitution.filterAnnotations(type.getAnnotations()));
|
||||
if (substitutedType instanceof SimpleType && substitutedAbbreviation instanceof SimpleType) {
|
||||
substitutedType = SpecialTypesKt.withAbbreviation((SimpleType) substitutedType, (SimpleType) substitutedAbbreviation);
|
||||
}
|
||||
|
||||
return new TypeProjectionImpl(projectionKind, substitutedType);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
<!-- upperBoundViolatedInTypeAliasConstructorCall1 -->
|
||||
Type parameter bound for Tn in type inferred from type alias expansion for fun <T> <init>(x: T): Num<T>
|
||||
Type parameter bound for Tn in type inferred from type alias expansion for fun <T> <init>(x: T): N<T> /* = Num<T> */
|
||||
is not satisfied: inferred type String is not a subtype of Number
|
||||
Reference in New Issue
Block a user