File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ object TypeErasure {
108108 def erasedRef (tp : Type )(implicit ctx : Context ): Type = tp match {
109109 case tp : TermRef =>
110110 assert(tp.symbol.exists, tp)
111- val tp1 = ctx.makePackageObjPrefixExplicit(tp, tp.symbol )
111+ val tp1 = ctx.makePackageObjPrefixExplicit(tp)
112112 if (tp1 ne tp) erasedRef(tp1)
113113 else TermRef (erasedRef(tp.prefix), tp.symbol.asTerm)
114114 case tp : ThisType =>
Original file line number Diff line number Diff line change @@ -224,9 +224,14 @@ trait TypeOps { this: Context =>
224224 cls.enter(sym, decls)
225225 }
226226
227- def makePackageObjPrefixExplicit (tpe : NamedType , d : Denotation ): Type = {
227+ /** If `tpe` is of the form `p.x` where `p` refers to a package
228+ * but `x` is not owned by a package, expand it to
229+ *
230+ * p.package.x
231+ */
232+ def makePackageObjPrefixExplicit (tpe : NamedType ): Type = {
228233 def tryInsert (pkgClass : SymDenotation ): Type = pkgClass match {
229- case pkgCls : PackageClassDenotation if ! (d .symbol.maybeOwner is Package ) =>
234+ case pkgCls : PackageClassDenotation if ! (tpe .symbol.maybeOwner is Package ) =>
230235 tpe.derivedSelect(pkgCls.packageObj.valRef)
231236 case _ =>
232237 tpe
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ trait TypeAssigner {
144144 else if (d.symbol is TypeParamAccessor ) // always dereference type param accessors
145145 ensureAccessible(d.info.bounds.hi, superAccess, pos)
146146 else
147- ctx.makePackageObjPrefixExplicit(tpe withDenot d, d )
147+ ctx.makePackageObjPrefixExplicit(tpe withDenot d)
148148 case _ =>
149149 tpe
150150 }
You can’t perform that action at this time.
0 commit comments