From c9f380d68f2f5d55b9405d93dd64f70438745066 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sun, 20 Feb 2022 15:37:49 -0800 Subject: [PATCH] Silence debug for unused imports --- compiler/src/dotty/tools/dotc/core/Contexts.scala | 7 +++---- tests/neg/unused-imports.scala | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Contexts.scala b/compiler/src/dotty/tools/dotc/core/Contexts.scala index 3d85e89899dd..acd53ad96663 100644 --- a/compiler/src/dotty/tools/dotc/core/Contexts.scala +++ b/compiler/src/dotty/tools/dotc/core/Contexts.scala @@ -1044,10 +1044,9 @@ object Contexts: def unused(using Context): List[(ImportInfo, Symbol, untpd.ImportSelector)] = var unusages = List.empty[(ImportInfo, Symbol, untpd.ImportSelector)] if ctx.settings.WunusedHas.imports && !ctx.compilationUnit.isJava then - if ctx.settings.Ydebug.value then - println(importInfos.get(ctx.compilationUnit).map(iss => iss.map((ii, s) => s"${ii.show} ($ii)")).getOrElse(Nil).mkString("Registered ImportInfos\n", "\n", "")) - println(selectors.toList.flatMap((k,v) => v.toList.map(sel => s"${k.show} -> $sel")).mkString("Used selectors\n", "\n", "")) - end if + //if ctx.settings.Ydebug.value then + // println(importInfos.get(ctx.compilationUnit).map(iss => iss.map((ii, s) => s"${ii.show} ($ii)")).getOrElse(Nil).mkString("Registered ImportInfos\n", "\n", "")) + // println(selectors.toList.flatMap((k,v) => v.toList.map(sel => s"${k.show} -> $sel")).mkString("Used selectors\n", "\n", "")) def checkUsed(info: ImportInfo, owner: Symbol): Unit = val used = selectors(info) var needsPatch = false diff --git a/tests/neg/unused-imports.scala b/tests/neg/unused-imports.scala index 495b6011921d..12dc13fb4d3b 100644 --- a/tests/neg/unused-imports.scala +++ b/tests/neg/unused-imports.scala @@ -1,4 +1,4 @@ -// scalac: -Wunused:imports -Werror -Ydebug -feature +// scalac: -Wunused:imports -Werror -feature //import language.future import language.implicitConversions