More tests for type alias constructor type parameters.
This commit is contained in:
Vendored
+9
@@ -12,6 +12,7 @@ val test2 = P<Int, Int>(1, 2)
|
||||
val test3 = P<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>(1, 2)
|
||||
|
||||
val test0p2 = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>P2<!>(1, 1)
|
||||
val test0p2a = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>P2<!>(1, "")
|
||||
val test1p2 = P2<Int>(1, 1)
|
||||
val test2p2 = P2<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int><!>(1, 1)
|
||||
val test3p2 = P2<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int, Int><!>(1, 1)
|
||||
@@ -21,3 +22,11 @@ val test1pr = PR<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!>(1, <!TYPE_MISMATCH!>"
|
||||
val test2pr = PR<Int, String>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, <!TYPE_MISMATCH!>""<!>)
|
||||
val test2pra = PR<String, Int>(1, "")
|
||||
val test3pr = P2<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><String, Int, Int><!>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, "")
|
||||
|
||||
class Num<T : Number>(val x: T)
|
||||
typealias N<T> = Num<T>
|
||||
|
||||
val testN0 = <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>N<!>("")
|
||||
val testN1 = N<Int>(1)
|
||||
val testN1a = N<<!UPPER_BOUND_VIOLATED!>String<!>>("")
|
||||
val testN2 = N<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int, Int><!>(1)
|
||||
|
||||
Vendored
+14
@@ -1,10 +1,12 @@
|
||||
package
|
||||
|
||||
public typealias N</*0*/ T> = Num<T>
|
||||
public typealias P</*0*/ T1, /*1*/ T2> = Pair<T1, T2>
|
||||
public typealias P2</*0*/ T> = Pair<T, T>
|
||||
public typealias PR</*0*/ T1, /*1*/ T2> = Pair<T2, T1>
|
||||
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>
|
||||
@@ -16,6 +18,18 @@ 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 testN0: Num<kotlin.String>
|
||||
public val testN1: Num<kotlin.Int>
|
||||
public val testN1a: Num<kotlin.String>
|
||||
public val testN2: Num<kotlin.Int>
|
||||
|
||||
public final class Num</*0*/ T : kotlin.Number> {
|
||||
public constructor Num</*0*/ T : kotlin.Number>(/*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)
|
||||
|
||||
Reference in New Issue
Block a user