aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Constraint.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-29 16:59:22 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-29 16:59:22 +0100
commit0581e8bac449ac720bd666e7f7fdb010d810a3cd (patch)
tree16808e80e7d87eac80d3c4d646c82f90ed47dddd /src/dotty/tools/dotc/core/Constraint.scala
parentb508185cc3fe5c740d5ff6ecfd0dc1482596018b (diff)
downloaddotty-0581e8bac449ac720bd666e7f7fdb010d810a3cd.tar.gz
dotty-0581e8bac449ac720bd666e7f7fdb010d810a3cd.tar.bz2
dotty-0581e8bac449ac720bd666e7f7fdb010d810a3cd.zip
SimpleMap.foreachKey -> foreachBinding
Diffstat (limited to 'src/dotty/tools/dotc/core/Constraint.scala')
-rw-r--r--src/dotty/tools/dotc/core/Constraint.scala18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/core/Constraint.scala b/src/dotty/tools/dotc/core/Constraint.scala
index c32c9ce42..a1f52cad7 100644
--- a/src/dotty/tools/dotc/core/Constraint.scala
+++ b/src/dotty/tools/dotc/core/Constraint.scala
@@ -165,17 +165,17 @@ class Constraint(val myMap: SimpleMap[PolyType, Array[Type]]) extends AnyVal wit
/** Perform operation `op` on all typevars, or only on uninstantiated
* typevars, depending on whether `uninstOnly` is set or not.
*/
- def foreachTypeVar(op: TypeVar => Unit, uninstOnly: Boolean = false): Unit = myMap.foreachKey { poly =>
- val entries = myMap(poly)
- for (i <- 0 until paramCount(entries)) {
- def qualifies(tv: TypeVar) =
- if (uninstOnly) isBounds(entries(i)) else !tv.inst.exists
- typeVar(entries, i) match {
- case tv: TypeVar if qualifies(tv) => op(tv)
- case _ =>
+ def foreachTypeVar(op: TypeVar => Unit, uninstOnly: Boolean = false): Unit =
+ myMap.foreachBinding { (poly, entries) =>
+ for (i <- 0 until paramCount(entries)) {
+ def qualifies(tv: TypeVar) =
+ if (uninstOnly) isBounds(entries(i)) else !tv.inst.exists
+ typeVar(entries, i) match {
+ case tv: TypeVar if qualifies(tv) => op(tv)
+ case _ =>
+ }
}
}
- }
/** Perform operation `op` on all uninstantiated typevars.
*/