checker: `as` type test
parent
d9dd9679e7
commit
274ecb71fa
|
@ -0,0 +1,7 @@
|
|||
x.v:7:9: error: unknown type `Stringg`
|
||||
5 |
|
||||
6 | fn foo(e Expr) {
|
||||
7 | x := e as Stringg
|
||||
| ~~
|
||||
8 | println(x)
|
||||
9 | }
|
|
@ -0,0 +1,13 @@
|
|||
type Expr = Int | String
|
||||
|
||||
struct Int {}
|
||||
struct String {}
|
||||
|
||||
fn foo(e Expr) {
|
||||
x := e as Stringg
|
||||
println(x)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
||||
}
|
Loading…
Reference in New Issue