package foo:foo; interface variants { enum e1 { a, } e1-arg: func(x: e1); e1-result: func() -> e1; // NB: this record used to be empty, but that's no longer valid, so now it's // non-empty. Don't want to delete the whole test however. record empty { not-empty-anymore: bool, } variant v1 { a, c(e1), d(string), e(empty), f, g(u32), } 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, option>, >; 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), } casts: func( a: casts1, b: casts2, c: casts3, d: casts4, e: casts5, f: casts6, ) -> tuple< casts1, casts2, casts3, casts4, casts5, casts6, >; result-arg: func( a: result, b: result<_, e1>, c: result, d: result, tuple>, e: result, f: result>, ); result-result: func() -> tuple< result, result<_, e1>, result, result, tuple>, result, result>, >; enum my-errno { bad1, bad2, } return-result-sugar: func() -> result; return-result-sugar2: func() -> result<_, my-errno>; return-result-sugar3: func() -> result; return-result-sugar4: func() -> result, my-errno>; return-option-sugar: func() -> option; return-option-sugar2: func() -> option; result-simple: func() -> result; record is-clone { v1: v1, } is-clone-arg: func(a: is-clone); is-clone-return: func() -> is-clone; return-named-option: func() -> (a: option); return-named-result: func() -> (a: result); variant no-data { a, b, } consumes-no-data: func(x: no-data); produces-no-data: func() -> no-data; } world my-world { import variants; export variants; }