File tree 2 files changed +15
-1
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ object CheckUnused:
603
603
case (sel, sym) if dealias(sym) == dealiasedSym => sel
604
604
}.headOption else None
605
605
def wildcard = sels.find(sel => sel.isWildcard && ((sym.is(Given ) == sel.isGiven) || sym.is(Implicit )))
606
- if qualHasSymbol && ! isAccessible && sym.exists then
606
+ if qualHasSymbol && ( ! isAccessible || symName.exists(_ != sym.name)) && sym.exists then
607
607
selector.orElse(dealiasedSelector).orElse(wildcard) // selector with name or wildcard (or given)
608
608
else
609
609
None
Original file line number Diff line number Diff line change @@ -287,3 +287,17 @@ package foo.test.i17156:
287
287
package c:
288
288
import b .Xd
289
289
trait Z derives Xd
290
+
291
+ package foo .test .i17117:
292
+ package example {
293
+ object test1 {
294
+ val test = " test"
295
+ }
296
+
297
+ object test2 {
298
+
299
+ import example .test1 as t1
300
+
301
+ val test = t1.test
302
+ }
303
+ }
You can’t perform that action at this time.
0 commit comments