File tree 3 files changed +9
-2
lines changed
compiler/src/dotty/tools/dotc
3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ object ContextOps:
132
132
}
133
133
134
134
def packageContext (tree : untpd.PackageDef , pkg : Symbol ): Context = inContext(ctx) {
135
- if (pkg.is(Package )) ctx.fresh.setOwner(pkg.moduleClass).setTree(tree)
135
+ if (pkg.is(Package )) ctx.fresh.setOwner(pkg.moduleClass).setTree(tree).setNewScope
136
136
else ctx
137
137
}
138
138
end ContextOps
Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ class Namer { typer: Typer =>
395
395
def recur (stat : Tree ): Context = stat match {
396
396
case pcl : PackageDef =>
397
397
val pkg = createPackageSymbol(pcl.pid)
398
- index(pcl.stats)(using ctx.fresh.setOwner( pkg.moduleClass ))
398
+ index(pcl.stats)(using ctx.packageContext(pcl, pkg))
399
399
invalidateCompanions(pkg, Trees .flatten(pcl.stats map expanded))
400
400
setDocstring(pkg, stat)
401
401
ctx
Original file line number Diff line number Diff line change
1
+ package o { class IO }
2
+ package p { class IO }
3
+ import o ._
4
+ package q {
5
+ import p ._
6
+ class D extends IO
7
+ }
You can’t perform that action at this time.
0 commit comments