| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
| |
And remove the not used Printer#echo
|
|
|
|
| |
Not used yet, but we might use it as an alternative to typedArg invalidation later.
|
|
|
|
|
|
| |
Roll `sm` and `i` into one interpolator (also called `i`)
Evolve `d` to `em` interpolator (for error messages)
New interpolator `ex` with more explanations, replaces disambiguation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, a unified or otherwise instantiated type parameter
would be removed from the constraint, i.e. if it was the
last parameter of its polytype to be instantiated, the polytype
would be dropped. This is a potential problem since it means
that the alias `param = instance` is forgetten whereas we might
still need it in the same subtype test sequence.
The solution is to wait with cleaning up polytypes until
all associated type variables are fully instantiated.
This change uncovered another bug, where we failed
to follow an existing instantiation when adding to
a constraint. This manifested itself in deep subtype
errors for run/colltest1 and some others.
|
|
|
|
|
|
|
| |
Make them each inherit from common BaseType GenericType.
That way we avoid inheriting accidentally stuff from PolyType in TypeLambda.
Also, Fix adaptation of type lambdas. Don't confuse them with PolyTypes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were two instances where a constraint undergoing a replace would still refer
to poly params that are no longer bound after the replace.
1. In an ordering the replaced parameters was n ot removed from the bounds of the others.
2. When a parameter refers to the replaced parameter in a type, (not a TypeBounds), the
replaced parameter was not replaced.
We now have checking in place that in globally committable typer states, TypeVars are not instantiated
to PolyParams and (configurable) that constraints of such typer states are always closed.
Fixes #670.
|
| |
|
| |
|
| |
|
|
|
|
| |
See comment in OrderingConstraint#replace.
|
|
|
|
|
|
|
| |
This is one both a bit simpler and a faster than TrackingConstraint.
Main change is to replace the 2-d bitmap for ordering with two SimpleMaps
which record for each parameter the smaller and greater parameters.
This is faster in practice because the ordering relation is sparse.
|
|
|
|
|
| |
Allows to merge the functionality of addOneLowerBound and addOneUpperBound in
ConstraintHandling.
|
|
|
|
|
|
|
|
| |
New constraint handling scheme using constraints that distinguish more between
parameter and non-parameter bounds and which track parameter bounds separately.
This allows a co-inductive formulation of satisfiability checking without fishy
cyclicity checks. It should also scale better for long chains of dependent type
variables.
|
|
|
|
| |
This is an alternative low-level constraint implementation.
|
|
|
|
|
| |
Factored out interface for constraints. Current implementation: NaiveConstraint.
Preparing for a more efficient one.
|
| |
|
|
|
|
| |
Specialize hash consing of type aliases.
|
|
|
|
|
|
|
|
| |
The previous scheme checked all constraint bounds twice everytime
the bounds for a parameter in a constraint were changed. The new scheme,
which can be disabled by unsetting `Config.trackContrDeps`, only
checks those cbounds that directly or indirectly mention the changed
parameter.
|
|
|
|
|
|
| |
Satisfiability was too loose before. It is noww tightened. We check that the lower bounds
of all constrained parameters represent a solution to the constraint. To make the check pass
we have to first propagate the constraint by re-verifying all bounds.
|
|
|
|
|
|
|
|
| |
If a type variable TV1 is instantiated to a poly param, and the poly param
is itself accomanied by a type variable TV2, then the instance of TV1 should
be TV2 and not the original poly param. Otherwise we lose instantiations. This
is demonstrated by running dotc on the .scala files in the dotc directory itself
with option -Ycheck.
|
|
|
|
|
|
|
|
|
| |
1) New method compileFiles which allows one to compile the content of a directory one file or directory
after another.
2) max constraint is printed to typr.
Added new test pos_all. Other pos tests can be retired.
|
|
|
|
|
|
|
| |
Pro: Much faster to iterate through uninstantiated type variables
Con: Constraints can no longer be value classes.
Still this seems to give a net win of ~2%.
|
| |
|
|
|
|
|
|
|
|
| |
In particular, need to unify polyparams before replacing one with the other, if the result wiould lead to a cyclic constraint.
Also: Avoid setting `inst` field of a type variable if a subtype operation is in progress, because the constraint might be retracted, and the instantiation should be retracted with it.
Third, tighter checks of cyclic constraint, and deep subtype recursions can now be demanded to cause an abort.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Objective: Avoid cycles by detecting all cases where
A <: B and B <: A
and removing those cases by unifuing A and B.
Cycles need to be avoided because they lead to deep subtype recursions.
|
|
|
|
| |
parameters.
|
| |
|
| |
|
|
|
|
| |
Because of the new typerstate design, we can enforce most invariants by design, or in a purely local manner. We can therefore drop the checkConsistent checks and replace them with much more lightweight assertions that make sure that only committable states are committed and only committable states can create typevars.
|
|
|
|
| |
Removing undetVars and instTypes as separately assignable fields. This is better for maintaining invariants by design.
|
|
|
|
| |
The fact that constraints are maps from PolyTypes to Array[Type] is now hidden form the restr of the program (Or, almost; unfortunately value classes force us to expose the parameter, but we renamed it to a name which is typically used for private data).
|
|
|
|
| |
Motivation: Keep usages separate, prepare for larger constraint refactoring.
|
| |
|
|
|
|
| |
Instead of throwing an exception if SImpleMap size goes over some threshold, we now report the largest constraint encountered in a run.
|
|
|
|
| |
Main refactoring: lub/glb moves to type comparers.
|
|
|
|
| |
Plus a few bugfixes for implicits
|
|
|