package foo:variants; interface variants { enum e1 { a, } record single { f: u8, } variant v1 { a, c(e1), d(string), e(single), f, g(u32), } variant casts1 { a(s32), b(f32), } variant casts2 { a(f64), b(f32), } variant casts3 { a(f64), b(u64), } variant casts4 { a(u32), b(s64), } variant casts5 { a(f32), b(s64), } variant casts6 { a(tuple), b(tuple), } enum my-errno { bad1, bad2, } e1-arg: func(x: e1); e1-result: func() -> e1; v1-arg: func(x: v1); v1-result: func() -> v1; bool-arg: func(x: bool); bool-result: func() -> bool; option-arg: func(a: option, b: option>, c: option, d: option, e: option, g: option>); option-result: func() -> tuple, option>, option, option, option, option>>; casts: func(a: casts1, b: casts2, c: casts3, d: casts4, e: casts5, f: casts6) -> tuple; expected-arg: func(a: result, b: result<_, e1>, c: result, d: result, tuple>, e: result, f: result>); expected-result: func() -> tuple, result, result, tuple>, result, result>>; return-expected-sugar: func() -> result; return-expected-sugar2: func() -> result<_, my-errno>; return-expected-sugar3: func() -> result; return-expected-sugar4: func() -> result, my-errno>; return-option-sugar: func() -> option; return-option-sugar2: func() -> option; expected-simple: func() -> result; } world variants-world { import variants; }