| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Check now fails after erasure.
Should become error after fixed.
|
|
|
|
| |
Typed MemberDef trees now take the modifiers from their symbol's data.
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
|
|
|
|
|
|
|
|
| |
TreeChecker now tests that a symbol does not have two definitions that define it,
and that every reference to a symbol owner by a term is in the scope of a definition
of that symbol.
Both tests fail on several files for pattern matcher.
|
|
|
|
| |
Flushed out a caching bug in Scopes.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Similar to Erasure, we do not check conformance wrt <:< to a FunProto.
Nothing is lost, because we typecheck the arguments and result anyway.
And this led to failing tests after GettersSetters was added.
|
| |
|
|
|
|
| |
Allow to skip labels.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Previous postcondition checking did not take into account that phases are
not flat - they consist in part of macro phases that contain miniphases.
In fact the whole set up in Run is dubiuos - we should eliminate the problem at the
root, as described in the TODO in run.
|
|
|
|
| |
@odersky there are some tests disabled, which failed due to other phases being able to transform more code.
|
| |
|
|
|
|
|
| |
1) One phase too many was checked for postconditions.
2) Class members did not have their owners checked because index was not called on them.
|
|
|
|
|
|
|
| |
Have a general way how a phase can establish a postcondition which will be
checked each time a later phase is tree-checked.
Moves erasure constraints from TreeChecker to Erasure's post condition.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
If there's a crash, we always want to see where the retyper was, not just for
tree checking.
|
|
|
|
| |
The move caught an illegal erased type in a SelectFromType node.
|
|
|
|
|
| |
Defines a predicate isErasedTypes and checks that all tree types
and their widened underlying types are erased.
|
|
|
|
| |
On type error, show the source line where the failure occured.
|
|
|
|
|
| |
Taking the ref of a type should always give a TypeTree. Makes ref more
universally usable as type references after frontend are assumed to be TypeTrees.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
The name duplications transform.Erasure / core.transform.Erasure
caused irregularities in the imports and the smae name was confusing.
Besides Erasure was the only class in core.transform, so it seemed
better to eliminate the package alltogether.
|
|
|
|
| |
Now also checks owners of primary constructors and template local dummys.
|
|
|
|
|
|
|
|
| |
well-typed code should not need further adapations. That's why `adapt` is
replaced by a subtype assertion in TreeChecker.
Flushed out two instances where typechecking did not produce well-adapted trees -
one in typedClosure, the other manifested itself in typedSuper.
|
|
|
|
|
|
|
| |
This required a change in Ycheck where we now only test that the new tree has a subtype of the old
one. Previously the requirement was "same type" but this caused "sigs.scala" to fail because
a new tree had a constant Int type where the old tree had just Int as the type. It's hard to guard
against these narrowings and they look harmless.
|
|
|
|
|
| |
In case of "types differ" failure, explain why original and retyped type are
not subtypes of each other.
|
| |
|
| |
|
|
|
|
|
| |
Making TreeChecker work immediately after typer. This requires a number of fixes.
Also, errors now cause exceptions instead of being reported on the command line.
|
|
|
|
| |
... to check whether tree types make sense. Still produces errors when enabled.
|
|
|
|
|
|
|
|
| |
Diagnostic and might be nonsensical
Conflicts:
src/dotty/tools/dotc/typer/Checking.scala
src/dotty/tools/dotc/typer/TypeAssigner.scala
|
|
Right now uses a super-rudementary tree checker: we only check that every tree
has a type.
|