Fix generic struct pointer instantiation bug #105#109
Fix generic struct pointer instantiation bug #105#109Zuhaitz-dev merged 9 commits intozenc-lang:mainfrom
Conversation
Regression Fixes & ImprovementsWhile verifying the generic struct pointer fix, I identified and resolved two additional regressions:
|
|
Any thoughts on adding a debug branch? |
|
Looks good, I am not home, but there I will check it properly and surely merge it. Related to a debug branch, I don't think it would be a bad idea. What I do think is that we should have an experimental branch or similar. The language is still green, but having something like this would be useful already. |
fix merge conflicts and zenc-lang#105
Fix deprecated syntax in tests/generics/test_generics_struct.zc
|
Looks good to me |
bug where generic structs referenced only via pointers (for example,
RcInner<T>*insideRc<T>) were not being instantiated, leading to compilation errors.The issue stemmed from the parser discarding structured type information for struct
fields and the instantiation logic failing to recurse into generic pointer types.
As a result, dependencies nested deep within generic struct definitions were not
detected or generated.
issue #105
What Changed
ensuring generic relationships are retained.
nested generic pointer types.
Verification
This behavior is verified by the included
Rc<T>test case. WhenRc<i32>is used,the compiler now correctly instantiates
RcInner_int32_t, confirming that genericdependencies referenced only through pointers are properly detected and generated.
Files Changed
src/parser/parser_struct.cUpdated to capture and store structured type information for fields.
src/parser/parser_utils.cEnhanced instantiation logic to handle generic pointers and fixed name parsing.
tests/generics/test_generics_struct.zcAdded regression test for recursive generic pointer instantiation.