-
Notifications
You must be signed in to change notification settings - Fork 434
Remove DynType
and resculpt ast::Type
#1322
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
Open
tyranron
wants to merge
13
commits into
master
Choose a base branch
from
819-remove-dyntype
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
@audunhalland it would be nice if you provide some input of this, if you have time to spare. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Improvement of existing features or bugfix
k::api
Related to API (application interface)
k::performance
Related to performance
k::refactor
Refactoring, technical debt elimination and other improvements of existing code base
semver::breaking
Breaking change in terms of SemVer
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.
Follows #1247
Synopsis
In #1247 the
ast::Type
was made generic over the string type used for name.In the codebase, there are numerous places where it's required to convert both
ast::Type<ArcStr>
andast::Type<&str>
to some singular representation stored inValidatorContext
or similar places.However, the current
ast::Type
enum representation usingBox
es introduces a problem that it's not possible to cheaply receive a borrowed version ofast::Type<ArcStr>
asast::Type<&str>
without re-allocating all thoseBox
es. Furthermore, usingBox
es involves redundant re-allocations onClone
ing even when&str
is used.Thus, @audunhalland came up with a temporary
DynType
solution to solve this problem:The problem with this solution, that it duplicates
ast::Type
inner logic and pollutes some potentially public APIs.Solution
As @audunhalland kindly suggested in TODO comment:
This PR resculpts
ast::Type
in this manner:Checklist
CHANGELOG.md
updated