fix inline struct field access and revert TryStatement flattening#10
Merged
fix inline struct field access and revert TryStatement flattening#10
Conversation
This reverts commit 60b7efc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
storeInterfaceMetadatawhere accessing fields on anonymous nested struct types (likestmt.catchClause.body) silently produced wrong values. Added a third branch that parses inline{ field: type; ... }type strings and stores proper metadata for chained member access.TryStatementflattening workaround (catchParam/catchBody→ nestedcatchClause: { param, body }) now that the root cause is fixed. This restores the natural TypeScript representation..claude/rules.md(prefer named AST types, comment style for codegen blocks).Changed files
src/codegen/expressions/access/member.ts— new inline struct branch instoreInterfaceMetadatasrc/ast/types.ts—TryStatementuses nestedcatchClauseagainsrc/parser-ts/handlers/statements.ts— producecatchClause: { param, body }src/parser-native/transformer.ts— producecatchClause: { param, body }src/analysis/semantic-analyzer.ts— readcatchClause.param/catchClause.bodysrc/ast/visitor.ts— walkcatchClause.bodysrc/codegen/infrastructure/closure-analyzer.ts— walkcatchClause.bodysrc/codegen/statements/control-flow.ts— readcatchClause.param/catchClause.body.claude/rules.md— code style sectionTest plan
lws-bridge.o)catchClausestructcatchClause.bodythrough the inline struct metadata path