added info about smart casts to diagnostic tests

This commit is contained in:
Svetlana Isakova
2013-12-06 20:12:41 +04:00
parent 00da5fe1fb
commit c30259dfbe
116 changed files with 383 additions and 348 deletions
@@ -1,6 +1,6 @@
// FILE: a.kt
package example.ns
val y : Any? = 2
val y : Any? = 2
// FILE: b.kt
package example
@@ -20,53 +20,53 @@ val x : Any? = 1
fun Any?.vars(<!UNUSED_PARAMETER!>a<!>: Any?) : Int {
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>b<!>: Int = 0
if (ns.y is Int) {
b = <!UNUSED_VALUE!>ns.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>ns.y<!>
}
if (ns.y is Int) {
b = <!UNUSED_VALUE!>example.ns.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>example.ns.y<!>
}
if (example.ns.y is Int) {
b = <!UNUSED_VALUE!>ns.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>ns.y<!>
}
if (example.ns.y is Int) {
b = <!UNUSED_VALUE!>example.ns.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>example.ns.y<!>
}
// if (namespace.bottles.ns.y is Int) {
// b = ns.y
// }
if (Obj.y is Int) {
b = <!UNUSED_VALUE!>Obj.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>Obj.y<!>
}
if (example.Obj.y is Int) {
b = <!UNUSED_VALUE!>Obj.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>Obj.y<!>
}
if (AClass.y is Int) {
b = <!UNUSED_VALUE!>AClass.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>AClass.y<!>
}
if (example.AClass.y is Int) {
b = <!UNUSED_VALUE!>AClass.y<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>AClass.y<!>
}
if (x is Int) {
b = <!UNUSED_VALUE!>x<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>x<!>
}
if (example.x is Int) {
b = <!UNUSED_VALUE!>x<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>x<!>
}
if (example.x is Int) {
b = <!UNUSED_VALUE!>example.x<!>
b = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>example.x<!>
}
return 1
}
fun Any?.foo() : Int {
if (this is Int)
return this
return <!DEBUG_INFO_AUTOCAST!>this<!>
if (this@foo is Int)
return this
return <!DEBUG_INFO_AUTOCAST!>this<!>
if (this@foo is Int)
return this@foo
return <!DEBUG_INFO_AUTOCAST!>this@foo<!>
if (this is Int)
return this@foo
return <!DEBUG_INFO_AUTOCAST!>this@foo<!>
return 1
}
@@ -77,16 +77,16 @@ open class C {
fun foo() {
var <!ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE!>t<!> : T? = null
if (this is T) {
t = <!UNUSED_VALUE!>this<!>
t = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>this<!>
}
if (this is T) {
t = <!UNUSED_VALUE!>this@C<!>
t = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>this@C<!>
}
if (this@C is T) {
t = <!UNUSED_VALUE!>this<!>
t = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>this<!>
}
if (this@C is T) {
t = <!UNUSED_VALUE!>this@C<!>
t = <!UNUSED_VALUE, DEBUG_INFO_AUTOCAST!>this@C<!>
}
}
}
}