From 3490e018e8b11a9d30629e8d415cbae5efd4abf4 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 14 Jun 2016 15:46:06 +0200 Subject: Make Constraint#bounds work for aliases Bounds did not do the right thing if a constrain parameter was aliased. --- src/dotty/tools/dotc/core/ConstraintHandling.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/ConstraintHandling.scala') 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 -- cgit v1.2.3