mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
- Change typedef and const enums to not convert from literals by default. (#2934)
- Add `@constinit` to allow old typedef behaviour.
This commit is contained in:
committed by
GitHub
parent
bbf89815d6
commit
e299a4b630
@@ -1,6 +1,6 @@
|
||||
module test;
|
||||
|
||||
typedef Foo = int;
|
||||
typedef Foo @constinit = int;
|
||||
|
||||
fn int test1()
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ const enum Bde2 : int
|
||||
BAR = 100
|
||||
}
|
||||
|
||||
typedef Bde3 = int;
|
||||
typedef Bde3 @constinit = int;
|
||||
const BDE3_FOO = 2;
|
||||
const BDE3_BAR = 100;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user