feat(dart): add uint struct support to the codegen system#3192
feat(dart): add uint struct support to the codegen system#3192chaokunyang merged 3 commits intoapache:mainfrom
Conversation
|
Hey @chaokunyang |
|
For docs, you shoudl add it to |
|
But I think maybe we should first address #3132 first, before adding docs. If we add docs directly to |
Okk, i'll wait for that issue to be resolved and then begin with the documentation part, |
Hey @chaokunyang |
Why?
While the uint annotation types were integrated into the code generation system in the PR #3181 , there were two remaining issues:
@ForyKeyannotations, the code generator crashed with a null check error atkey_annotation_analyzer.dartWhat does this PR do?
1. Created Test Entity with Annotated Uint Fields
Added
uint_annotated_struct.dartdemonstrating all uint annotation variants:2. Added Comprehensive Test Suite
Created
uint_annotated_struct_test.dartwith test coverage for:Run tests:
3. Fixed Null Check Error in Key Annotation Analyzer
Problem: The
key_annotation_analyzer.dartwas attempting to access annotation fields even when no@ForyKeyannotation was present, causing a null check operator error.Solution: Added additional check to ensure we only access annotation fields when a
@ForyKeyannotation is actually found:Before
After
This ensures that:
getMetais true (meaning we found a@ForyKeyannotation)@ForyKeyannotations correctly default toincludeFromFory: trueandincludeToFory: trueRelated issues
Completes the uint annotation testing and fixes a critical bug that prevented code generation from working with fields lacking
@ForyKeyannotations.Does this PR introduce any user-facing change?
Does this PR introduce any public API change?
Does this PR introduce any binary protocol compatibility change?
Benchmark
N/A - This PR adds test coverage and fixes a code generation bug. No runtime performance impact.