| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
We planned this for a long time but never implemented it. Instead, we sometimes
issued an erro in Splitter, namely if reflection would have been needed to access the
member. It turns out that some tests (e.g. neg/t625) fail -Ycheck (we knew that before
and disabled) but also fail Pickling because they generate orhpan PolyParams. So rather
than patching this up it seems now is a good time to enforce the restriction for real.
|
|
|
|
| |
RefChecks is now enabled. Some of the tests had to be fixed to be refchecks-correct.
|
|
|
|
|
|
|
| |
Variance checking is now run as part of type-checking.
Fixed tests that exhibited variance errors. Added tests where some classes of
variance errors should be detected.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ported tailcall phase from scalac with such changes:
- all transformation is done in the phase itself
(previously half of the work was done in backend)
- it is now able to run before uncurry
- it is now a treeTransform
- renamed to tailrec to make it more obvious that
this phase transforms only recursive calls.
For now this is a single phase which speculatively
transforms DefDefs.
Speculation can be potentially removed by
splitting into 2 phases:
one detecting which methods should be transformed
second performing transformation.
But, as transformation requires as same amount of work
as detection, I believe it will be simpler to maintain
it as a single phase.
Conflicts:
tests/pos/typers.scala
|
|
|
|
|
|
|
|
|
| |
A self name may no longer have the same name as a parameterless
class member (or param accessor). The restriction makes sense because
otherwise scoping is confusing. It's needed because otherwise we get
TermRefs that have the same name and prefix but denote different things.
Moved some code which exercises this from pos/typers to neg/typers
|
|
|
|
| |
We now propagte the expected function result type (if it exists) into the function body even if it not fully defined.
|
|
|
|
| |
Needed a special case for them.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Objective: Avoid cycles by detecting all cases where
A <: B and B <: A
and removing those cases by unifuing A and B.
Cycles need to be avoided because they lead to deep subtype recursions.
|
|
|
|
|
| |
We need to take type arguments + value arguments into account when there are several overloaded
alternatives that are all polymorphic and can be instantiated with the type arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
oarameter bounds.
Otherwise we would get into situations like the following (experienced in typers.Arrays):
Constraint:
B >: String
T >: B
Add B >: T to this constraint. You get:
B >: String | T,
but because T >: B >: String, the rhs reduces to
B >: T
Simplified this gives
B = T
and the String lower bound has vanished!
|
| |
|
|
|
|
|
|
|
|
| |
This version expands a method ref p.m to the untyped tree
p.m(_, ..., _)
(after lifting impure expressions from p). Afterwards the usual application mechanisms kick in. This fixes problems also present in Scala 2.x, where an eta-expanded function was not as flexible as an explicitly expanded one (for instance, eta expansion did not honor default parameters).
|
|
|
|
| |
Previously, it wasn't.
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) Accessibility check was broken because it looked at symbol's owner, where it should have looked at context owner.
2) Refined treatement if members. Previously, nonPrivate member returned a subset of member, i.e. those denotations returned by member that were not private. This is not correct. In a situation like
class A { def x: Int = 1 }
class B { private def x: String = "" } extends A
(new B).x
the non-private member returned should be A#x. Changed membersNamed and friends as well as checkAccessible to account for that.
|
|
|
|
| |
Plus some small tweaks in Typer
|
| |
|
| |
|
|
|
|
|
|
| |
Also fixes to typedReturn.
Adapted tests accordingly.
|
| |
|
|
|