Skip to content

Commit ff09e67

Browse files
som-snytttgodzik
authored andcommitted
Process Export for unused check
[Cherry-picked 7e86357]
1 parent d155de1 commit ff09e67

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
@@ -218,6 +218,8 @@ class CheckUnused private (phaseMode: PhaseMode, suffix: String) extends MiniPha
218218
selector.bound match
219219
case untpd.TypedSplice(bound) => transformAllDeep(bound)
220220
case _ =>
221+
case exp: Export =>
222+
transformAllDeep(exp.expr)
221223
case AppliedTypeTree(tpt, args) =>
222224
transformAllDeep(tpt)
223225
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)