Skip to content

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 13 commits into from
Mar 31, 2014
Merged

Transform/erasure #102

merged 13 commits into from
Mar 31, 2014

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 29, 2014

More fixes to erasure and handling phases in general.

@odersky
Copy link
Contributor Author

odersky commented Mar 29, 2014

Review by @DarkDimius, @gzm0. Sheparding by @DarkDimius please.

@odersky
Copy link
Contributor Author

odersky commented Mar 30, 2014

No, the parameter is different. Those tests now run through erasure.

@odersky
Copy link
Contributor Author

odersky commented Mar 30, 2014

I am force-pushing a new request which contains more cleanups.

odersky and others added 13 commits March 31, 2014 14:52
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.
@DarkDimius
Copy link
Contributor

LGTM

@gzm0
Copy link
Contributor

gzm0 commented Mar 31, 2014

LGTM otherwise.

DarkDimius added a commit that referenced this pull request Mar 31, 2014
@DarkDimius DarkDimius merged commit e448049 into scala:master Mar 31, 2014
@DarkDimius
Copy link
Contributor

How travis tests merged branches still puzzles me.
Erasure revealed a typo in LazyVals which broke tests.
Good thing is that tests already prove themselves useful.
#106 is a fix

@allanrenucci allanrenucci deleted the transform/erasure branch December 14, 2017 19:25
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.

3 participants