Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Augment decorators might not run if alias caused the type to be resolved too early #2603

Conversation

timotheeguerin
Copy link
Member

Issue is that when resolving symbol in the meta types and member resolution when we resolve an alias or template instance we check the type. However this makes it that every referenced typed from there on has already been resolved by the time the augment decorator gets to do the binding.

A fix for now is to have an option in the symnbol resolution to checkTemplateTypes or not. We do not check them during the binding phase but we do allow checking during the checking phase
#2600

@github-actions
Copy link
Contributor

Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status):
Playground: https://cadlplayground.z22.web.core.windows.net/prs/2603/

Website: https://tspwebsitepr.z22.web.core.windows.net/prs/2603/

@timotheeguerin timotheeguerin marked this pull request as ready for review October 25, 2023 03:20
@timotheeguerin timotheeguerin enabled auto-merge (squash) October 30, 2023 18:32
@timotheeguerin timotheeguerin merged commit 474dd12 into microsoft:main Oct 30, 2023
10 checks passed
@timotheeguerin timotheeguerin deleted the fix/augment-symbol-already-checked branch October 30, 2023 18:46
timotheeguerin added a commit that referenced this pull request Oct 31, 2023
This PR #2603 resolved an
issue where resolving meta types would cause types to be checked too
early but this broke some late bound symbol resolution.

It would return the declaration symbol when `checkTemplateTypes` is
false but would cache it. So in some cases it would then resolve the
wrong symbol later
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.

2 participants