include only checker error

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
pull/13974/head
Vincenzo Palazzo 2022-04-13 13:45:17 +02:00
parent 93856f82c6
commit 579ac32cce
No known key found for this signature in database
GPG Key ID: 8B6DC2B870B80D5F
3 changed files with 33 additions and 10 deletions

View File

@ -0,0 +1 @@
// THE END.

View File

@ -0,0 +1,32 @@
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> {
// make possible cast fo the same type!
rx := Result<[]Token, ParseErr>(r.value)
}
None<ParseRes> {}
}
}

View File

@ -1,10 +0,0 @@
struct Empty {}
type IndexNumber = u32
type NameIndexType = Empty | IndexNumber
fn test_casting_with_sumtype_and_alias() {
elem := NameIndexType(Empty{})
if elem is IndexNumber {
}
}