aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/ConstraintHandling.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/ConstraintHandling.scala')
-rw-r--r--src/dotty/tools/dotc/core/ConstraintHandling.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/ConstraintHandling.scala b/src/dotty/tools/dotc/core/ConstraintHandling.scala
index 2aa2a4acd..c3243f5d9 100644
--- a/src/dotty/tools/dotc/core/ConstraintHandling.scala
+++ b/src/dotty/tools/dotc/core/ConstraintHandling.scala
@@ -68,8 +68,14 @@ trait ConstraintHandling {
try isSubType(tp1, tp2)
finally frozenConstraint = saved
}
+
+ protected def constraintImpliesSub(param: PolyParam, tp: Type): Boolean =
+ isSubTypeWhenFrozen(bounds(param).hi, tp)
+
+ protected def constraintImpliesSuper(param: PolyParam, tp: Type): Boolean =
+ isSubTypeWhenFrozen(tp, bounds(param).lo)
- /** The current bounds of type parameter `param` */
+ /** The current bounds of type parameter `param` */
final def bounds(param: PolyParam): TypeBounds = constraint at param match {
case bounds: TypeBounds if !ignoreConstraint => bounds
case _ => param.binder.paramBounds(param.paramNum)