From 59e83ce49fbb81f402be7d663f8f38bed0f556df Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 21 Oct 2016 13:58:00 +0200 Subject: 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. --- src/dotty/tools/dotc/typer/Checking.scala | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Checking.scala') 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. */ -- cgit v1.2.3