File tree 5 files changed +30
-1
lines changed
compiler/src/dotty/tools/dotc/core
5 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -2523,7 +2523,9 @@ object SymDenotations {
2523
2523
)
2524
2524
if compiledNow.exists then compiledNow
2525
2525
else
2526
- val assocFiles = multi.aggregate(d => Set (d.symbol.associatedFile.nn), _ union _)
2526
+ val assocFiles = multi
2527
+ .filterWithPredicate(_.symbol.maybeOwner.isPackageObject)
2528
+ .aggregate(d => Set (d.symbol.associatedFile.nn), _ union _)
2527
2529
if assocFiles.size == 1 then
2528
2530
multi // they are all overloaded variants from the same file
2529
2531
else
Original file line number Diff line number Diff line change
1
+ package example:
2
+ def xd : Int = ???
3
+
4
+ package bar:
5
+ trait A :
6
+ def foo : String = ???
7
+
8
+ package object example extends bar.A :
9
+ def foo (x : String ): String = ???
Original file line number Diff line number Diff line change
1
+ import example .*
2
+
3
+ @ main def main =
4
+ val _ = foo
Original file line number Diff line number Diff line change
1
+ package example:
2
+ def xd : Int = ???
3
+
4
+ package bar:
5
+ trait A :
6
+ def foo : String = ???
7
+
8
+ package object example extends bar.A :
9
+ def foo (x : String ): String = ???
Original file line number Diff line number Diff line change
1
+ //> using options -Wunused:imports
2
+
3
+ import example .{given , * }
4
+
5
+ @ main def main = ()
You can’t perform that action at this time.
0 commit comments