aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/ProtoTypes.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-01-18 18:35:02 +0100
committerMartin Odersky <odersky@gmail.com>2015-01-18 18:38:12 +0100
commitfbe4171404ac56a0fe8e6d54fa06bbd53e85bd97 (patch)
treebd05c10e99a025ea8cde678203af1c4dfbe11b60 /src/dotty/tools/dotc/typer/ProtoTypes.scala
parent566dd6e8a44090168ebe8e6703fea27152802286 (diff)
downloaddotty-fbe4171404ac56a0fe8e6d54fa06bbd53e85bd97.tar.gz
dotty-fbe4171404ac56a0fe8e6d54fa06bbd53e85bd97.tar.bz2
dotty-fbe4171404ac56a0fe8e6d54fa06bbd53e85bd97.zip
New constraint handling
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.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ProtoTypes.scala')
-rw-r--r--src/dotty/tools/dotc/typer/ProtoTypes.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/ProtoTypes.scala b/src/dotty/tools/dotc/typer/ProtoTypes.scala
index e16b83afd..521f0deaa 100644
--- a/src/dotty/tools/dotc/typer/ProtoTypes.scala
+++ b/src/dotty/tools/dotc/typer/ProtoTypes.scala
@@ -325,6 +325,7 @@ object ProtoTypes {
else pt
val tvars = if (owningTree.isEmpty) Nil else newTypeVars(added)
state.constraint = state.constraint.add(added, tvars)
+ ctx.typeComparer.initialize(added)
(added, tvars)
}
@@ -376,7 +377,7 @@ object ProtoTypes {
case tp: TypeAlias => // default case, inlined for speed
tp.derivedTypeAlias(wildApprox(tp.alias, theMap))
case tp @ PolyParam(poly, pnum) => // !!! todo adapt to TrackingConstraint
- ctx.typerState.constraint.at(tp) match {
+ ctx.typerState.constraint.entry(tp) match {
case bounds: TypeBounds => wildApprox(WildcardType(bounds))
case NoType => WildcardType(wildApprox(poly.paramBounds(pnum)).bounds)
case inst => wildApprox(inst)