aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-01-18 16:55:31 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-01-18 18:22:48 +0100
commit224232df2affa882c2c41fc8a6730ad7fc049679 (patch)
treea49dfa96f7e99c0b18bc5053b823b141ed2ded96 /src
parent06e18c6e7761c458b33af3471f013a4dd3cee3f1 (diff)
downloaddotty-224232df2affa882c2c41fc8a6730ad7fc049679.tar.gz
dotty-224232df2affa882c2c41fc8a6730ad7fc049679.tar.bz2
dotty-224232df2affa882c2c41fc8a6730ad7fc049679.zip
Check AppliedTypeTrees bounds inside AppliedTypeTree
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/typer/Checking.scala17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala
index 3e829eb50..0b4787d15 100644
--- a/src/dotty/tools/dotc/typer/Checking.scala
+++ b/src/dotty/tools/dotc/typer/Checking.scala
@@ -50,13 +50,16 @@ object Checking {
/** Check all AppliedTypeTree nodes in this tree for legal bounds */
val boundsChecker = new TreeTraverser {
- def traverse(tree: Tree)(implicit ctx: Context) = tree match {
- case AppliedTypeTree(tycon, args) =>
- val tparams = tycon.tpe.typeSymbol.typeParams
- val bounds = tparams.map(tparam =>
- tparam.info.asSeenFrom(tycon.tpe.normalizedPrefix, tparam.owner.owner).bounds)
- checkBounds(args, bounds, _.substDealias(tparams, _))
- case _ => traverseChildren(tree)
+ def traverse(tree: Tree)(implicit ctx: Context) = {
+ tree match {
+ case AppliedTypeTree(tycon, args) =>
+ val tparams = tycon.tpe.typeSymbol.typeParams
+ val bounds = tparams.map(tparam =>
+ tparam.info.asSeenFrom(tycon.tpe.normalizedPrefix, tparam.owner.owner).bounds)
+ checkBounds(args, bounds, _.substDealias(tparams, _))
+ case _ =>
+ }
+ traverseChildren(tree)
}
}