Skip to content

Commit c9f380d

Browse files
committed
Silence debug for unused imports
1 parent 9b7103b commit c9f380d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,10 +1044,9 @@ object Contexts:
10441044
def unused(using Context): List[(ImportInfo, Symbol, untpd.ImportSelector)] =
10451045
var unusages = List.empty[(ImportInfo, Symbol, untpd.ImportSelector)]
10461046
if ctx.settings.WunusedHas.imports && !ctx.compilationUnit.isJava then
1047-
if ctx.settings.Ydebug.value then
1048-
println(importInfos.get(ctx.compilationUnit).map(iss => iss.map((ii, s) => s"${ii.show} ($ii)")).getOrElse(Nil).mkString("Registered ImportInfos\n", "\n", ""))
1049-
println(selectors.toList.flatMap((k,v) => v.toList.map(sel => s"${k.show} -> $sel")).mkString("Used selectors\n", "\n", ""))
1050-
end if
1047+
//if ctx.settings.Ydebug.value then
1048+
// println(importInfos.get(ctx.compilationUnit).map(iss => iss.map((ii, s) => s"${ii.show} ($ii)")).getOrElse(Nil).mkString("Registered ImportInfos\n", "\n", ""))
1049+
// println(selectors.toList.flatMap((k,v) => v.toList.map(sel => s"${k.show} -> $sel")).mkString("Used selectors\n", "\n", ""))
10511050
def checkUsed(info: ImportInfo, owner: Symbol): Unit =
10521051
val used = selectors(info)
10531052
var needsPatch = false

tests/neg/unused-imports.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// scalac: -Wunused:imports -Werror -Ydebug -feature
1+
// scalac: -Wunused:imports -Werror -feature
22

33
//import language.future
44
import language.implicitConversions

0 commit comments

Comments
 (0)