Minor: change a test to be more precise

This commit is contained in:
pyos
2022-10-06 15:23:47 +02:00
committed by teamcity
parent a9ae1fcdf9
commit 3160470201
3 changed files with 11 additions and 11 deletions
@@ -1,16 +1,16 @@
class Box(var item: String?) class Box(var item: String?)
fun <T> take(it: T) {} fun expectString(it: String) {}
fun Box.test() { fun Box.test() {
val other = Box("") val other = Box("")
myRun { myRun {
if (item != null) { if (item != null) {
take<String>(<!SMARTCAST_IMPOSSIBLE!>item<!>) expectString(<!SMARTCAST_IMPOSSIBLE!>item<!>)
other.item = null other.item = null
take<String>(<!SMARTCAST_IMPOSSIBLE!>item<!>) expectString(<!SMARTCAST_IMPOSSIBLE!>item<!>)
this.item = null this.item = null
take<String>(<!ARGUMENT_TYPE_MISMATCH!>item<!>) expectString(<!ARGUMENT_TYPE_MISMATCH!>item<!>)
} }
} }
@@ -18,7 +18,7 @@ fun Box.test() {
myRun { myRun {
if (item != null) { if (item != null) {
this.item = null this.item = null
take<String>(item) expectString(item)
} }
} }
} }
@@ -1,16 +1,16 @@
class Box(var item: String?) class Box(var item: String?)
fun <T> take(it: T) {} fun expectString(it: String) {}
fun Box.test() { fun Box.test() {
val other = Box("") val other = Box("")
myRun { myRun {
if (item != null) { if (item != null) {
take<String>(<!SMARTCAST_IMPOSSIBLE!>item<!>) expectString(<!SMARTCAST_IMPOSSIBLE!>item<!>)
other.item = null other.item = null
take<String>(<!SMARTCAST_IMPOSSIBLE!>item<!>) expectString(<!SMARTCAST_IMPOSSIBLE!>item<!>)
this.item = null this.item = null
take<String>(<!TYPE_MISMATCH!>item<!>) expectString(<!TYPE_MISMATCH!>item<!>)
} }
} }
@@ -18,7 +18,7 @@ fun Box.test() {
myRun { myRun {
if (item != null) { if (item != null) {
this.item = null this.item = null
take<String>(<!DEBUG_INFO_SMARTCAST!>item<!>) expectString(<!DEBUG_INFO_SMARTCAST!>item<!>)
} }
} }
} }
@@ -1,7 +1,7 @@
package package
public fun expectString(/*0*/ it: kotlin.String): kotlin.Unit
public fun myRun(/*0*/ block: () -> kotlin.Unit): kotlin.Unit public fun myRun(/*0*/ block: () -> kotlin.Unit): kotlin.Unit
public fun </*0*/ T> take(/*0*/ it: T): kotlin.Unit
public fun Box.test(): kotlin.Unit public fun Box.test(): kotlin.Unit
public final class Box { public final class Box {