Add on more example illustrating if/is issue.

This commit is contained in:
KtorZ 2024-07-27 09:27:38 +02:00 committed by Kasey
parent a6c5dbb5ad
commit 9ea54afd12
1 changed files with 17 additions and 0 deletions

View File

@ -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
}
}