"Unused value" error added to existed tests

This commit is contained in:
svtk
2011-11-24 15:59:44 +04:00
parent 97f377b529
commit a7bb30a18c
51 changed files with 342 additions and 203 deletions
@@ -2,5 +2,5 @@ fun test() {
var a : Any? = null
if (a is Any) else a = null;
while (a is Any) a = null
while (true) a = null
while (true) a = <warning>null</warning>
}
@@ -2,7 +2,7 @@ fun foo(u : Unit) : Int = 1
fun test() : Int {
foo(<error>1</error>)
val a : fun() : Unit = {
val <warning>a</warning> : fun() : Unit = {
foo(<error>1</error>)
}
return 1
@@ -32,7 +32,7 @@ fun evaluateAdd(expr: StringBuilder, numbers: ArrayList<Int>): Int {
fun evaluate(expr: StringBuilder, numbers: ArrayList<Int>): Int {
val lhs = evaluateAdd(expr, numbers)
if (expr.length() > 0) {
val c = expr.charAt(0)
val <warning>c</warning> = expr.charAt(0)
expr.deleteCharAt(0)
}
return lhs
+2 -2
View File
@@ -1,8 +1,8 @@
fun foo1() : fun (Int) : Int = { (x: Int) => x }
fun foo() {
val h : fun (Int) : Int = foo1();
val <warning>h</warning> : fun (Int) : Int = foo1();
h(1)
val m : fun (Int) : Int = {(a : Int) => 1}//foo1()
val <warning>m</warning> : fun (Int) : Int = {(a : Int) => 1}//foo1()
m(1)
}
+1 -1
View File
@@ -18,5 +18,5 @@ enum class Foo<T> {
fun box() {
val x: ProtocolState = ProtocolState.WAITING
val <warning>x</warning>: ProtocolState = ProtocolState.WAITING
}
@@ -11,7 +11,7 @@
bar = 1
this.bar
1 : Int
val a : Int =1
val <warning>a</warning> : Int =1
this : Foo
}
}