removing static type assertions work in progress

This commit is contained in:
Dmitry Jemerov
2015-10-07 12:19:37 +02:00
parent 8f87efc0a2
commit 1523d5bcbf
149 changed files with 514 additions and 867 deletions
+9 -13
View File
@@ -1,6 +1,5 @@
== foo ==
fun foo(a: Any) {
a : String
a as String
a as? String
}
@@ -10,20 +9,17 @@ L0:
v(a: Any)
magic[FAKE_INITIALIZER](a: Any) -> <v0>
w(a|<v0>)
2 mark({ a : String a as String a as? String })
mark(a : String)
r(a) -> <v1>
magic[CAST](a : String|<v1>) -> <v2>
2 mark({ a as String a as? String })
mark(a as String)
r(a) -> <v3>
magic[CAST](a as String|<v3>) -> <v4>
r(a) -> <v1>
magic[CAST](a as String|<v1>) -> <v2>
mark(a as? String)
r(a) -> <v5>
magic[CAST](a as? String|<v5>) -> <v6>
r(a) -> <v3>
magic[CAST](a as? String|<v3>) -> <v4>
L1:
1 <END> NEXT:[<SINK>]
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
<SINK> PREV:[<ERROR>, <END>]
=====================
-1
View File
@@ -1,5 +1,4 @@
fun foo(a: Any) {
a : String
a as String
a as? String
}
+6 -9
View File
@@ -1,16 +1,13 @@
== foo ==
fun foo(a: Any) {
a : String
a as String
a as? String
}
---------------------
<v0>: {<: Any} NEW: magic[FAKE_INITIALIZER](a: Any) -> <v0>
a <v1>: * NEW: r(a) -> <v1>
a : String <v2>: * NEW: magic[CAST](a : String|<v1>) -> <v2>
a <v3>: * NEW: r(a) -> <v3>
a as String <v4>: * NEW: magic[CAST](a as String|<v3>) -> <v4>
a <v5>: * NEW: r(a) -> <v5>
a as? String <v6>: * NEW: magic[CAST](a as? String|<v5>) -> <v6>
{ a : String a as String a as? String } <v6>: * COPY
<v0>: {<: Any} NEW: magic[FAKE_INITIALIZER](a: Any) -> <v0>
a <v1>: * NEW: r(a) -> <v1>
a as String <v2>: * NEW: magic[CAST](a as String|<v1>) -> <v2>
a <v3>: * NEW: r(a) -> <v3>
a as? String <v4>: * NEW: magic[CAST](a as? String|<v3>) -> <v4>
{ a as String a as? String } <v4>: * COPY
=====================
@@ -15,8 +15,11 @@ class E : C(), D
fun box(): String {
val e = E()
if (e.foo() != 222) return "Fail 1"
if ((e : D).foo() != 222) return "Fail 2"
if ((e : C).foo() != 222) return "Fail 3"
if ((e : A).foo() != 222) return "Fail 4"
val d: D = e
val c: C = e
val a: A = e
if (d.foo() != 222) return "Fail 2"
if (c.foo() != 222) return "Fail 3"
if (a.foo() != 222) return "Fail 4"
return "OK"
}
+8 -4
View File
@@ -20,9 +20,13 @@ class E : D, C()
fun box(): String {
val e = E()
var r = e.foo()[0]
r += (e : D).foo().iterator().next()
r += (e : C).foo()[0]
r += (e : B).foo()[0]
r += (e : A).foo()[0]
val d: D = e
val c: C = e
val b: B = e
val a: A = e
r += d.foo().iterator().next()
r += c.foo()[0]
r += b.foo()[0]
r += a.foo()[0]
return if (r == "BBBBB") "OK" else "Fail: $r"
}
+4 -1
View File
@@ -8,4 +8,7 @@ class B : A<String> {
class C(a: A<String>) : A<String> by a
fun box() = (C(B()) : A<String>).foo()
fun box(): String {
val a: A<String> = C(B())
return a.foo()
}
@@ -11,5 +11,5 @@ fun box(): String {
val b: A<String> = B(o)
b.result = "OK"
if (b.result != "OK") return "Fail"
return (b : A<String>).result
return b.result
}
+7 -4
View File
@@ -13,11 +13,14 @@ class Z : B<Int>, C<String> {
fun box(): String {
val z = Z()
val c: C<String> = z
val b: B<Int> = z
val a: A<String, Int> = z
return when {
z.foo("", 0) != "Z" -> "Fail #1"
(z : C<String>).foo("", 0) != "Z" -> "Fail #2"
(z : B<Int>).foo("", 0) != "Z" -> "Fail #3"
(z : A<String, Int>).foo("", 0) != "Z" -> "Fail #4"
z.foo("", 0) != "Z" -> "Fail #1"
c.foo("", 0) != "Z" -> "Fail #2"
b.foo("", 0) != "Z" -> "Fail #3"
a.foo("", 0) != "Z" -> "Fail #4"
else -> "OK"
}
}
@@ -13,14 +13,18 @@ class Z2 : B, A<Int>
fun box(): String {
val z1 = Z1()
val z2 = Z2()
val z1a: A<Int> = z1
val z1b: B = z1
val z2a: A<Int> = z2
val z2b: B = z2
return when {
z1.foo( 0) != "B" -> "Fail #1"
(z1 : A<Int>).foo( 0) != "B" -> "Fail #2"
(z1 : B).foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
(z2 : A<Int>).foo( 0) != "B" -> "Fail #5"
(z2 : B).foo( 0) != "B" -> "Fail #6"
z1.foo( 0) != "B" -> "Fail #1"
z1a.foo( 0) != "B" -> "Fail #2"
z1b.foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
z2a.foo( 0) != "B" -> "Fail #5"
z2b.foo( 0) != "B" -> "Fail #6"
else -> "OK"
}
}
@@ -13,14 +13,18 @@ class Z2 : B<Int>, A<Int>
fun box(): String {
val z1 = Z1()
val z2 = Z2()
val z1a: A<Int> = z1
val z1b: B<Int> = z1
val z2a: A<Int> = z2
val z2b: B<Int> = z2
return when {
z1.foo( 0) != "B" -> "Fail #1"
(z1 : A<Int>).foo( 0) != "B" -> "Fail #2"
(z1 : B<Int>).foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
(z2 : A<Int>).foo( 0) != "B" -> "Fail #5"
(z2 : B<Int>).foo( 0) != "B" -> "Fail #6"
z1.foo( 0) != "B" -> "Fail #1"
z1a.foo( 0) != "B" -> "Fail #2"
z1b.foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
z2a.foo( 0) != "B" -> "Fail #5"
z2b.foo( 0) != "B" -> "Fail #6"
else -> "OK"
}
}
@@ -12,8 +12,9 @@ class Foo: Class(), Trait<String> {
}
fun box(): String {
val t: Trait<String> = Foo()
try {
(Foo() : Trait<String>).f()
t.f()
} catch (e: UnsupportedOperationException) {
return "OK"
}
@@ -15,14 +15,18 @@ class Z2 : B by Z(), A<Int>
fun box(): String {
val z1 = Z1()
val z2 = Z2()
val z1a: A<Int> = z1
val z1b: B = z1
val z2a: A<Int> = z2
val z2b: B = z2
return when {
z1.foo( 0) != "B" -> "Fail #1"
(z1 : A<Int>).foo( 0) != "B" -> "Fail #2"
(z1 : B).foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
(z2 : A<Int>).foo( 0) != "B" -> "Fail #5"
(z2 : B).foo( 0) != "B" -> "Fail #6"
z1.foo( 0) != "B" -> "Fail #1"
z1a.foo( 0) != "B" -> "Fail #2"
z1b.foo( 0) != "B" -> "Fail #3"
z2.foo( 0) != "B" -> "Fail #4"
z2a.foo( 0) != "B" -> "Fail #5"
z2b.foo( 0) != "B" -> "Fail #6"
else -> "OK"
}
}
@@ -17,7 +17,9 @@ class C : A, B()
fun box(): String {
val c = C()
c.foo = "1"
(c : B).foo = "2"
(c : A).foo = "3"
val b: B = c
val a: A = c
b.foo = "2"
a.foo = "3"
return if (result == "123") "OK" else "Fail: $result"
}
@@ -21,8 +21,11 @@ class D4 : D3
fun box(): String {
val x = D4()
x.foo()
(x : D3).foo()
(x : F2).foo()
(x : D1).foo()
val d3: D3 = x
val f2: F2 = x
val d1: D1 = x
d3.foo()
f2.foo()
d1.foo()
return if (result == "D3D3D3D3") "OK" else "Fail: $result"
}
@@ -11,8 +11,10 @@ class C : A, B
fun box(): String {
val c = C()
var result = ""
val b: B = c
val a: A = c
result += c.foo()
result += (c : B).foo()
result += (c : A).foo()
result += b.foo()
result += a.foo()
return if (result == "AAA") "OK" else "Fail: $result"
}
@@ -17,9 +17,14 @@ class F5 : F3, D4()
fun box(): String {
val z = F5()
var result = z.foo()
result += (z : D4).foo()
result += (z : F3).foo() as Int
result += (z : D2).foo() as Int
result += (z : D1).foo() as Int
val d4: D4 = z
val f3: F3 = z
val d2: D2 = z
val d1: D1 = z
result += d4.foo()
result += f3.foo() as Int
result += d2.foo() as Int
result += d1.foo() as Int
return if (result == 5 * 42) "OK" else "Fail: $result"
}
@@ -10,7 +10,9 @@ class C(value: String) : A(value), B
fun box(): String {
val c = C("OK")
if ((c : B).component1() != "OK") return "Fail 1"
if ((c : A).component1() != "OK") return "Fail 2"
val b: B = c
val a: A = c
if (b.component1() != "OK") return "Fail 1"
if (a.component1() != "OK") return "Fail 2"
return c.component1()
}
+4 -2
View File
@@ -13,7 +13,9 @@ fun box(): String {
val myStringList = StringList()
myStringList.add("first element")
if (myStringList.get(0) != "StringList.get()") return "Fail #1"
if ((myStringList: BaseStringList).get(0) != "StringList.get()") return "Fail #2"
if ((myStringList: ArrayList<String>).get(0) != "StringList.get()") return "Fail #3"
val b: BaseStringList = myStringList
val a: ArrayList<String> = myStringList
if (b.get(0) != "StringList.get()") return "Fail #2"
if (a.get(0) != "StringList.get()") return "Fail #3"
return "OK"
}
+2 -1
View File
@@ -18,6 +18,7 @@ class B : A<Child> {
fun box(): String {
val b = B()
b.foo(Child())
(b : A<Child>).foo(Child())
val a: A<Child> = b
a.foo(Child())
return if (result == "BB") "OK" else "Fail: $result"
}
@@ -17,12 +17,16 @@ class Z : D() {
fun box(): String {
val z = Z()
val d: D = z
val c: C = z
val b: B<String> = z
val a: A<String> = z
return when {
z.foo("") != "Z" -> "Fail #1"
(z : D).foo("") != "Z" -> "Fail #2"
(z : C).foo("") != "Z" -> "Fail #3"
(z : B<String>).foo("") != "Z" -> "Fail #4"
(z : A<String>).foo("") != "Z" -> "Fail #5"
z.foo("") != "Z" -> "Fail #1"
d.foo("") != "Z" -> "Fail #2"
c.foo("") != "Z" -> "Fail #3"
b.foo("") != "Z" -> "Fail #4"
a.foo("") != "Z" -> "Fail #5"
else -> "OK"
}
}
@@ -13,11 +13,14 @@ class Z : C<Double>() {
fun box(): String {
val z = Z()
val c: C<Double> = z
val b: B<String, Double> = z
val a: A<String, Int, Double> = z
return when {
z.foo("", 0, 0.0) != "Z" -> "Fail #1"
(z : C<Double>).foo("", 0, 0.0) != "Z" -> "Fail #2"
(z : B<String, Double>).foo("", 0, 0.0) != "Z" -> "Fail #3"
(z : A<String, Int, Double>).foo("", 0, 0.0) != "Z" -> "Fail #4"
z.foo("", 0, 0.0) != "Z" -> "Fail #1"
c.foo("", 0, 0.0) != "Z" -> "Fail #2"
b.foo("", 0, 0.0) != "Z" -> "Fail #3"
a.foo("", 0, 0.0) != "Z" -> "Fail #4"
else -> "OK"
}
}
+3 -2
View File
@@ -8,9 +8,10 @@ class Z<T> : A<T, Int> {
fun box(): String {
val z = Z<Int>()
val a: A<Int, Int> = z
return when {
z.foo(0, 0) != "Z" -> "Fail #1"
(z : A<Int, Int>).foo(0, 0) != "Z" -> "Fail #2"
z.foo(0, 0) != "Z" -> "Fail #1"
a.foo(0, 0) != "Z" -> "Fail #2"
else -> "OK"
}
}
@@ -16,7 +16,9 @@ class C : B {
fun box(): String {
val c = C()
var r = c.foo().iterator().next()
r += (c : B).foo().iterator().next()
r += (c : A).foo().iterator().next()
val b: B = c
val a: A = c
r += b.foo().iterator().next()
r += a.foo().iterator().next()
return if (r == "CCC") "OK" else "Fail: $r"
}
+2 -1
View File
@@ -13,7 +13,8 @@ fun box(): String {
"Fail 1"
} catch (e: AssertionError) {
try {
(B() : HashSet<String>).clone()
val hs: HashSet<String> = B()
hs.clone()
"Fail 2"
} catch (e: AssertionError) {
"OK"
+3 -2
View File
@@ -9,9 +9,10 @@ class Z : A<String>() {
fun box(): String {
val z = Z()
val a: A<String> = z
return when {
z.foo("") != "Z" -> "Fail #1"
(z : A<String>).foo("") != "Z" -> "Fail #2"
z.foo("") != "Z" -> "Fail #1"
a.foo("") != "Z" -> "Fail #2"
else -> "OK"
}
}
+4 -4
View File
@@ -11,10 +11,10 @@ enum class Z(val name: String) : A<String> {
fun box(): String {
return when {
Z.Z1.foo("") != "Z1" -> "Fail #1"
Z.Z2.foo("") != "Z2" -> "Fail #2"
(Z.Z1 : A<String>).foo("") != "Z1" -> "Fail #3"
(Z.Z2 : A<String>).foo("") != "Z2" -> "Fail #4"
Z.Z1.foo("") != "Z1" -> "Fail #1"
Z.Z2.foo("") != "Z2" -> "Fail #2"
(Z.Z1 as A<String>).foo("") != "Z1" -> "Fail #3"
(Z.Z2 as A<String>).foo("") != "Z2" -> "Fail #4"
else -> "OK"
}
}
@@ -9,9 +9,10 @@ class Z : A<String>() {
fun box(): String {
val z = Z()
val a: A<String> = z
return when {
z.foo("", 0) != "Z" -> "Fail #1"
(z : A<String>).foo("", 0) != "Z" -> "Fail #2"
z.foo("", 0) != "Z" -> "Fail #1"
a.foo("", 0) != "Z" -> "Fail #2"
else -> "OK"
}
}
+6 -4
View File
@@ -11,11 +11,13 @@ fun box(): String {
val z = object : A<String>() {
override fun foo(t: String) = "z"
}
val az: A<String> = Z
val a: A<String> = z
return when {
Z.foo("") != "Z" -> "Fail #1"
z.foo("") != "z" -> "Fail #2"
(Z : A<String>).foo("") != "Z" -> "Fail #3"
(z : A<String>).foo("") != "z" -> "Fail #4"
Z.foo("") != "Z" -> "Fail #1"
z.foo("") != "z" -> "Fail #2"
az.foo("") != "Z" -> "Fail #3"
a.foo("") != "z" -> "Fail #4"
else -> "OK"
}
}
+3 -2
View File
@@ -8,9 +8,10 @@ class Z : A<Int>(17) {
fun box(): String {
val z = Z()
val a: A<Int> = z
return when {
z.foo() != 239 -> "Fail #1"
(z : A<Int>).foo() != 239 -> "Fail #2"
z.foo() != 239 -> "Fail #1"
a.foo() != 239 -> "Fail #2"
else -> "OK"
}
}
+3 -2
View File
@@ -7,9 +7,10 @@ class Z : A<String>
fun box(): String {
val z = Z()
val a: A<String> = z
return when {
z.foo("") != "A" -> "Fail #1"
(z : A<String>).foo("") != "A" -> "Fail #2"
z.foo("") != "A" -> "Fail #1"
a.foo("") != "A" -> "Fail #2"
else -> "OK"
}
}
+3 -2
View File
@@ -9,9 +9,10 @@ class Z : A<Int>() {
fun box(): String {
val z = Z()
val a: A<Int> = z
return when {
z.foo(0) != "Z" -> "Fail #1"
(z : A<Int>).foo(0) != "Z" -> "Fail #2"
z.foo(0) != "Z" -> "Fail #1"
a.foo(0) != "Z" -> "Fail #2"
else -> "OK"
}
}
@@ -11,10 +11,12 @@ class Z : B() {
fun box(): String {
val z = Z()
val b: B = z
val a: A<String> = z
return when {
z.foo("") != "Z" -> "Fail #1"
(z : B).foo("") != "Z" -> "Fail #2"
(z : A<String>).foo("") != "Z" -> "Fail #3"
z.foo("") != "Z" -> "Fail #1"
b.foo("") != "Z" -> "Fail #2"
a.foo("") != "Z" -> "Fail #3"
else -> "OK"
}
}
@@ -10,10 +10,12 @@ class Z : B() {
fun box(): String {
val z = Z()
val b: B = z
val a: A<Int, Number> = z
return when {
z.foo(0, 0) != "Z" -> "Fail #1"
(z : B).foo(0, 0) != "Z" -> "Fail #2"
(z : A<Int, Number>).foo(0, 0) != "Z" -> "Fail #3"
z.foo(0, 0) != "Z" -> "Fail #1"
b.foo(0, 0) != "Z" -> "Fail #2"
a.foo(0, 0) != "Z" -> "Fail #3"
else -> "OK"
}
}
@@ -13,5 +13,6 @@ class D : A<String> by C()
fun box(): String {
val d = D()
if (d.id("") != "") return "Fail"
return (d : A<String>).id("OK")
val a: A<String> = d
return a.id("OK")
}
@@ -12,13 +12,17 @@ enum class Z(val name: String) : B {
fun box(): String {
val z1b: B = Z.Z1
val z2b: B = Z.Z2
val z1a: A<String> = Z.Z1
val z2a: A<String> = Z.Z2
return when {
Z.Z1.foo("") != "Z1" -> "Fail #1"
Z.Z2.foo("") != "Z2" -> "Fail #2"
(Z.Z1 : B).foo("") != "Z1" -> "Fail #3"
(Z.Z2 : B).foo("") != "Z2" -> "Fail #4"
(Z.Z1 : A<String>).foo("") != "Z1" -> "Fail #5"
(Z.Z2 : A<String>).foo("") != "Z2" -> "Fail #6"
Z.Z1.foo("") != "Z1" -> "Fail #1"
Z.Z2.foo("") != "Z2" -> "Fail #2"
z1b.foo("") != "Z1" -> "Fail #3"
z2b.foo("") != "Z2" -> "Fail #4"
z1a.foo("") != "Z1" -> "Fail #5"
z2a.foo("") != "Z2" -> "Fail #6"
else -> "OK"
}
}
@@ -11,10 +11,12 @@ class Z : B() {
fun box(): String {
val z = Z()
val b: B = z
val a: A<String> = z
return when {
z.foo("", 0) != "Z" -> "Fail #1"
(z : B).foo("", 0) != "Z" -> "Fail #2"
(z : A<String>).foo("", 0) != "Z" -> "Fail #3"
z.foo("", 0) != "Z" -> "Fail #1"
b.foo("", 0) != "Z" -> "Fail #2"
a.foo("", 0) != "Z" -> "Fail #3"
else -> "OK"
}
}
@@ -13,13 +13,18 @@ fun box(): String {
val o = object : B() {
override fun foo(t: String) = "o"
}
val zb: B = Z
val ob: B = o
val za: A<String> = Z
val oa: A<String> = o
return when {
Z.foo("") != "Z" -> "Fail #1"
o.foo("") != "o" -> "Fail #2"
(Z : B).foo("") != "Z" -> "Fail #3"
(o : B).foo("") != "o" -> "Fail #4"
(Z : A<String>).foo("") != "Z" -> "Fail #5"
(o : A<String>).foo("") != "o" -> "Fail #6"
Z.foo("") != "Z" -> "Fail #1"
o.foo("") != "o" -> "Fail #2"
zb.foo("") != "Z" -> "Fail #3"
ob.foo("") != "o" -> "Fail #4"
za.foo("") != "Z" -> "Fail #5"
oa.foo("") != "o" -> "Fail #6"
else -> "OK"
}
}
@@ -9,4 +9,7 @@ class Z : B() {
}
fun box() = (Z() : A<String>).foo
fun box(): String {
val a: A<String> = Z()
return a.foo
}
@@ -11,10 +11,12 @@ class Z : B() {
fun box(): String {
val z = Z()
val b: B = z
val a: A<String> = z
return when {
z.foo("") != "Z" -> "Fail #1"
(z : B).foo("") != "Z" -> "Fail #2"
(z : A<String>).foo("") != "Z" -> "Fail #3"
z.foo("") != "Z" -> "Fail #1"
b.foo("") != "Z" -> "Fail #2"
a.foo("") != "Z" -> "Fail #3"
else -> "OK"
}
}
@@ -11,10 +11,12 @@ class Z : B() {
fun box(): String {
val z = Z()
val b: B = z
val a: A<Int> = z
return when {
z.foo(0) != "Z" -> "Fail #1"
(z : B).foo(0) != "Z" -> "Fail #2"
(z : A<Int>).foo(0) != "Z" -> "Fail #3"
z.foo(0) != "Z" -> "Fail #1"
b.foo(0) != "Z" -> "Fail #2"
a.foo(0) != "Z" -> "Fail #3"
else -> "OK"
}
}
@@ -10,6 +10,8 @@ class C : B
fun box(): String {
val c = C()
var r = c.foo() + (c : B).foo() + (c : A).foo()
val b: B = c
val a: A = c
var r = c.foo() + b.foo() + a.foo()
return if (r == "BBB") "OK" else "Fail: $r"
}
@@ -17,13 +17,17 @@ class Z2 : B<String, Int>, A<String> {
fun box(): String {
val z1 = Z1()
val z2 = Z2()
val z1a: A<String> = z1
val z1b: B<String, Int> = z1
val z2a: A<String> = z2
val z2b: B<String, Int> = z2
return when {
z1.foo("", 0) != "Z1" -> "Fail #1"
(z1 : A<String>).foo("", 0) != "Z1" -> "Fail #2"
(z1 : B<String, Int>).foo("", 0) != "Z1" -> "Fail #3"
z2.foo("", 0) != "Z2" -> "Fail #4"
(z2 : A<String>).foo("", 0) != "Z2" -> "Fail #5"
(z2 : B<String, Int>).foo("", 0) != "Z2" -> "Fail #6"
z1.foo("", 0) != "Z1" -> "Fail #1"
z1a.foo("", 0) != "Z1" -> "Fail #2"
z1b.foo("", 0) != "Z1" -> "Fail #3"
z2.foo("", 0) != "Z2" -> "Fail #4"
z2a.foo("", 0) != "Z2" -> "Fail #5"
z2b.foo("", 0) != "Z2" -> "Fail #6"
else -> "OK"
}
}
@@ -13,10 +13,12 @@ class Z : A<Int>, B<Int> {
fun box(): String {
val z = Z()
val a: A<Int> = z
val b: B<Int> = z
return when {
z.foo(0) != "Z" -> "Fail #1"
(z : A<Int>).foo(0) != "Z" -> "Fail #2"
(z : B<Int>).foo(0) != "Z" -> "Fail #3"
z.foo(0) != "Z" -> "Fail #1"
a.foo(0) != "Z" -> "Fail #2"
b.foo(0) != "Z" -> "Fail #3"
else -> "OK"
}
}
+1 -1
View File
@@ -4,7 +4,7 @@ class Point(val x:Int, val y:Int) {
}
}
val m = Point(2, 3).mul() : (scalar:Int)->Point
val m = Point(2, 3).mul()
fun box() : String {
val answer = m(5)
+1 -3
View File
@@ -2,9 +2,7 @@ fun box(): String {
var x = 1
(foo@ x)++
++(foo@ x)
(x: Int)++
++(x: Int)
if (x != 5) return "Fail: $x"
if (x != 3) return "Fail: $x"
return "OK"
}
+1 -1
View File
@@ -1,5 +1,5 @@
fun box(): String {
val c = '0': Char?
val c: Char? = '0'
c!!.toInt()
"123456"?.get(0)!!.toInt()
@@ -1,6 +1,6 @@
fun box(): String {
try {
if ((null : Int?)!! == 10) return "Fail #1"
if ((null as Int?)!! == 10) return "Fail #1"
return "Fail #2"
}
catch (e: Exception) {
+2 -1
View File
@@ -7,6 +7,7 @@ class AImpl : A {
}
public fun box() : String {
(AImpl() : A).v
val a: A = AImpl()
a.v
return "OK"
}
+2 -1
View File
@@ -2,7 +2,8 @@ abstract class C {
fun test(x: Int) {
if (x == 0) return
if (this is D) {
(this: D).test(x - 1)
val d: D = this
d.test(x - 1)
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ fun box(): String {
val y = x
if (!isNullGeneric(y)) return "Fail 3"
if (!deepIsNull((null : Unit?) ?: null)) return "Fail 4"
if (!deepIsNull(x ?: null)) return "Fail 4"
return "OK"
}
+6 -6
View File
@@ -50,8 +50,8 @@ fun box(): String {
val aZ = BooleanArray(3)
if (barB(*aB, 23: Byte).size() != 4) return "fail: Byte"
if (barB(11: Byte, *aB, 23: Byte, *aB).size() != 8) return "fail: Byte"
if (barB(*aB, 23.toByte()).size() != 4) return "fail: Byte"
if (barB(11.toByte(), *aB, 23.toByte(), *aB).size() != 8) return "fail: Byte"
if (barC(*aC, 'A').size() != 4) return "fail: Char"
if (barC('A', *aC, 'A', *aC).size() != 8) return "fail: Char"
@@ -80,11 +80,11 @@ fun box(): String {
if (concatParameters(*aI, 7, 8, *bI) != "1237845") return "fail: concatParameters 6"
if (concatParameters(*aI, 7, *bI, *aI, 9) != "1237451239") return "fail: concatParameters 7"
if (barJ(*aJ, 23: Long).size() != 4) return "fail: Long"
if (barJ(*aJ, 23: Long, *aJ, *aJ).size() != 10) return "fail: Long"
if (barJ(*aJ, 23L).size() != 4) return "fail: Long"
if (barJ(*aJ, 23L, *aJ, *aJ).size() != 10) return "fail: Long"
if (barS(*aS, 23: Short).size() != 4) return "fail: Short"
if (barS(*aS, *aS, 23: Short, *aS).size() != 10) return "fail: Short"
if (barS(*aS, 23.toShort()).size() != 4) return "fail: Short"
if (barS(*aS, *aS, 23.toShort(), *aS).size() != 10) return "fail: Short"
if (barZ(*aZ, true).size() != 4) return "fail: Boolean"
if (barZ(false, *aZ, true, *aZ).size() != 8) return "fail: Boolean"
@@ -1,7 +1,8 @@
fun box(): String {
val sub = Sub()
val sup: Super = sub
(sub : Super).foo{ }
sup.foo{ }
if (sub.lastCalled != "super") {
return "FAIL: ${sub.lastCalled} instead of super"
}
@@ -2,14 +2,12 @@ import java.util.Arrays.equals
fun box(): String {
val s = arrayOf("live", "long")
val t = s.clone()
t : Array<String>
val t: Array<String> = s.clone()
if (!equals(s, t)) return "Fail string"
if (s identityEquals t) return "Fail string identity"
val ss = arrayOf(s, s)
val tt = ss.clone()
tt : Array<Array<String>>
val tt: Array<Array<String>> = ss.clone()
if (!equals(ss, tt)) return "Fail string[]"
if (ss identityEquals tt) return "Fail string[] identity"
@@ -18,11 +18,11 @@ fun box() : String {
b[0] = 1
assertEquals(1, b[0])
val x = 1 : Int?
val x: Int? = 1
assertEquals(1, x!!.hashCode())
val y = 1000 : Int?
val z = 1000 : Int?
val y: Int? = 1000
val z: Int? = 1000
val res = y.identityEquals(z)
val c1: Any = if (1 == 1) 0 else "abc"
@@ -13,11 +13,11 @@ fun foo() {
val b = arrayOfNulls<Int>(4)
b[100] = 5
val x = 6 : Int?
val x: Int? = 6
val hc = x!!.hashCode()
val y = 7 : Int?
val z = 8 : Int?
val y: Int? = 7
val z: Int? = 8
val res = y.identityEquals(z)
val c1: Any = if (1 == 1) 0 else "abc"
@@ -2,8 +2,6 @@ fun main(args: Array<String>) {
var i = 10
++i
++(l@ i)
++(i: Int)
++(l@ (i: Int))
}
// 4 IINC
// 2 IINC
+1 -1
View File
@@ -4,6 +4,6 @@ fun foo(s: String): String? {
return "no message";
}
catch(e: NumberFormatException) {
return (e : Throwable).getMessage(); // Work around an overload-resolution bug
return e.getMessage(); // Work around an overload-resolution bug
}
}
@@ -3,7 +3,7 @@ fun foo(<!UNRESOLVED_REFERENCE!><!SYNTAX!><!>varargs<!> <!UNUSED_PARAMETER!>f<!>
var bar : Int = 1
set(<!UNRESOLVED_REFERENCE!><!SYNTAX!><!>varargs<!> v) {}
val x : (Int) -> Int = {<!UNRESOLVED_REFERENCE!>@varargs<!> <!TYPE_MISMATCH!>x<!> <!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> x<!>}
val x : (Int) -> Int = {<!UNRESOLVED_REFERENCE!>@varargs<!> <!TYPE_MISMATCH!>x<!> <!SYNTAX!>: Int -> x<!>}
class Hello(<!UNRESOLVED_REFERENCE!><!SYNTAX!><!>varargs<!> <!UNUSED_PARAMETER!>args<!>: Any) {
}
@@ -6,7 +6,7 @@ fun foo(@test <!UNUSED_PARAMETER!>f<!> : Int) {}
var bar : Int = 1
set(@test v) {}
val x : (Int) -> Int = {@test <!TYPE_MISMATCH!>x<!> <!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> x<!>} // todo fix parser annotation on lambda parameter
val x : (Int) -> Int = {@test <!TYPE_MISMATCH!>x<!> <!SYNTAX!>: Int -> x<!>} // todo fix parser annotation on lambda parameter
class Hello(@test <!UNUSED_PARAMETER!>args<!>: Any) {
}
@@ -1,5 +0,0 @@
package t
fun foo(array: Array<Int>) {
(array[0] : Int) = 22
}
@@ -1,5 +0,0 @@
package
package t {
public fun foo(/*0*/ array: kotlin.Array<kotlin.Int>): kotlin.Unit
}
@@ -1,21 +1,21 @@
val receiver = { Int.(<!SYNTAX!><!>) <!SYNTAX!>-><!> }
val receiverWithParameter = { Int.<!ILLEGAL_SELECTOR!>(<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!>)<!> <!SYNTAX!>-><!> }
val receiverAndReturnType = { Int.(<!SYNTAX!><!>): Int <!SYNTAX!>-> 5<!> }
val receiverAndReturnTypeWithParameter = { Int.<!ILLEGAL_SELECTOR!>(<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!>: <!DEBUG_INFO_MISSING_UNRESOLVED!>Int<!>)<!>: Int <!SYNTAX!>-> 5<!> }
val receiverAndReturnType = { Int.(<!SYNTAX!><!>)<!SYNTAX!>: Int -> 5<!> }
val receiverAndReturnTypeWithParameter = { Int.(<!DEBUG_INFO_MISSING_UNRESOLVED!>a<!><!SYNTAX!><!SYNTAX!><!>: Int): Int -> 5<!> }
val returnType = { (<!SYNTAX!><!>): Int <!SYNTAX!>-> 5<!> }
val returnTypeWithParameter = { (<!UNRESOLVED_REFERENCE!>b<!>: Int)<!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> 5<!> }
val returnType = { (<!SYNTAX!><!>)<!SYNTAX!>: Int -> 5<!> }
val returnTypeWithParameter = { (<!UNRESOLVED_REFERENCE!>b<!><!SYNTAX!><!SYNTAX!><!>: Int): Int -> 5<!> }
val receiverWithFunctionType = { ((Int)<!SYNTAX!><!> <!SYNTAX!>-> Int).() -><!> }
val parenthesizedParameters = { (<!UNRESOLVED_REFERENCE!>a<!>: Int) <!SYNTAX!>-><!> }
val parenthesizedParameters = { (<!UNRESOLVED_REFERENCE!>a<!><!SYNTAX!><!SYNTAX!><!>: Int) -><!> }
val parenthesizedParameters2 = { (<!UNRESOLVED_REFERENCE!>b<!>) <!SYNTAX!>-><!> }
val none = { -> }
val parameterWithFunctionType = { <!UNRESOLVED_REFERENCE!>a<!>: ((Int) -> Int) -> <!SYNTAX!><!>} // todo fix parser
val parameterWithFunctionType = { <!UNRESOLVED_REFERENCE!>a<!><!SYNTAX!>: ((Int) -> Int) -><!> } // todo fix parser
val newSyntax = { a: Int -> }
val newSyntax1 = { <!CANNOT_INFER_PARAMETER_TYPE!>a<!>, <!CANNOT_INFER_PARAMETER_TYPE!>b<!> -> }
@@ -6,13 +6,13 @@ public val newSyntax2: (kotlin.Int, kotlin.Int) -> kotlin.Unit
public val newSyntax3: (???, kotlin.Int) -> kotlin.Unit
public val newSyntax4: (kotlin.Int, ???) -> kotlin.Unit
public val none: () -> kotlin.Unit
public val parameterWithFunctionType: () -> ((kotlin.Int) -> kotlin.Int) -> [ERROR : No type element]
public val parenthesizedParameters: () -> kotlin.Int
public val parameterWithFunctionType: () -> ???
public val parenthesizedParameters: () -> ???
public val parenthesizedParameters2: () -> ???
public val receiver: () -> ???
public val receiverAndReturnType: () -> kotlin.Int
public val receiverAndReturnTypeWithParameter: () -> kotlin.Int
public val receiverAndReturnType: () -> ???
public val receiverAndReturnTypeWithParameter: () -> ???
public val receiverWithFunctionType: () -> kotlin.Int.Companion
public val receiverWithParameter: () -> ???
public val returnType: () -> kotlin.Int
public val returnTypeWithParameter: () -> kotlin.Int
public val returnType: () -> ???
public val returnTypeWithParameter: () -> ???
@@ -1,4 +1,4 @@
fun foo() {
@Suppress("warnings")
("": String??)
("" as String??)
}
-4
View File
@@ -9,10 +9,6 @@ fun test() {
?.length
str
: String
str
as String
-12
View File
@@ -41,18 +41,6 @@ JetFile: NewLinesValidOperations.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('length')
PsiWhiteSpace('\n\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('str')
PsiWhiteSpace('\n\n ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('String')
PsiWhiteSpace('\n\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('str')
-10
View File
@@ -26,15 +26,12 @@ fun foo() {
1 foo 2 ?: 1 bar 3
a b c d e f g
a ?: b in b?: c
(a : b) < b : c
a < b == b > c
a != b && c
a || b && c
a = b -> c
a = b || c
t : Any
t : Any?
t as Any<T>?
t as Any.Any<T>.Any<T>
t as () -> T
@@ -42,17 +39,10 @@ fun foo() {
t as? Any.Any<T>.Any<T>
t as? () -> T
t : Any * 1
t : Any? * 1
t as Any<T>? * 1
t as Any.Any<T>.Any<T> * 1
t as () -> T * 1
t as? Any<T>? * 1
t as? Any.Any<T>.Any<T> * 1
t as? () -> T * 1
++t : Any + 1
a.b : Any + 1
(t : Any) * 1
}
+1 -165
View File
@@ -576,37 +576,6 @@ JetFile: Precedence.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(LT)('<')
PsiWhiteSpace(' ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
BINARY_EXPRESSION
REFERENCE_EXPRESSION
@@ -697,32 +666,6 @@ JetFile: Precedence.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('c')
PsiWhiteSpace('\n\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiWhiteSpace('\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiElement(QUEST)('?')
PsiWhiteSpace('\n ')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
@@ -879,46 +822,6 @@ JetFile: Precedence.kt
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('T')
PsiWhiteSpace('\n\n ')
BINARY_EXPRESSION
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(MUL)('*')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiElement(QUEST)('?')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(MUL)('*')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
@@ -1116,72 +1019,5 @@ JetFile: Precedence.kt
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n\n ')
BINARY_EXPRESSION
BINARY_WITH_TYPE
PREFIX_EXPRESSION
OPERATION_REFERENCE
PsiElement(PLUSPLUS)('++')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
BINARY_WITH_TYPE
DOT_QUALIFIED_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a')
PsiElement(DOT)('.')
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('b')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(PLUS)('+')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n\n ')
BINARY_EXPRESSION
PARENTHESIZED
PsiElement(LPAR)('(')
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('t')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Any')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(MUL)('*')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('1')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiElement(RBRACE)('}')
-1
View File
@@ -44,7 +44,6 @@ val foo.bar = 5
fun foo() {
val foo = 5
get() = 5
set(int : x) = 5
}
val IList<T>.lastIndex : Int
-26
View File
@@ -338,32 +338,6 @@ JetFile: Properties.kt
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('5')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
CALL_EXPRESSION
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('set')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('int')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiElement(RPAR)(')')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(EQ)('=')
PsiWhiteSpace(' ')
INTEGER_CONSTANT
PsiElement(INTEGER_LITERAL)('5')
PsiWhiteSpace('\n')
PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n')
@@ -5,5 +5,4 @@ class A2 @Ann2("")(x: Int) : B {
class A3 @[Ann3] private @(x: Int)
class A4 @[Ann4] @private @(x: Int)
class A5 private @Ann4(x: Int) : B
class A6 @[Ann5] @private @ @[Ann6]()
@@ -150,48 +150,6 @@ JetFile: primaryConstructor.kt
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiWhiteSpace('\n')
CLASS
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('A5')
PsiWhiteSpace(' ')
PRIMARY_CONSTRUCTOR
MODIFIER_LIST
PsiElement(private)('private')
PsiWhiteSpace(' ')
ANNOTATION_ENTRY
PsiElement(AT)('@')
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Ann4')
VALUE_ARGUMENT_LIST
PsiElement(LPAR)('(')
VALUE_ARGUMENT
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('Int')
PsiElement(RPAR)(')')
PsiErrorElement:Expecting 'constructor' keyword
<empty list>
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST
DELEGATOR_SUPER_CLASS
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('B')
PsiWhiteSpace('\n')
CLASS
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,6 +1,5 @@
fun test() {
x as? X ?: return
x as? X? : return
x as X? ?: return
X?::x
@@ -33,28 +33,6 @@ JetFile: nullableTypes.kt
RETURN
PsiElement(return)('return')
PsiWhiteSpace('\n ')
BINARY_WITH_TYPE
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('x')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(AS_SAFE)('as?')
PsiWhiteSpace(' ')
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('X')
PsiElement(QUEST)('?')
PsiWhiteSpace(' ')
OPERATION_REFERENCE
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
TYPE_REFERENCE
PsiErrorElement:Type expected
PsiElement(return)('return')
PsiWhiteSpace('\n ')
BINARY_EXPRESSION
BINARY_WITH_TYPE
REFERENCE_EXPRESSION
+22 -22
View File
@@ -17,40 +17,40 @@ class Inv<T>() {
fun testInOut() {
In<String>().`In.f:T->Unit`f("1");
(return : In<in String>).`In.f:T->Unit`f("1");
(return : In<out String>).`In.f:Int->Int`f("1")
(return : In<*>).`In.f:Int->Int`f("1");
(return as In<in String>).`In.f:T->Unit`f("1");
(return as In<out String>).`In.f:Int->Int`f("1")
(return as In<*>).`In.f:Int->Int`f("1");
In<String>().`In.f:Int->Int`f(1);
(return : In<in String>).`In.f:Int->Int`f(1);
(return : In<out String>).`In.f:Int->Int`f(1)
(return : In<out String>).`!`f1(1)
(return : In<*>).`In.f:Int->Int`f(1);
(return as In<in String>).`In.f:Int->Int`f(1);
(return as In<out String>).`In.f:Int->Int`f(1)
(return as In<out String>).`!`f1(1)
(return as In<*>).`In.f:Int->Int`f(1);
Out<Int>().`Out.f(a)`f(1)
(return : Out<out Int>).`Out.f(a)`f(1)
(return : Out<in Int>).`Out.f(a)`f(1)
(return : Out<*>).`Out.f(a)`f(1)
(return as Out<out Int>).`Out.f(a)`f(1)
(return as Out<in Int>).`Out.f(a)`f(1)
(return as Out<*>).`Out.f(a)`f(1)
Out<Int>().`Out.f`f()
(return : Out<out Int>).`Out.f`f()
(return : Out<in Int>).`Out.f`f()
(return : Out<*>).`Out.f`f()
(return as Out<out Int>).`Out.f`f()
(return as Out<in Int>).`Out.f`f()
(return as Out<*>).`Out.f`f()
Inv<Int>().`Inv.f`f(1)
(return : Inv<in Int>).`Inv.f`f(1)
(return : Inv<out Int>).`!`f(1)
(return : Inv<*>).`!`f(1)
(return as Inv<in Int>).`Inv.f`f(1)
(return as Inv<out Int>).`!`f(1)
(return as Inv<*>).`!`f(1)
Inv<Int>().`Inv.inf`inf(1)
(return : Inv<in Int>).`Inv.inf`inf(1)
(return : Inv<out Int>).`!`inf(1)
(return : Inv<*>).`!`inf(1)
(return as Inv<in Int>).`Inv.inf`inf(1)
(return as Inv<out Int>).`!`inf(1)
(return as Inv<*>).`!`inf(1)
Inv<Int>().`Inv.outf`outf()
((return : Inv<in Int>).`Inv.outf`outf())`:kotlin::Any`
(return : Inv<out Int>).`Inv.outf`outf()
(return : Inv<*>).`Inv.outf`outf()
((return as Inv<in Int>).`Inv.outf`outf())`:kotlin::Any`
(return as Inv<out Int>).`Inv.outf`outf()
(return as Inv<*>).`Inv.outf`outf()
Inv<Int>().`Inv.outf`outf(1)
}
+2 -2
View File
@@ -8,8 +8,8 @@ import java.`java::java.util`util.*
fun <T> t(t : T) : T {
`c`c(java.lang.Integer(1))
System.out.`java::java.io.PrintStream.print(Object)`print(t)
System.out.`java::java.io.PrintStream.print(char[])`print(null : CharArray)
System.out.`java::java.io.PrintStream.print(Object)`print(null : Object?)
System.out.`java::java.io.PrintStream.print(char[])`print(null as CharArray?)
System.out.`java::java.io.PrintStream.print(Object)`print(null as Object?)
System.out.`java::java.io.PrintStream.print(Int)`print(1)
System.out.`java::java.io.PrintStream.print(Double)`print(1.0)
}
@@ -22,16 +22,3 @@ annotation class Primitives(
boolean = true
)
class C
@Primitives(
byte = 7: Byte,
char = '%': Char,
short = 239: Short,
int = 239017: Int,
long = 123456789123456789L: Long,
float = 2.72f: Float,
double = -3.14: Double,
boolean = true: Boolean
)
class D
@@ -4,10 +4,6 @@ package test
public constructor C()
}
@test.Primitives(boolean = true, byte = 7.toByte(), char = \u0025 ('%'), double = -3.14.toDouble(), float = 2.72.toFloat(), int = 239017, long = 123456789123456789.toLong(), short = 239.toShort()) public final class D {
public constructor D()
}
@kotlin.annotation.annotation() public final class Primitives : kotlin.Annotation {
public constructor Primitives(/*0*/ byte: kotlin.Byte, /*1*/ char: kotlin.Char, /*2*/ short: kotlin.Short, /*3*/ int: kotlin.Int, /*4*/ long: kotlin.Long, /*5*/ float: kotlin.Float, /*6*/ double: kotlin.Double, /*7*/ boolean: kotlin.Boolean)
public final val boolean: kotlin.Boolean