-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Transform/erasure #102
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
Merged
Merged
Transform/erasure #102
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
Review by @DarkDimius, @gzm0. Sheparding by @DarkDimius please. |
No, the parameter is different. Those tests now run through erasure. |
I am force-pushing a new request which contains more cleanups. |
A completer for a lazytype should run in the first phase of the validity period of the denotation that gets completed.
Need to update checkedPeriod when new denotation is computed.
If the arguments to a primitive conversion are not both numbers, the conversion will either return the argument itself, or throw a ClassCastException.
at the place forseen for the real pattern matcher, so that following transformations do not have to deal with patterns.
Methods appliedTo and translateParameterizes only apply before erasure (except on arrays). Also, computation of a potential expensive yet redundant lub in assignType(SeqLiteral) is avoided.
A list of names contains a phasegroup if it contains any phase in the group.
Right now uses a super-rudementary tree checker: we only check that every tree has a type.
1. Object_isInstanceOf/asInstanceOf are no longer parameterized methods (seems there's no point in writing x.$asInstanceOf[T]() instead of the shorter x.$asInstanceOf[T]). 2. Array constructor's type is unchanged (the previous rules erased it to def <init>(len: Int)Object which is clearly wrong). 3. indexing needs to be disabled. 4. typedTypeApply needs to keep type applications that apply to type tests and type casts as well as array ops. 5. References to self-ids are typed ThisType(cls) before erasure; are replaced by This(cls) references during erasure.
The transformation framework needed to be changed so that contexts passed to transformations have correct owner chains. These owner chins are demanded by the Splitter phase. Note: I eliminated the contexts array in TransformInfo because it interfered with the owner computations. Generally, caching contexts with some phase is best done in Contexts, because withPhase is also used heavily in othre code, not just in Transformers. New phase: Splitter When it is complete, it will make sure that every term Ident and Select node carries a symbol. Right now, all it does is coverting self reference idents to "this"-nodes.
clear is wrong. E.g. clearTyperState does not clear the typerstate at all. It installs a fresh (i.e. cloned) copy of the previous one. clearScope is also wrong; it installs a new scope, does not clear the current one.
withPhase operations in contexts are now memoized. Conflicts: src/dotty/tools/dotc/core/Contexts.scala
Refactored re-typing logic from erasure into seperate ReTyper class. Another candidate subclass of ReTyper is a future TreeChecker.
LGTM |
LGTM otherwise. |
How travis tests merged branches still puzzles me. |
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.
More fixes to erasure and handling phases in general.