Replace "jet" package name with "kotlin" in testData

This commit is contained in:
Alexander Udalov
2014-02-21 23:29:57 +04:00
parent f2b4c7fa3e
commit f7b6457139
763 changed files with 2314 additions and 2310 deletions
+21 -21
View File
@@ -131,55 +131,55 @@ fun f15(a : A?) {
fun getStringLength(obj : Any) : Char? {
if (obj !is String)
return null
return <info descr="Automatically cast to jet.String">obj</info>.get(0) // no cast to jet.String is needed
return <info descr="Automatically cast to kotlin.String">obj</info>.get(0) // no cast to kotlin.String is needed
}
fun toInt(i: Int?): Int = if (i != null) <info descr="Automatically cast to jet.Int">i</info> else 0
fun toInt(i: Int?): Int = if (i != null) <info descr="Automatically cast to kotlin.Int">i</info> else 0
fun illegalWhenBody(a: Any): Int = when(a) {
is Int -> <info descr="Automatically cast to jet.Int">a</info>
is String -> <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any but jet.Int was expected">a</error>
is Int -> <info descr="Automatically cast to kotlin.Int">a</info>
is String -> <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is kotlin.Any but kotlin.Int was expected">a</error>
else -> 1
}
fun illegalWhenBlock(a: Any): Int {
when(a) {
is Int -> return <info descr="Automatically cast to jet.Int">a</info>
is String -> return <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any but jet.Int was expected">a</error>
is Int -> return <info descr="Automatically cast to kotlin.Int">a</info>
is String -> return <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is kotlin.Any but kotlin.Int was expected">a</error>
else -> return 1
}
}
fun declarations(a: Any?) {
if (a is String) {
val <warning>p4</warning>: String = <info descr="Automatically cast to jet.String">a</info>
val <warning>p4</warning>: String = <info descr="Automatically cast to kotlin.String">a</info>
}
if (a is String?) {
if (a != null) {
val <warning>s</warning>: String = <info descr="Automatically cast to jet.String">a</info>
val <warning>s</warning>: String = <info descr="Automatically cast to kotlin.String">a</info>
}
}
if (a != null) {
if (a is String?) {
val <warning>s</warning>: String = <info descr="Automatically cast to jet.String">a</info>
val <warning>s</warning>: String = <info descr="Automatically cast to kotlin.String">a</info>
}
}
}
fun vars(a: Any?) {
var <warning>b</warning>: Int = 0
if (a is Int) {
b = <warning><info descr="Automatically cast to jet.Int">a</info></warning>
b = <warning><info descr="Automatically cast to kotlin.Int">a</info></warning>
}
}
fun returnFunctionLiteralBlock(<info>a</info>: Any?): Function0<Int> {
if (<info>a</info> is Int) return { <info descr="Automatically cast to jet.Int"><info>a</info></info> }
if (<info>a</info> is Int) return { <info descr="Automatically cast to kotlin.Int"><info>a</info></info> }
else return { 1 }
}
fun returnFunctionLiteral(<info>a</info>: Any?): Function0<Int> =
if (<info>a</info> is Int) { (): Int -> <info descr="Automatically cast to jet.Int"><info>a</info></info> }
if (<info>a</info> is Int) { (): Int -> <info descr="Automatically cast to kotlin.Int"><info>a</info></info> }
else { () -> 1 }
fun merge<TYPO descr="Typo: In word 'Autocasts'">Autocasts</TYPO>(a: Any?) {
if (a is String || a is Int) {
a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
<info descr="Automatically cast to jet.Any"><info>a</info></info>.toString()
<info descr="Automatically cast to kotlin.Any"><info>a</info></info>.toString()
}
if (a is Int || a is String) {
a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
@@ -188,9 +188,9 @@ fun merge<TYPO descr="Typo: In word 'Autocasts'">Autocasts</TYPO>(a: Any?) {
is String, is Any -> a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
}
if (a is String && a is Any) {
val <warning>i</warning>: Int = <info descr="Automatically cast to jet.String">a</info>.compareTo("")
val <warning>i</warning>: Int = <info descr="Automatically cast to kotlin.String">a</info>.compareTo("")
}
if (a is String && <info descr="Automatically cast to jet.String">a</info>.compareTo("") == 0) {}
if (a is String && <info descr="Automatically cast to kotlin.String">a</info>.compareTo("") == 0) {}
if (a is String || a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("") <error>==</error> 0) {}
}
@@ -198,10 +198,10 @@ fun merge<TYPO descr="Typo: In word 'Autocasts'">Autocasts</TYPO>(a: Any?) {
fun f(): String {
var <info>a</info>: Any = 11
if (<info>a</info> is String) {
val <warning>i</warning>: String = <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'jet.String' is impossible, because 'a' could have changed since the is-check">a</error>
<error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'jet.String' is impossible, because 'a' could have changed since the is-check">a</error>.compareTo("f")
val <warning>f</warning>: Function0<String> = { <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'jet.String' is impossible, because 'a' could have changed since the is-check">a</error> }
return <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'jet.String' is impossible, because 'a' could have changed since the is-check">a</error>
val <warning>i</warning>: String = <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'kotlin.String' is impossible, because 'a' could have changed since the is-check">a</error>
<error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'kotlin.String' is impossible, because 'a' could have changed since the is-check">a</error>.compareTo("f")
val <warning>f</warning>: Function0<String> = { <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'kotlin.String' is impossible, because 'a' could have changed since the is-check">a</error> }
return <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'kotlin.String' is impossible, because 'a' could have changed since the is-check">a</error>
}
return ""
}
@@ -209,14 +209,14 @@ fun f(): String {
fun foo(aa: Any): Int {
var a = aa
if (a is Int) {
return <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'jet.Int' is impossible, because 'a' could have changed since the is-check">a</error>
return <error descr="[AUTOCAST_IMPOSSIBLE] Automatic cast to 'kotlin.Int' is impossible, because 'a' could have changed since the is-check">a</error>
}
return 1
}
fun inForLoop(x: Any?) {
if (x is Array<String>) {
for (i in <info descr="Automatically cast to jet.Array<jet.String>">x</info>) {}
for (i in <info descr="Automatically cast to kotlin.Array<kotlin.String>">x</info>) {}
}
for (i in <error descr="[ITERATOR_MISSING] For-loop range must have an iterator() method">x</error>) {}
}