Add on more example illustrating if/is issue.
This commit is contained in:
parent
a6c5dbb5ad
commit
9ea54afd12
|
@ -60,3 +60,20 @@ test soft_casting_6() {
|
||||||
True
|
True
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type A {
|
||||||
|
A(Bool)
|
||||||
|
}
|
||||||
|
|
||||||
|
type B {
|
||||||
|
B(Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
test soft_casting_7() {
|
||||||
|
let data: Data = A(True)
|
||||||
|
if data is B(_): B {
|
||||||
|
False
|
||||||
|
} else {
|
||||||
|
True
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue