Skip to content

Commit 4912ba5

Browse files
authored
Merge pull request #4105 from dotty-staging/harden-ide-9
Harden IDE: Avoid NoDenotaton.owner in makePackageObjPrefixExplicit
2 parents f3c54e4 + ff7fb5f commit 4912ba5

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)