aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Constraint.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-20 14:20:23 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-20 14:20:23 +0100
commitdb5066bbb4c281bd3b65fe6422314afee115de5e (patch)
treeabae091c0339527852c22a7701885e2306b9e453 /src/dotty/tools/dotc/core/Constraint.scala
parentacc9d750d1776d8d1c864fb3ddaadbaec34d286e (diff)
downloaddotty-db5066bbb4c281bd3b65fe6422314afee115de5e.tar.gz
dotty-db5066bbb4c281bd3b65fe6422314afee115de5e.tar.bz2
dotty-db5066bbb4c281bd3b65fe6422314afee115de5e.zip
More tweaks
Diffstat (limited to 'src/dotty/tools/dotc/core/Constraint.scala')
-rw-r--r--src/dotty/tools/dotc/core/Constraint.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Constraint.scala b/src/dotty/tools/dotc/core/Constraint.scala
index 29e1e01fe..d2ea6aa65 100644
--- a/src/dotty/tools/dotc/core/Constraint.scala
+++ b/src/dotty/tools/dotc/core/Constraint.scala
@@ -19,6 +19,12 @@ class Constraint(val map: SimpleMap[PolyType, Array[Type]]) extends AnyVal with
/** Does the constraint's domain contain the type parameters of `pt`? */
def contains(pt: PolyType): Boolean = map(pt) != null
+ /** Does the constraint's domain contain the type parameter `param`? */
+ def contains(param: PolyParam): Boolean = {
+ val entries = map(param.binder)
+ entries != null && entries(param.paramNum).exists
+ }
+
/** The constraint for given type parameter `param`, or NoType if `param` is not part of
* the constraint domain.
*/