| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Now also handles all supercalls. Seems to do the right thing on pos/traits.scala.
But does not pass most tests because the sym transformer forces too many things.
|
|
|
|
|
| |
Make private methods in traits static, so that we do not need
to give a default for them.
|
|\
| |
| | |
Fix subtyping of types without symbols
|
| | |
|
| | |
|
|\ \ |
|
| | | |
|
| | | |
|
|/ / |
|
| |
| |
| |
| |
| | |
Nested methods cannot refer to labels in theior environment. Needs a fix in TailCalls.
Moved failing test to pending.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The patch disables hoisting of classes local to a block into the
result type of the block.
Instead, we widen the result type of the block to one which reflects
all refinements made to the parents type of the local class.
Test cases in avoid.scala, t1569.scala.
The original t1569.scala no longer works. Why is explained in neg/t1569-failedAvoid.scala
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Private fields that are accessed only from the constructor,
and are accessed only after they are properly initialized are now
moved into the constructor. This avoids creating a redundant objetc field.
Good example: gcd in Rationals (see constrs.scala).
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Params are already added by Desugar. No special treatment needed here.
Besides primaryConstructor.typeParams is always empty, because term symbols
do not have type parameters.
The fix turns t2660.scala into an error. I believe the error is correct, hence
the test was moved with a comment to neg.
|
|\ \
| |/
|/| |
Pattern matcher
|
| |
| |
| |
| | |
from pr #174.
|
| |
| |
| |
| | |
And a test for this.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The problem is running changeOwner(from, to) where
- from is a ValDef or a Label
- an embedded definition has as owner not `from` but some
owner of `from`.
We allow such denomrlaized owners and the pattern matcher generates
them. This patch makes changeOwner take these situations into account.
|
| |
| |
| |
| | |
Can handle now vararg arguments in patterns.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
GADT bound resetting may only be applied when comparing
<pattern type> <: <expected type>, not when comparing the
other way around.
The fix revealed an error in a test case (t1048) which looks like a real error.
Therefore the test got moved to neg.
Conflicts:
src/dotty/tools/dotc/typer/Applications.scala
test/dotc/tests.scala
tests/disabled/t1048.scala
|
| |
| |
| |
| | |
Indicating that pt is type of selector is this pattern match makes it easier to follow.
|
| | |
|
| |
| |
| |
| |
| | |
Except t1048 which infers incorrect type in typer, patmat creates a tree that computes a more precise one that fails to typecheck
Disabling erasure due to dozens of "Type BLA is illegal after erasure" errors.
|
| | |
|
| |
| |
| |
| | |
Now patmat passes tests but erasure fails.
|
| | |
|
| |
| |
| |
| | |
Breaks out boxing functionality of captured vars from lambda lift.
|
| |
| |
| |
| |
| | |
Avoids characterizing the "from" link in a return as a tail call
reference.
|
| |
| |
| |
| |
| |
| | |
Now also testing that after erasure no outer this exists. Tests suit now includes
calls to local classes and methods which need an outer pointer, as well as passing
an outer pointer along a secondary constructor.
|
| |
| |
| |
| | |
... by reverting a premature optimization in Erasure.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Partial revert of 08c6eaca "this type is a term ref to the source module". The problem with
doing this is that it introduces spurious outer references. An inner module that contains
self referenves always needs the directly enclosing class. The revert avoids this dependency
by making ThisTypes always point to TypeRefs.
Several other changes were necessary to make the builds pass: TypeRefs had to get prefixes after
erasure so that they can be reloaded. Symbols of such typerefs had to be retrieved without forcing
a denotation.
One test (blockescapes.scala) fails and is moved to pending, awaiting further resolution.
Also two other new tests in pending which currently fail (and have failed before).
|
| |
| |
| |
| |
| | |
1) Constructors of inner classes get outer parameters
2) Outer arguments are passed as needed.
|
| |
| |
| |
| |
| |
| |
| |
| | |
The new phase replaces attachOuter. It creates outer accessors where needed
but does not yet define outer parameters or pass outer arguments.
It should run before pattern matcher, so that pattern matcher can access the
outer fields of scrutinees.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Main change: Introduce JavaArrayType as a new type constructor
for Java erased array. Translate all methods of Array class during
erasure to primitive operations on arrays.
Some other small fixes for more localized problems.
|
| |
| |
| |
| |
| | |
Arguments to this(...) calls need a special contet,
similar to - but different from - the supercall context.
|
| |
| |
| |
| |
| |
| | |
In TreeChecker, make sure that every identifier has a type with an elidable prefix.
This excludes identifiers pointing to members of random prefixes without making the
prefix explicit in the tree as part of a Select node.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
By-name parameters did not have their owner changed before.
This was not noticed in treecheck because the method generated
for the closure did not have its Method flag set by accident, so
owmer checking ignored the new val. Once the Methgod flag was set,
owner checking failed. Once changeOwner was added, a whole lot
of other things failed, which led to the fixes in the previous commits.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
New phase ElimByName elimintaes by-name parameters. All other
occurrences of parameterless methods and ExprTypes are eliminated
in erasure.
The reason for the split like this is that it is very hard for
Nullarify to determine when to insert ()'s. The logic for this
is fragile because we need to look at previous denotations which might
not exist (before splitter) or might result from a merge
between parameterless and nullary methods. In Erasure
the same is much simpler to achieve.
|
| |
| |
| |
| | |
RefChecks is now enabled. Some of the tests had to be fixed to be refchecks-correct.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Now that F-bunded types are treated more robustly, we can check bounds for
non-emptyness during Typer.
This unvealed one wrong test (wonder how that passed scalac?), which got
moved to neg.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Cycles are now detected early, when an info is first completed.
Legal, f-bounded cycles are broken by a LazyRef, which will construct
its type lazily. This makes checkBounds validation of AppliedTypeTrees work
(in FirstTransform). Formerly, this stackoverflowed despite the laziness
precautions in findMember.
Todo: Do the same for class files coming from Java and Scala 2.x.
|
| | |
|
|/
|
|
| |
Can handle now vararg arguments in patterns.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Currently we cannot run this test automatically because the testing framework
does not know about .java files. It was run manually and verified that ElimRepeated
does was it is supposed to do (create a varargs bridge).
|
|
|
|
| |
Test for order of type parameters in recursive call
|
|\
| |
| | |
fix/#148
|