Skip to content

Don't run Ycheck for phases that do not transform trees #5790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions compiler/src/dotty/tools/dotc/transform/SetRootTree.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down