// issue-0042 — const-decl type alias must resolve through
// `type_alias_map` when used as a `$T: Type` argument to size_of /
// align_of, not silently fall back to .s64 (8 bytes).
// Also covers identifier-RHS aliases (chains + struct aliases),
// not just *T / [N]T / ?T forms.
#import "modules/std.sx";

MyInt   :: s32;
MyChain :: MyInt;
Wide    :: struct { a: s64; b: s64; }
WideAlias :: Wide;

main :: () -> s32 {
    print("direct s32:        {}\n", size_of(s32));
    print("alias s32:         {}\n", size_of(MyInt));
    print("chain s32:         {}\n", size_of(MyChain));
    print("align alias:       {}\n", align_of(MyInt));
    print("align chain:       {}\n", align_of(MyChain));
    print("size struct-alias: {}\n", size_of(WideAlias));
    print("align struct-alias:{}\n", align_of(WideAlias));
    0;
}
