Flesh out more text support for GC types in components #1813
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.
This commit builds on the work of #1764 to support the text format for GC types in components more than before. This notably bring support for:
(sub ...)
types in components and module types(rec ...)
groups in components and module typesThe main consequence of this work is that unlike most other
$foo
identifiers in the component model the identifiers found in types will not automatically inject outer aliases to refer to outer types. For example this will not parse:The reason for this is that automatic injection of an outer alias requires that types are resolved and then their names are registered. The resolution process queues up aliases to inject which are accounted for during registration when indices are assigned. Here though because types can refer to themselves (or future types in
rec
groups) the registration process has to happen first before resolution. This means that if resolution were to inject more type indices then that would mess up the indexes already assigned.This is hopefully relatively minor in terms of how often this'll bite someone. For now various changes have been made to the name resolution pass of components to handle this and some tests have been added too for both positive and negative situations.
Closes #1808