1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

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