checker: add a known error on alias cast with generics (#13946)

pull/13953/head
Vincenzo Palazzo 2022-04-05 18:09:46 +02:00 committed by GitHub
parent 1482db6d1a
commit 6412f8ba0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
type ParseRes = Result<[]Token, ParseErr>
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 := Result<[]Token, ParseErr>(r)
}
None<ParseRes> {}
}
}