diff options
author | Martin Odersky <odersky@gmail.com> | 2016-10-21 13:58:00 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-31 14:44:59 +0100 |
commit | 59e83ce49fbb81f402be7d663f8f38bed0f556df (patch) | |
tree | 1fd3adae16570b5a42747b792f3dd651d5e2fddc /src/dotty/tools/dotc/typer/Checking.scala | |
parent | 08658cb20fee008217966830c51a0ff56ee1ae72 (diff) | |
download | dotty-59e83ce49fbb81f402be7d663f8f38bed0f556df.tar.gz dotty-59e83ce49fbb81f402be7d663f8f38bed0f556df.tar.bz2 dotty-59e83ce49fbb81f402be7d663f8f38bed0f556df.zip |
Don't convert to TypeTrees before pickling
If we want to pickle types with positions we should not
converyt to TypeTrees before pickling. Instead, type trees
are now converted to TypeTrees in FirstTransform.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Checking.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala index 7899174f5..b6c9e0047 100644 --- a/src/dotty/tools/dotc/typer/Checking.scala +++ b/src/dotty/tools/dotc/typer/Checking.scala @@ -79,7 +79,12 @@ object Checking { */ val typeChecker = new TreeTraverser { def traverse(tree: Tree)(implicit ctx: Context) = { - tree match { + typeCheck(tree) + traverseChildren(tree) + } + } + + def typeCheck(tree: Tree)(implicit ctx: Context) = tree match { case AppliedTypeTree(tycon, args) => // If `args` is a list of named arguments, return corresponding type parameters, // otherwise return type parameters unchanged @@ -103,10 +108,7 @@ object Checking { checkRealizable(ref.tpe, ref.pos.focus) case _ => } - traverseChildren(tree) - } - } - + /** Check that `tp` refers to a nonAbstract class * and that the instance conforms to the self type of the created class. */ |