checker: ensure that the variant SubType exists

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
pull/14006/head
Vincenzo Palazzo 2022-04-10 23:00:24 +02:00
parent c780de6282
commit 11fc34c7d0
No known key found for this signature in database
GPG Key ID: 8B6DC2B870B80D5F
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
type ParseRes = Result<[]Token, ParseErr>
// Token type is unknown
//struct Token {}
struct ParseErr {}
type Opt<T> = None<T> | Some<T>
struct None<T> {}
struct Some<T> {
value T
}
type Result<T, U> = Err<U> | Ok<T>
struct Ok<T> {
value T
}
struct Err<U> {
value U
}
fn test_report() {
r := Opt<ParseRes>(None<ParseRes>{})
match r {
Some<ParseRes> {
rx := r.value
}
None<ParseRes> {}
}
}