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 @@ -2539,7 +2539,9 @@ object SymDenotations {
2539
2539
)
2540
2540
if compiledNow.exists then compiledNow
2541
2541
else
2542
- val assocFiles = multi.aggregate(d => Set (d.symbol.associatedFile.nn), _ union _)
2542
+ val assocFiles = multi
2543
+ .filterWithPredicate(_.symbol.maybeOwner.isPackageObject)
2544
+ .aggregate(d => Set (d.symbol.associatedFile.nn), _ union _)
2543
2545
if assocFiles.size == 1 then
2544
2546
multi // they are all overloaded variants from the same file
2545
2547
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