Skip to content

Commit 7460283

Browse files
authored
Process Export for unused check (#22984)
Fixes #22983
2 parents 9f63495 + 7e86357 commit 7460283

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

compiler/src/dotty/tools/dotc/transform/CheckUnused.scala

+2
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ class CheckUnused private (phaseMode: PhaseMode, suffix: String) extends MiniPha
222222
selector.bound match
223223
case untpd.TypedSplice(bound) => transformAllDeep(bound)
224224
case _ =>
225+
case exp: Export =>
226+
transformAllDeep(exp.expr)
225227
case AppliedTypeTree(tpt, args) =>
226228
transformAllDeep(tpt)
227229
args.foreach(transformAllDeep)

tests/warn/i22983.scala

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//> using options -Werror -Wunused:imports
2+
3+
object test1:
4+
object foo:
5+
type X = Int
6+
7+
object test2:
8+
import test1.foo
9+
10+
export foo.X

0 commit comments

Comments
 (0)