deprecating types after colon
This commit is contained in:
@@ -17,10 +17,10 @@ fun test() {
|
||||
val c: Int = <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>id<!>(9223372036854775807)
|
||||
|
||||
val d = id(22)
|
||||
d: Int
|
||||
checkSubtype<Int>(d)
|
||||
|
||||
val e = id(9223372036854775807)
|
||||
e checkType { it : _<Long> }
|
||||
e checkType { _<Long>() }
|
||||
|
||||
val f: Byte = either(1, 2)
|
||||
|
||||
@@ -31,7 +31,7 @@ fun test() {
|
||||
<!TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH!>otherGeneric<!>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
|
||||
|
||||
val r = either(1, "")
|
||||
r checkType { it : _<Comparable<*>> }
|
||||
r checkType { _<Comparable<*>>() }
|
||||
|
||||
use(a, b, c, d, e, f, g, r)
|
||||
}
|
||||
@@ -47,7 +47,7 @@ fun testExactBound(invS: Inv<String>, invI: Inv<Int>, invB: Inv<Byte>) {
|
||||
exactBound(1, invI)
|
||||
|
||||
val b = exactBound(1, invB)
|
||||
b checkType { it : _<Byte> }
|
||||
b checkType { _<Byte>() }
|
||||
}
|
||||
|
||||
trait Cov<out T>
|
||||
@@ -56,10 +56,10 @@ fun <T> lowerBound(t: T, l : Cov<T>): T = throw Exception("$t $l")
|
||||
|
||||
fun testLowerBound(cov: Cov<String>, covN: Cov<Number>) {
|
||||
val r = lowerBound(1, cov)
|
||||
r checkType { it : _<Comparable<*>> }
|
||||
r checkType { _<Comparable<*>>() }
|
||||
|
||||
val n = lowerBound(1, covN)
|
||||
n checkType { it : _<Number> }
|
||||
n checkType { _<Number>() }
|
||||
}
|
||||
|
||||
trait Contr<in T>
|
||||
@@ -70,8 +70,8 @@ fun testUpperBound(contrS: Contr<String>, contrB: Contr<Byte>, contrN: Contr<Num
|
||||
<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>upperBound<!>(1, contrS)
|
||||
|
||||
val n = upperBound(1, contrN)
|
||||
n checkType { it : _<Int> }
|
||||
n checkType { _<Int>() }
|
||||
|
||||
val b = upperBound(1, contrB)
|
||||
b checkType { it : _<Byte> }
|
||||
b checkType { _<Byte>() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user