From 64f8a610019a0128731faf1f2a9764b639ecb6c8 Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Mon, 17 Dec 2018 11:51:12 +0100 Subject: [PATCH] Don't run Ycheck for phases that do not transform trees --- compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala | 3 +++ compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala | 3 +++ compiler/src/dotty/tools/dotc/transform/SetRootTree.scala | 3 +++ 3 files changed, 9 insertions(+) diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala index 0f4db0d5119a..728e3eaf82a9 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala @@ -46,6 +46,9 @@ class ExtractAPI extends Phase { super.isRunnable && (ctx.sbtCallback != null || forceRun) } + // Check no needed. Does not transform trees + override def isCheckable: Boolean = false + // SuperAccessors need to be part of the API (see the scripted test // `trait-super` for an example where this matters), this is only the case // after `PostTyper` (unlike `ExtractDependencies`, the simplication to trees diff --git a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala index 8fb7a2cee309..3c6f0a0914ad 100644 --- a/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala +++ b/compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala @@ -54,6 +54,9 @@ class ExtractDependencies extends Phase { super.isRunnable && (ctx.sbtCallback != null || forceRun) } + // Check no needed. Does not transform trees + override def isCheckable: Boolean = false + // This phase should be run directly after `Frontend`, if it is run after // `PostTyper`, some dependencies will be lost because trees get simplified. // See the scripted test `constants` for an example where this matters. diff --git a/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala b/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala index 09098188de1e..9a32eadf54a9 100644 --- a/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala +++ b/compiler/src/dotty/tools/dotc/transform/SetRootTree.scala @@ -12,6 +12,9 @@ class SetRootTree extends Phase { override def isRunnable(implicit ctx: Context) = super.isRunnable && ctx.settings.YretainTrees.value + // Check no needed. Does not transform trees + override def isCheckable: Boolean = false + override def run(implicit ctx: Context): Unit = { val tree = ctx.compilationUnit.tpdTree traverser.traverse(tree)