File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/fatal-warnings Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ class CheckUnused extends Phase:
76
76
case sel : Select =>
77
77
unusedDataApply(_.registerUsed(sel.symbol))
78
78
traverseChildren(tree)(using newCtx)
79
- case _ : (tpd.Block | tpd.Template ) =>
79
+ case _ : (tpd.Block | tpd.Template | tpd. PackageDef ) =>
80
80
unusedDataApply { ud =>
81
81
ud.inNewScope(ScopeType .fromTree(tree))(traverseChildren(tree)(using newCtx))
82
82
}
Original file line number Diff line number Diff line change @@ -213,4 +213,27 @@ package testImportsInImports:
213
213
package c:
214
214
import a .b // OK
215
215
import b .x // OK
216
- val y = x
216
+ val y = x
217
+
218
+ // -------------------------------------
219
+ package testOnOverloadedMethodsImports:
220
+ package a:
221
+ trait A
222
+ trait B
223
+ trait C :
224
+ def foo (x : A ): A = ???
225
+ def foo (x : B ): B = ???
226
+ package b:
227
+ object D extends a.C
228
+ package c:
229
+ import b .D .foo // error
230
+ package d:
231
+ import b .D .foo // OK
232
+ def bar = foo((??? : a.A ))
233
+ package e:
234
+ import b .D .foo // OK
235
+ def bar = foo((??? : a.B ))
236
+ package f:
237
+ import b .D .foo // OK
238
+ def bar = foo((??? : a.A ))
239
+ def baz = foo((??? : a.B ))
You can’t perform that action at this time.
0 commit comments