| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
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`.
|
| |
|
|
|
|
|
|
| |
We now check that classes do not inherit from refinement types
(unless they are an encoding of parameterized types), nor from
& or | types.
|
|\
| |
| | |
Fix/mixins
|
| |
| |
| |
| | |
The clause got accidentally dropped in the rebase.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The datarace happened because for method "transform" implemented
by ResolveSuper which disambiguated overridden methods.
Previously, there was a reference FirstTransform.this.transform
of type termRefWithSig to the method implemented in a super trait. Now the same
reference points to the newly implemented method.
Solved because ResolveSuper now generates symbolic references.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Now detects the cycles reported by @retronym
|
|
|
|
| |
to reflect last commit.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
Needed some fixes to lookup refined. The potential alias
type is now calculated by taking the member of the original
refined type, instead of by simply following the refined info.
This takes into account refinements that were defined after
the refinement type that contains the alias.
The change amde another test (transform) hit the deep subtype limit,
which is now disabled.
|
| |
|
|
|
|
|
|
| |
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.
|
|/
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
Transform/mixin
|
| | |
|
| |
| |
| |
| |
| | |
The fix to Types in 9bb35512 (Retract of optimization in computeDenot)
allowed the two tests to compile "twice" again.
|
| |
| |
| |
| |
| |
| |
| | |
Split into two phases, ResolveSuper before Erasure and Mixin after. Likewise GettersSetters
is split into Getters and Memoize.
All tests pass, except two tests fail when compiled twice. Will investigate next why.
|
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| | |
Cleans up after LambdaLift and Flatten. RestoreScopes exhibited a problem (double definition)
when compiling Unpickler. The root of the problem was in Applications.scala. The effect was
that arguments woulkd be lifted out, but then the argument expression would be used anyway. That caused
a closure to be present twice which caused the double def error much later. -Ycheck did not catch it because
the two closure expressions were in non-overlapping scopes.
|
| | |
|
|/
|
|
| |
This fixes #193.
|
|\
| |
| | |
Fix subtyping of types without symbols
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
By-name functions like `(=> T) => T` were not treated correctly before.
Witness the disabled `-Ycheck:gettersSetters` for transform/TreeCheckers
in thge test suite. This commit changes the scheme how => T types are treated
and fixes the problems with by-name functions.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Only exception: dotc/transform. This seems to be for two reasons:
1) The call-by-name functions used in Decorator#foldRightBN cannot be translated correctly
at their use points.
2) An anonymous function in Constructors are not correctly lifted.
2) could be related to missing/duplicated symbols in pattern matcher. I'll follow up with a commit
that points these out.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When using RefinedPrinter we now have a choice whether when
printing a definition tree such as
def foo(x: T): U
we print the parameter and result type info found in the tree or in the symbol.
Previously, we printed the sym info when after typer and the tree info before.
This turns out to be too inflexble. With the patch, we print the sym info if
option -Yprint-syms is set, and the tree info otherwise.
Also, align -Yno-deep-subtypes from camelCase to standard hyphenated option notation.
Tweak where unique ids are printed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Tests now always include erasure (before quite a few tests failed when erasure
was enableed). By contrast lazy vals creates problems with erasure, disabled
for now.
Some other small polishings on integration of pattern matcher with rest of dotc.
Deep recompilation of tools still fails, currently disabled.
|
| |
| |
| |
| | |
And bring back two tests for typing of patterns
|
| |
| |
| |
| |
| | |
We better make this configurable. Because sometimes we want to compile only the files
in the immediate directory.
|
| | |
|
|\ \
| |/
|/| |
Pattern matcher
|
| | |
|
| |
| |
| |
| | |
dotc_core_transform directory is empty. Files where moved while restructuring erasure.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Like other synthetic methods, productArity will not be generated
if an explicit definition is given. Used to be generated unconditionally
in desugaring.
|
| |
| |
| |
| |
| |
| | |
Move flag that throws exception on deep subtyping stacks from Config varianble to setting.
Disable setting for core-pickling which had a deep subtype failure after pattern matcher
was integrated. Todo: Figure out why the subtype stack got so deep.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|