KT-1175 Mark unused literals

This commit is contained in:
svtk
2012-01-27 18:28:54 +04:00
parent ca1abed3a9
commit 11ad28812d
27 changed files with 183 additions and 89 deletions
+2 -2
View File
@@ -18,11 +18,11 @@ fun A.plus(<warning>a</warning> : Any) {
1.foo()
true.<error>foo</error>()
1
<warning>1</warning>
}
fun A.plus(<warning>a</warning> : Int) {
1
<warning>1</warning>
}
fun <T> T.minus(<warning>t</warning> : T) : Int = 1
+14 -12
View File
@@ -7,15 +7,17 @@ fun demo() {
fun buzz(f : () -> Any?) : Int = 1
val sdf = 1
val foo = 3;
"$abc"
"$"
"$.$.asdf$\t"
"asd\$"
"asd$a<error>\x</error>"
"asd$a$asd$ $<error>xxx</error>"
"fosdfasdo${1 + bar + 100}}sdsdfgdsfsdf"
"foo${bar + map {foo}}sdfsdf"
"foo${bar + map { "foo" }}sdfsdf"
"foo${bar + map {
"foo$sdf${ buzz{}}" }}sdfsdf"
}
use("$abc")
use("$")
use("$.$.asdf$\t")
use("asd\$")
use("asd$a<error>\x</error>")
use("asd$a$asd$ $<error>xxx</error>")
use("fosdfasdo${1 + bar + 100}}sdsdfgdsfsdf")
use("foo${bar + map {foo}}sdfsdf")
use("foo${bar + map { "foo" }}sdfsdf")
use("foo${bar + map {
"foo$sdf${ buzz{}}" }}sdfsdf")
}
fun use(<warning>s</warning>: String) {}
+3 -3
View File
@@ -108,7 +108,7 @@ fun t7() : Int {
<error>2</error>
}
catch (e : Any) {
2
<warning>2</warning>
}
return 1 // this is OK, like in Java
}
@@ -143,8 +143,8 @@ fun failtest(<warning>a</warning> : Int) : Int {
}
fun foo(a : Nothing) : Unit {
1
a
<warning>1</warning>
<warning>a</warning>
<error>2</error>
}