| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Now: All new Array[T] methods are translated to calls of the form
dotty.Arrays.newXYZArray ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a double definition errorfor `T` was produced in a case like this:
type T1 = C { T <: A }
type T2 = T1 { T <: B }
This was caused by the way T1 was treated in the refinement class
that is used to typecheck the type. Desugaring of T2 with `refinedTypeToClass`
would give
trait <refinement> extends T1 { type T <: B }
and `normalizeToClassRefs` would transform this to:
trait <refinement> extends C { type T <: A; type T <: B }
Hence the double definition. The new scheme desugars the rhs of `T2` to:
trait <refinement> extends C { this: T1 => type T <: B }
which avoids the problem.
Also, added tests that #232 (fix/boundsPropagation) indeed considers all refinements
together when comparing refined types.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Turns out that the last commit was a red herring. None of the hoops
it jumped though was necessary. Instead there was a bug in isRef
which caused `&` to erroneously compute T & Int as Int.
The bug was that we always approximated alias types by their high bound. But
in the present case, this leads to errors because U gets 'bounds >: Nothing <: Any',
but it was still an alias type (i.e. its Deferred flag is not set). The fix
dereferences aliases only if their info is a TypeAlias.
|
|
|
|
| |
Now detects the cycles reported by @retronym
|
|
|
|
| |
to reflect last commit.
|
|
|
|
|
| |
We used to approximate these by their bounds, but this is confusing.
See comment in printbounds.scala.
|
|
|
|
|
| |
Need to account for the fact that some argument types may be TypeBoudns themselves.
The change makes Jason's latest example work.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous scheme did not propagate bounds correctly. More generally,
given a comparison
T { X <: A } <: U { X <: B }
it would errenously decompose this to
T <: U, A <: B
But we really need to check whether the total constraint for X in T { X <: A }
subsumes the total constraint for X in T { X <: B }
The new scheme propagates only if the binding in the lower type is an alias.
E.g.
T { X = A } <: Y { X <: B }
decomposes to
T { A = A } <: U, A <: B
The change uncovered another bug, where in the slow path we too a member relative to a refined type;
We need to "narrow" the type to a RefinedThis instead. (See use of "narrow" in TypeComparer).
That change uncovered a third bug concerning the underlying type of a RefinedThis. The last bug was fixed in a previous commit (84f32cd814f2e07725b6ad1f6bff23d4ee38c397).
Two tests (1048, 1843) which were pos tests for scalac but failed compling in dotc have
changed their status and location. They typecheck now, but fail later. They have been
moved to pending.
There's a lot of diagnostic code in TypeComparer to figure out the various problems. I left it in
to be able to come back to the commit in case there are more problems. The checks and diagnostics
will be removed in a subsequent commit.
|
|
|
|
|
|
|
| |
We need to adapt type parameter bounds with an as-ssen-from to the
prefix of the type constructor.
Makes pos/boundspropagation pass.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Annotations in java could be compiled as-if array-only
annotation had <repeated> arguments constructor.
That isn't true for scala.
Also, type checking creation of single-element array
requires implicit resolution to provide ClassTag.
This makes problems while reading deferred annotation.
|
|
|
|
|
|
| |
The dummy constructor is needed so that the real constructors see the import of the companion object.
The constructor has a parameter of type Unit so that no Java code can call it.
|
| |
|
| |
|
| |
|
|
|
|
| |
These tests work correctly since 222e9a478f7b851582550973df6a9d141766e49a
|
|\
| |
| | |
Fix/overriding
|
| |
| |
| |
| |
| | |
Somehow this was lost in porting (or was this done somewhere else
in scalac?).
|
| |
| |
| |
| |
| |
| |
| |
| | |
OverridingPairs had several bugs which caused pairs to be lost, which caused
missing overrides checks. Fixing OverridingPairs revealed several test failures
(and a problem in Synthetics generation which was fixed in the last commit).
Tests that became negative are all moved into neg/overrides.scala, and the
original versions in pos were fixed.
|
|\ \
| | |
| | | |
Try to avoid overconstraining when comparing and/or types
|
| | | |
|
| | | |
|
| |/
| |
| |
| |
| | |
See comments in eitherIsSubType for an explanation what the
problem is. Some test cases are in subtyping.scala
|
|/
|
|
|
|
|
| |
One test (t2613) required lifting a hard recursion limit in findMember
(used for debug only, will be removed in the future). The same test
also requires -Yno-deep-subtypes to be reset, so it's in pos_special
instead of pos.
|
|
|
|
|
| |
Need to account for the possibility that function
arguments are wrapped in braces.
|
| |
|
|\
| |
| | |
Transform/mixin
|
| | |
|
| |
| |
| |
| |
| | |
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.
|
|\|
| |
| | |
Transform/private to static
|
| |
| |
| |
| |
| | |
Make private methods in traits static, so that we do not need
to give a default for them.
|
|/
|
|
| |
This fixes #193.
|
|\
| |
| | |
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.
|