aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/OrderingConstraint.scala
Commit message (Collapse)AuthorAgeFilesLines
* Merge GenericType, TypeLambda and PolyTypeMartin Odersky2016-10-121-22/+22
|
* Make TypeLambdas not be ValueTypesMartin Odersky2016-10-121-1/+1
|
* Refine mergeEntriesMartin Odersky2016-10-111-0/+5
| | | | | | | If entries are type variables, we have to check their instances for equality. This came up onder the new or handling scheme.
* Clean up config.Printers importsOlivier Blanvillain2016-09-231-1/+0
| | | | And remove the not used Printer#echo
* Implement constraint mergingMartin Odersky2016-08-261-2/+42
| | | | Not used yet, but we might use it as an alternative to typedArg invalidation later.
* Less eager removal of type parameters from constraintMartin Odersky2016-07-111-15/+11
| | | | | | | | | | | | | | | | | 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.
* Avoid orphan parameters in Constraint#replaceMartin Odersky2016-07-111-1/+1
| | | | | The previous implementation of `replace` made it possible that formerly constrained parameters would stay on embedded in bounds of other constraint enrties.
* Cleanup of Signature matchingMartin Odersky2016-07-111-1/+1
| | | | | Eliminate sameParams, add comments. Also, minor cleanups elsewhere.
* Refactoring of PolyType and TypeLambdaMartin Odersky2016-07-111-24/+24
| | | | | | | 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.
* Implement toString for OrderingConstraintMartin Odersky2015-10-011-1/+18
| | | | | | We had problems printing constraints which are ill-formed, because the basic operations & , | cause exceptions themselves. toString serves as a fallback if show does not work.
* Rename SimpleMap#mapValues -> mapValuesNowMartin Odersky2015-06-231-1/+1
| | | | | The operation on SimpleMap is eager. As suggested by @retronym we should find a name different from the lazy Map#mapValues operation.
* Polish code.Martin Odersky2015-06-231-2/+2
| | | | Find a nicer way to express the same logic.
* Avoid junk produced by Constraint#replace.Martin Odersky2015-06-221-4/+26
| | | | | | | | | | | | | | 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.
* Remove trailing spaces in Dotty source.Dmitry Petrashko2015-04-091-96/+96
|
* Make all Dotty source files end in newline.Dmitry Petrashko2015-04-091-1/+1
|
* Removed TrackingConstraintMartin Odersky2015-01-311-0/+4
| | | | | | | It's too hard to keep fixes up-to-date in both constraint implementations. And anyway, OrderingConstraint is it for now. Also added comment suggested by @smarter.
* Refinement of dependent parameter handling in OrderingConstraintMartin Odersky2015-01-281-8/+59
| | | | | | | | | | | | Previous code did not recognize some cases of dependent parameters. E.g P1 <: P2 | P3 P2 <: P4 P3 <: P4 In that case it follows that P1 <: P4 but that was not recorded in P's upper set.
* Fixups taking into account reviewer's comments.Martin Odersky2015-01-271-6/+6
|
* Replace only substitutes top-level types.Martin Odersky2015-01-241-32/+53
| | | | See comment in OrderingConstraint#replace.
* New constraint implementation: OrderingConstraintMartin Odersky2015-01-241-0/+481
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.