Files
c3c/test/test_suite/expressions/enum_ct_sub.c3t
Christoffer Lerno 5c77c9a754 - Change distinct -> typedef.
- Order of attribute declaration is changed for `alias`.
- Added `LANGUAGE_DEV_VERSION` env constant.
- Rename `anyfault` -> `fault`.
- Changed `fault` -> `faultdef`.
- Added `attrdef` instead of `alias` for attribute aliases.
2025-03-15 20:10:47 +01:00

18 lines
361 B
Plaintext

enum Foo : char
{
ABC,
BCD
}
typedef Abc = int;
fn void main()
{
$assert Foo.BCD - 1 == Foo.ABC;
$assert Foo.ABC + 1 == Foo.BCD;
$assert $typeof(Foo.BCD - 1).typeid == Foo.typeid;
$assert $typeof(Foo.ABC + 1).typeid == Foo.typeid;
Foo x = Foo.BCD;
$assert $typeof(x - 1).typeid == Foo.typeid;
x = x - 1;
$assert $typeof(x + 1).typeid == Foo.typeid;
}