- 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:
Christoffer Lerno
2026-02-13 20:39:47 +01:00
committed by GitHub
parent bbf89815d6
commit e299a4b630
12 changed files with 37 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
module test;
typedef Foo = int;
typedef Foo @constinit = int;
fn int test1()
{

View File

@@ -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;