Skip to content

allow type aliasing of DefinedType#209

Merged
fibonacci1729 merged 1 commit into
bytecodealliance:mainfrom
ryan-surname-p:alias-non_primitive
Jun 30, 2026
Merged

allow type aliasing of DefinedType#209
fibonacci1729 merged 1 commit into
bytecodealliance:mainfrom
ryan-surname-p:alias-non_primitive

Conversation

@ryan-surname-p

Copy link
Copy Markdown
Contributor

closes #208

Currently CompositionGraphEncoder assumes all type aliases targeting a DefinedType have previously been exported.

This assumption does not hold true for inlined type alias definitions which causes a panic when CompositionGraphEncoder attempts to index a type which can't be found in the current scope.

To fix this we use an indirect lookup for the aliased type returning the previously issued id only when present in the current scope.

@fibonacci1729 fibonacci1729 self-requested a review June 29, 2026 20:09

@fibonacci1729 fibonacci1729 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! LGTM, thanks!

@ryan-surname-p

ryan-surname-p commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @fibonacci1729, since there don't seem to be an objections can we go ahead and merge this?

I have some in-flight work which I'd like to rebase on main with this fix if possible.

@fibonacci1729 fibonacci1729 merged commit d0a943f into bytecodealliance:main Jun 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CompositionGraphEncoder panics when encoding type aliases on a DefinedType

2 participants