| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
1) Rename `decls` to `unforcedDecls` to make it clear that
it is danegrous to use.
2) Prefer `info.decls` over `unforcedDecls`.
This fixes the problem reported in #305 where the primary
constructor was not found.
|
|\
| |
| | |
Shared backend
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Run rewrite tool on tests (2)
|
| | | |
|
| |/
| |
| |
| | |
tests/untried/pos
|
|\ \
| |/
|/| |
Fix #239 - handling of package objects
|
| |
| |
| |
| |
| | |
Like TypeAssigner, asSeenFrom needs to insert a package object if the
prefix is a package but the class enclosing the type is not.
|
| |
| |
| |
| |
| |
| | |
References to `.package` are now also inserted if the
accessed member comes from a class inherited by a package
object.
|
| | |
|
|\ \
| | |
| | | |
Two new tests
|
| |/
| |
| |
| |
| | |
1) Verify we survive illegal infinite paths. Closes #91.
2) Verify we handle fbounds in and types correctly.
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This is necessary to reject code like
val x: Boolean = null
Without the restriction, this code would typecheck and expand to
val x: Boolean = Predef.Boolean2boolean(null)
since `null` counts as a value of type `java.kang.Boolean`.
|
|\
| |
| | |
Change/drop not null
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
|
| |
We now check that classes do not inherit from refinement types
(unless they are an encoding of parameterized types), nor from
& or | types.
|
|
|
|
|
|
| |
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
|
| | |
|