aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/ConstraintHandling.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-06-14 15:46:06 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:35:03 +0200
commit3490e018e8b11a9d30629e8d415cbae5efd4abf4 (patch)
treea7c95a35071e7d5e6f8af7c41ea6d966ef2ba676 /src/dotty/tools/dotc/core/ConstraintHandling.scala
parent60d81f81ddfc85719fd303e8d15d3891adbf4dfd (diff)
downloaddotty-3490e018e8b11a9d30629e8d415cbae5efd4abf4.tar.gz
dotty-3490e018e8b11a9d30629e8d415cbae5efd4abf4.tar.bz2
dotty-3490e018e8b11a9d30629e8d415cbae5efd4abf4.zip
Make Constraint#bounds work for aliases
Bounds did not do the right thing if a constrain parameter was aliased.
Diffstat (limited to 'src/dotty/tools/dotc/core/ConstraintHandling.scala')
-rw-r--r--src/dotty/tools/dotc/core/ConstraintHandling.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/ConstraintHandling.scala b/src/dotty/tools/dotc/core/ConstraintHandling.scala
index 00b8a5d25..66767d58a 100644
--- a/src/dotty/tools/dotc/core/ConstraintHandling.scala
+++ b/src/dotty/tools/dotc/core/ConstraintHandling.scala
@@ -193,9 +193,9 @@ trait ConstraintHandling {
}
/** The current bounds of type parameter `param` */
- final def bounds(param: PolyParam): TypeBounds = constraint.entry(param) match {
- case bounds: TypeBounds => bounds
- case _ => param.binder.paramBounds(param.paramNum)
+ final def bounds(param: PolyParam): TypeBounds = {
+ val e = constraint.entry(param)
+ if (e.exists) e.bounds else param.binder.paramBounds(param.paramNum)
}
/** Add polytype `pt`, possibly with type variables `tvars`, to current constraint