-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Dealias quoted types when staging #17059
Merged
nicolasstucki
merged 2 commits into
scala:main
from
dotty-staging:dealias-quoted-type-refrences
Mar 22, 2023
Merged
Dealias quoted types when staging #17059
nicolasstucki
merged 2 commits into
scala:main
from
dotty-staging:dealias-quoted-type-refrences
Mar 22, 2023
Conversation
This file contains 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
nicolasstucki
force-pushed
the
dealias-quoted-type-refrences
branch
4 times, most recently
from
March 8, 2023 10:26
027a39c
to
fbfddef
Compare
nicolasstucki
force-pushed
the
dealias-quoted-type-refrences
branch
from
March 10, 2023 16:59
fbfddef
to
62d1787
Compare
nicolasstucki
force-pushed
the
dealias-quoted-type-refrences
branch
4 times, most recently
from
March 14, 2023 15:40
a7a59c7
to
91d19ce
Compare
natsukagami
reviewed
Mar 16, 2023
nicolasstucki
force-pushed
the
dealias-quoted-type-refrences
branch
from
March 17, 2023 14:18
91d19ce
to
e7b8f61
Compare
natsukagami
approved these changes
Mar 18, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
This change improves the code generation of the contents of splices. In the splicing phase, we have to find all types that are defined in the quote but used in the splice. When there are type aliases, we can end up with several `Type[T]` for the different aliases of `T`. By dealiasing during the staging phase (just before splicing phase) we make sure that the splicer phase will only generate one `Type[T]`. By dealiasing we also optimize some situations where a type from outside a quote is inserted in the quoted code and then used in one of its splice through an alias. In this situation we can use the outer `Type[T]` directly.
nicolasstucki
force-pushed
the
dealias-quoted-type-refrences
branch
from
March 22, 2023 07:04
e7b8f61
to
d479de6
Compare
Rebased, conflicts were automatically resolved. |
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.
This change improves the code generation of the contents of splices. In the splicing phase, we have to find all types that are defined in the quote but used in the splice. When there are type aliases, we can end up with several
Type[T]
for the different aliases ofT
. By dealiasing during the staging phase (just before splicing phase) we make sure that the splicer phase will only generate oneType[T]
.By dealiasing we also optimize some situations where a type from outside a quote is inserted in the quoted code and then used in one of its splice through an alias. In this situation we can use the outer
Type[T]
directly.Example
After staging the following code should get what is in the comments