zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

test_comptime_invalid_enum_cast.zig (208B) - Raw


      1 const Foo = enum {
      2     a,
      3     b,
      4     c,
      5 };
      6 comptime {
      7     const a: u2 = 3;
      8     const b: Foo = @enumFromInt(a);
      9     _ = b;
     10 }
     11 
     12 // test_error=enum 'test_comptime_invalid_enum_cast.Foo' has no tag with value '3'