diff options
author | liu fengyun <liu@fengy.me> | 2016-11-18 10:00:03 +0100 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2016-11-18 10:03:38 +0100 |
commit | 9f8c81c382ad996693c0460e335bc8911d660442 (patch) | |
tree | 246785d0e0b40cf1f958381cdcd71a5e932be6d4 /src/dotty/tools/dotc/core/Definitions.scala | |
parent | dd0db48342b3ccc773373870f36348de846c66e4 (diff) | |
download | dotty-9f8c81c382ad996693c0460e335bc8911d660442.tar.gz dotty-9f8c81c382ad996693c0460e335bc8911d660442.tar.bz2 dotty-9f8c81c382ad996693c0460e335bc8911d660442.zip |
fix #1648: mark companion object for java.lang.Object as non-existent
Diffstat (limited to 'src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Definitions.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 4e9518a2a..4b090d9b1 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -194,6 +194,13 @@ class Definitions { val cls = ctx.requiredClass("java.lang.Object") assert(!cls.isCompleted, "race for completing java.lang.Object") cls.info = ClassInfo(cls.owner.thisType, cls, AnyClass.typeRef :: Nil, newScope) + + // The companion object doesn't really exist, `NoType` is the general + // technique to do that. Here we need to set it before completing + // attempt to load Object's classfile, which causes issue #1648. + val companion = JavaLangPackageVal.info.decl(nme.Object).symbol + companion.info = NoType // to indicate that it does not really exist + completeClass(cls) } def ObjectType = ObjectClass.typeRef |