Unit.VALUE -> Unit in testData

This commit is contained in:
Zalim Bashorov
2014-07-12 21:25:00 +04:00
parent 4a8519615a
commit c767ffc3e7
49 changed files with 103 additions and 109 deletions
@@ -1,5 +1,5 @@
fun box(): String {
val a = if(true) {
}
return if (a.toString() == "Unit.VALUE") "OK" else "fail"
return if (a.toString() == "kotlin.Unit") "OK" else "fail"
}
@@ -1,9 +1,9 @@
fun main(args: Array<String>?) {
val y: Unit = Unit.VALUE //do not compile
val y: Unit = Unit //do not compile
A<Unit>() //do not compile
C<Unit>(Unit.VALUE) //do not compile
C<Unit>(Unit) //do not compile
//do not compile
System.out?.println(fff<Unit>(Unit.VALUE)) //do not compile
System.out?.println(fff<Unit>(Unit)) //do not compile
System.out?.println(id<Unit>(y)) //do not compile
System.out?.println(fff<Unit>(id<Unit>(y)) == id<Unit>(foreach(Array<Int>(0,{0}),{(e : Int) : Unit -> }))) //do not compile
}
@@ -14,7 +14,7 @@ val baz: String by StringHandler
val metadatas = IdentityHashMap<PropertyMetadata, Unit>()
fun record(p: PropertyMetadata) = metadatas.put(p, Unit.VALUE)
fun record(p: PropertyMetadata) = metadatas.put(p, Unit)
object IntHandler {
fun get(t: Any?, p: PropertyMetadata): Int { record(p); return 42 }
@@ -15,7 +15,7 @@ fun test2(a: A): Int {
}
fun test3(b: B): Int {
return b[Unit.VALUE, Unit.VALUE]
return b[Unit, Unit]
}
@@ -30,4 +30,4 @@ fun box() : String {
if (result != 2) return "fail3: $result"
return "OK"
}
}
@@ -2,10 +2,10 @@ tailRecursive fun foo(x: Int) {
return if (x > 0) {
(foo(x - 1))
}
else Unit.VALUE
else Unit
}
fun box(): String {
foo(1000000)
return "OK"
}
}
@@ -3,14 +3,14 @@ class D {
}
object P {
val u = Unit.VALUE
val u = Unit
val v by D()
var w = Unit.VALUE
var w = Unit
}
fun box(): String {
if (P.u != P.v) return "Fail uv"
P.w = Unit.VALUE
P.w = Unit
if (P.w != P.u) return "Fail w"
return "OK"
}
@@ -1,5 +1,5 @@
fun foo() {}
fun box(): String {
return if (foo() == Unit.VALUE) "OK" else "Fail"
return if (foo() == Unit) "OK" else "Fail"
}
+1 -1
View File
@@ -1,4 +1,4 @@
val c = Unit.VALUE
val c = Unit
val d = c
fun box(): String {
+1 -1
View File
@@ -11,7 +11,7 @@ fun quux(): Unit? = bar()
fun box(): String {
foo()
if (foo() != Unit.VALUE) return "Fail 1"
if (foo() != Unit) return "Fail 1"
if (foo() != bar()) return "Fail 2"
if (bar() != baz()) return "Fail 3"
if (baz() != quux()) return "Fail 4"
@@ -7,7 +7,5 @@ fun box(): String {
if (Unit != Unit) return "Fail Unit != Unit"
if (a.VALUE != Unit.VALUE) return "Fail a.VALUE != Unit.VALUE"
return "OK"
}