Skip to content

Commit 85f0f4f

Browse files
committed
Consistently use markAbsent/isAbsent
1 parent bdc5b6f commit 85f0f4f

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ class Definitions {
189189

190190
private def completeClass(cls: ClassSymbol, ensureCtor: Boolean = true): ClassSymbol = {
191191
if (ensureCtor) ensureConstructor(cls, EmptyScope)
192-
if (cls.linkedClass.exists) cls.linkedClass.info = NoType
192+
if (cls.linkedClass.exists) cls.linkedClass.markAbsent()
193193
cls
194194
}
195195

@@ -296,12 +296,13 @@ class Definitions {
296296
cls.info = ClassInfo(cls.owner.thisType, cls, AnyClass.typeRef :: Nil, newScope)
297297
cls.setFlag(NoInits)
298298

299-
// The companion object doesn't really exist, `NoType` is the general
300-
// technique to do that. Here we need to set it before completing
301-
// attempt to load Object's classfile, which causes issue #1648.
299+
// The companion object doesn't really exist, so it needs to be marked as
300+
// absent. Here we need to set it before completing attempt to load Object's
301+
// classfile, which causes issue #1648.
302302
val companion = JavaLangPackageVal.info.decl(nme.Object).symbol
303-
companion.moduleClass.info = NoType // to indicate that it does not really exist
304-
companion.info = NoType // to indicate that it does not really exist
303+
companion.moduleClass.markAbsent()
304+
companion.markAbsent()
305+
305306
completeClass(cls)
306307
}
307308
def ObjectType: TypeRef = ObjectClass.typeRef

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ object SymDenotations {
792792
}
793793

794794
if (pre eq NoPrefix) true
795-
else if (info eq NoType) false
795+
else if (isAbsent) false
796796
else {
797797
val boundary = accessBoundary(owner)
798798

compiler/src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ class Namer { typer: Typer =>
459459
def invalidate(name: TypeName) =
460460
if (!(definedNames contains name)) {
461461
val member = pkg.info.decl(name).asSymDenotation
462-
if (member.isClass && !member.is(Package)) member.info = NoType
462+
if (member.isClass && !(member.is(Package))) member.markAbsent()
463463
}
464464
xstats foreach {
465465
case stat: TypeDef if stat.isClassDef =>
@@ -828,7 +828,7 @@ class Namer { typer: Typer =>
828828
alt != denot.symbol && alt.info.matchesLoosely(denot.info))
829829
if (isClashingSynthetic) {
830830
typr.println(i"invalidating clashing $denot in ${denot.owner}")
831-
denot.info = NoType
831+
denot.markAbsent()
832832
}
833833
}
834834

0 commit comments

Comments
 (0)