[fine] Implement the wildcard pattern

This commit is contained in:
John Doty 2024-02-04 19:36:47 -08:00
parent e0721d09fc
commit 65ec2d4cca
5 changed files with 104 additions and 25 deletions

View file

@ -12,6 +12,9 @@ fun test() -> f64 {
if b is c:Foo and c.a == 24 {
result = result + 10;
}
if b is c:_ {
result = result + 100; // underscore should always match!
}
if b is c:Foo {
result = result + c.a; // c should still be in scope!
}
@ -19,4 +22,4 @@ fun test() -> f64 {
}
// @no-errors
// @eval: Float(1001.0)
// @eval: Float(1101.0)