mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- 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.
18 lines
361 B
Plaintext
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;
|
|
}
|