| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Accessors were multiply generated under separate compilation.
To fix this, the resident body of an inlined function is now
the same as the inlined body. Both use accessors where necessary.
Previously, only the inlined body used accessors.
|
|
|
|
|
|
|
| |
1. Imlement typedUnapply
2. Disable implicit view searches and searches
for equality checks - these should have already
happened in the first typer run.
|
|
|
|
|
|
|
|
| |
1. Better formatting in TreeChecker error message
2. Re-enable printing what stack of what was checked
when an error occurred. This was disabled in Retyper
because we did not do it for the Inliner typer.
Now we distinguish on phase instead.
|
|
|
|
|
| |
To be done: outer accessors
To be done: error positions
|
|
|
|
|
|
| |
Roll its functionality into Select. Since we can always
tell whether a tree is a type or term there is no expressiveness
gained by having a separate tree node.
|
|
|
|
|
|
|
| |
One drawback with this approach is that the type seems to propagate.
I.e. if the return type of an expression is `repeated` then the
enclosing variable will get the `repeated` type instead of getting the
expected `Seq` type
|
|
|
|
|
|
|
| |
The field keeps track of the element type. This is necessary
because JavaSeqLiteral is nonvariant and the elements might
be empty, so we cannot always compute the type from the
element types.
|
|
|
|
|
|
| |
Instead of simply dropping all Retyper error traces, we now
send them to the config.Printers.transforms printer, so what happens depends
on the value of that printer.
|
|
|
|
|
|
| |
I looked a some of the failures so far, and in each case we got
a huge "exception while typing" cascade but then no actual error!
Buffer overflow? To find out more I disabled the trace for now.
|
| |
|
| |
|
|
|
|
|
|
| |
Previously, stackoverflows led to infinite loops because the catch
immediately threw another stack overflow. Anyway, one should never
catch Throwable.
|
|
|
|
| |
Typed MemberDef trees now take the modifiers from their symbol's data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original problem was that in an expression
f(x = bar(y = z))
only the outer named arg was eliminated by FirstTransform.
The first error was that the postcondition in FirstTransform did not get to the named arg, because
it got called from the overrdden typed method in TreeChecker, yet function arguments were evaluated
with typedUnadapted.
action: change Retyper and TreeChecker to override typedUndapped instead of typed.
This flushed out the second error: transformOther in FirstTransform needs to recursively transform the argument
of a NamedArg, because the framework itself does not handle NamedArg nodes.
Now, all tests pass except that TreeChecker itself fails -Ycheck:gettersSetters due to a problem
with handling by-name function types. This should be fixed in a separate PR.
|
| |
|
| |
|
|
|
|
|
| |
If there's a crash, we always want to see where the retyper was, not just for
tree checking.
|
|
|
|
|
|
|
| |
Outer paths, parameters and arguments are inserted in erasure, using methods provided
by OuterAccessors.
Also fixed a stupid bug in Erasure#constant
|
|
|
|
|
|
|
|
|
| |
Failing to do this leads to problems when retyping the This of
nested classes with the same name (e.g. nested anonymous classes as they appear in
t0453.scala).
RefinedPrinter was changed to avoid sugaring of anonymous classes when uniqid is
set (that was essential to track down the problem).
|
|
|
|
| |
The move caught an illegal erased type in a SelectFromType node.
|
|
|
|
|
|
|
| |
The idea is that primitive operations do not have a symbol, but
when applied have directly a MethodType. Such operations will be
generated in Erasure for array ops. The patch allows retyping of
such operations.
|
|
|
|
|
| |
We would like to be able to define unencoded symbolic names in trees computed by the compiler.
The patch avoids their accidental encoding.
|
|
|
|
|
| |
So far, not needed, but is a reasonable precaution because the original
implementation of symbolOfType makes no sense for Retyper.
|
|
|
|
|
|
|
| |
elements.
It's not really an abbreviation to do it for trees with fewer elements and it leads
to unncessessary syntactic variation.
|
|
|
|
| |
Avoid mentioning arguments that are unchanged.
|
|
|
|
|
|
|
|
| |
1) Add copiers with default arguments, to avoid boilerplate
2) All copiers are now curried wrt first argument (which is
the original tree).
We already make use of the new features in cpy.DefDef, but not yet elsewhere.
|
|
|
|
|
|
|
| |
This phase drops the Local flag from all private[this] and protected[this] members.
This allows subsequent code motions where code is moved from a class to its
companion object. It invalidates variance checking, which is consequently disabled
when retyping.
|
|
|
|
|
|
|
|
| |
1) Disabled insertApplyOrImplicit - it leads to untyped trees which cause
assertion errors down the road. In any case, neither apply methods nor
implicits can be inserted when retyping.
2) Avoid copying tree annotations into symbols when retyping.
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) We now demand that all implicit defs have an implicit type, not
just class members. If we admitted implicit term members without
explicit types, the rules and algorithms for dteremining eligible
implicits would be greatly complicated (because there's always the
danger that inferring the type by typechecking the rhs causes a cyclic
reference).
2) We check for violations of this rule earlier, during type completion, in order
to avoid cyclic references happening before we do the check.
|
|
|
|
|
|
|
|
|
|
| |
Literals need to be promoted as is, because constant folding might
have changed the type of the literal to the expected type. E.g. in
val x: Byte = 2
The literal 2 will have type `Byte(2)` but its underlying constant will still be `Int(2)`.
So re-typing would give the wrong type.
|
|
|
|
|
| |
The check assumes that inferred TypeTrees do not exist yet, but after
the typer they do exist.
|
|
|
|
| |
Retyping should not create new symbols and that includes local dummys.
|
|
Refactored re-typing logic from erasure into seperate ReTyper class. Another candidate
subclass of ReTyper is a future TreeChecker.
|