diff options
Diffstat (limited to 'tests/bugs')
| -rw-r--r-- | tests/bugs/enum-init-cast.slang | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/bugs/enum-init-cast.slang b/tests/bugs/enum-init-cast.slang new file mode 100644 index 000000000..1b08c90f2 --- /dev/null +++ b/tests/bugs/enum-init-cast.slang @@ -0,0 +1,15 @@ +// enum-init-cast.slang +//TEST:SIMPLE: + +// Regression test for a bug around declaration checking order +// for `enum` types, which manifests when an `enum` case +// has an initializer that requires an implicit cast. + +enum class AAA +{ + // These cases use a `uint` literal for initialization, + // but the `enum` type will use `int` for its tags. + + BBB = 0u, + CCC = 1u, +}; |
