changed tests where autocasts aren't needed but are reported
due to KT-4294
This commit is contained in:
@@ -17,16 +17,17 @@ fun main(args : Array<String>) {
|
|||||||
d<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
d<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// auto cast isn't needed, but is reported due to KT-4294
|
||||||
if (d is String) {
|
if (d is String) {
|
||||||
d<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
<!DEBUG_INFO_AUTOCAST!>d<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d is String?) {
|
if (d is String?) {
|
||||||
if (d != null) {
|
if (d != null) {
|
||||||
d<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
<!DEBUG_INFO_AUTOCAST!>d<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||||
}
|
}
|
||||||
if (d is String) {
|
if (d is String) {
|
||||||
d<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
<!DEBUG_INFO_AUTOCAST!>d<!><!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,16 @@ trait C: A
|
|||||||
|
|
||||||
fun test(a: A, b: B, c: C) {
|
fun test(a: A, b: B, c: C) {
|
||||||
if (a is B && a is C) {
|
if (a is B && a is C) {
|
||||||
val d: C = id(a)
|
val d: C = id(<!DEBUG_INFO_AUTOCAST!>a<!>)
|
||||||
val e: Any = id(a)
|
val e: Any = id(a)
|
||||||
val f = id(a)
|
val f = id(a)
|
||||||
f: A
|
f: A
|
||||||
val g = two(a, b)
|
val g = two(<!DEBUG_INFO_AUTOCAST!>a<!>, b)
|
||||||
g: B
|
g: B
|
||||||
g: A
|
g: A
|
||||||
|
|
||||||
val h: Any = two(a, b)
|
// auto cast isn't needed, but is reported due to KT-4294
|
||||||
|
val h: Any = two(<!DEBUG_INFO_AUTOCAST!>a<!>, b)
|
||||||
|
|
||||||
val k = three(a, b, c)
|
val k = three(a, b, c)
|
||||||
k: A
|
k: A
|
||||||
|
|||||||
Reference in New Issue
Block a user