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 {
108
108
def erasedRef (tp : Type )(implicit ctx : Context ): Type = tp match {
109
109
case tp : TermRef =>
110
110
assert(tp.symbol.exists, tp)
111
- val tp1 = ctx.makePackageObjPrefixExplicit(tp, tp.symbol )
111
+ val tp1 = ctx.makePackageObjPrefixExplicit(tp)
112
112
if (tp1 ne tp) erasedRef(tp1)
113
113
else TermRef (erasedRef(tp.prefix), tp.symbol.asTerm)
114
114
case tp : ThisType =>
Original file line number Diff line number Diff line change @@ -224,9 +224,14 @@ trait TypeOps { this: Context =>
224
224
cls.enter(sym, decls)
225
225
}
226
226
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 = {
228
233
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 ) =>
230
235
tpe.derivedSelect(pkgCls.packageObj.valRef)
231
236
case _ =>
232
237
tpe
Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ trait TypeAssigner {
144
144
else if (d.symbol is TypeParamAccessor ) // always dereference type param accessors
145
145
ensureAccessible(d.info.bounds.hi, superAccess, pos)
146
146
else
147
- ctx.makePackageObjPrefixExplicit(tpe withDenot d, d )
147
+ ctx.makePackageObjPrefixExplicit(tpe withDenot d)
148
148
case _ =>
149
149
tpe
150
150
}
You can’t perform that action at this time.
0 commit comments