File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ class CheckUnused extends Phase:
35
35
override def description : String = CheckUnused .description
36
36
37
37
override def isRunnable (using Context ): Boolean =
38
- ctx.settings.Wunused .value.nonEmpty
38
+ ctx.settings.Wunused .value.nonEmpty &&
39
+ ! ctx.isJava
39
40
40
41
override def run (using Context ): Unit =
41
42
val tree = ctx.compilationUnit.tpdTree
@@ -179,8 +180,9 @@ object CheckUnused:
179
180
180
181
/** Register an import */
181
182
def registerImport (imp : tpd.Import )(using Context ): Unit =
182
- impInScope.top += imp
183
- unusedImport ++= imp.selectors.filter(s => ! isImportExclusion(s))
183
+ if ! tpd.languageImport(imp.expr).nonEmpty then
184
+ impInScope.top += imp
185
+ unusedImport ++= imp.selectors.filter(s => ! isImportExclusion(s))
184
186
185
187
def registerDef (valOrDef : tpd.ValOrDefDef )(using Context ): Unit =
186
188
if valOrDef.symbol.is(Param ) then
You can’t perform that action at this time.
0 commit comments