This commit is contained in:
agra
2026-02-24 18:17:33 +02:00
parent 630e76c319
commit 7a381e1b4c
4 changed files with 90 additions and 2 deletions

20
examples/issue-0004.sx Normal file
View File

@@ -0,0 +1,20 @@
// Issue: top-level constants from imported files are not visible
// COLOR_WHITE works after fix, but ALIGN_CENTER (struct with enum fields) does not.
// Error: undefined identifier 'ALIGN_CENTER'
#import "modules/std.sx";
#import "examples/issue-0004-defs.sx";
Thing :: struct {
color: Color;
alignment: Alignment;
make :: () -> Thing {
Thing.{ color = COLOR_WHITE, alignment = ALIGN_CENTER };
}
}
main :: () {
t := Thing.make();
print("{}\n", t.color.r);
}