checker: `as` type test

pull/5387/head
Alexander Medvednikov 2020-06-19 11:27:20 +02:00
parent d9dd9679e7
commit 274ecb71fa
2 changed files with 20 additions and 0 deletions

View File

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

View File

@ -0,0 +1,13 @@
type Expr = Int | String
struct Int {}
struct String {}
fn foo(e Expr) {
x := e as Stringg
println(x)
}
fn main() {
}