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 @@ -135,7 +135,7 @@ object ContextOps:
135
135
}
136
136
137
137
def packageContext (tree : untpd.PackageDef , pkg : Symbol ): Context = inContext(ctx) {
138
- if (pkg.is(Package )) ctx.fresh.setOwner(pkg.moduleClass).setTree(tree)
138
+ if (pkg.is(Package )) ctx.fresh.setOwner(pkg.moduleClass).setTree(tree).setNewScope
139
139
else ctx
140
140
}
141
141
end ContextOps
Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ class Namer { typer: Typer =>
387
387
def recur (stat : Tree ): Context = stat match {
388
388
case pcl : PackageDef =>
389
389
val pkg = createPackageSymbol(pcl.pid)
390
- index(pcl.stats)(using ctx.fresh.setOwner( pkg.moduleClass ))
390
+ index(pcl.stats)(using ctx.packageContext(pcl, pkg))
391
391
invalidateCompanions(pkg, Trees .flatten(pcl.stats map expanded))
392
392
setDocstring(pkg, stat)
393
393
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