Skip to content

Commit ff7fb5f

Browse files
committed
Harden IDE: Avoid NoDenotaton.owner in makePackageObjPrefixExplicit
1 parent 0353e64 commit ff7fb5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/TypeOps.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
220220
*/
221221
def makePackageObjPrefixExplicit(tpe: NamedType): Type = {
222222
def tryInsert(pkgClass: SymDenotation): Type = pkgClass match {
223-
case pkgCls: PackageClassDenotation if !(tpe.symbol.maybeOwner is Package) =>
223+
case pkgCls: PackageClassDenotation
224+
if !tpe.symbol.maybeOwner.is(Package) && pkgCls.packageObj.exists =>
224225
tpe.derivedSelect(pkgCls.packageObj.termRef)
225226
case _ =>
226227
tpe

0 commit comments

Comments
 (0)