diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-01-18 16:55:31 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-01-18 18:22:48 +0100 |
commit | 224232df2affa882c2c41fc8a6730ad7fc049679 (patch) | |
tree | a49dfa96f7e99c0b18bc5053b823b141ed2ded96 /src/dotty/tools/dotc/typer | |
parent | 06e18c6e7761c458b33af3471f013a4dd3cee3f1 (diff) | |
download | dotty-224232df2affa882c2c41fc8a6730ad7fc049679.tar.gz dotty-224232df2affa882c2c41fc8a6730ad7fc049679.tar.bz2 dotty-224232df2affa882c2c41fc8a6730ad7fc049679.zip |
Check AppliedTypeTrees bounds inside AppliedTypeTree
Diffstat (limited to 'src/dotty/tools/dotc/typer')
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 17 |
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) } } |