Skip to content

crash with assertion failed: attempt to parse java.lang.Object from classfile #1648

Closed
@helloqirun

Description

@helloqirun

$ cat abc.scala

class Foo { Object[A] }

$ dotc abc.scala

-- [E006] Missing Identifier Error: abc.scala --------------------------------------------------------------------------
1 |class Foo { Object[A] }
  |                   ^
  |                   not found: type A

longer explanation available when compiling with `-explain`
exception caught when loading module class Object$: java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile

exception occurred while typechecking abc.scala

exception occurred while compiling abc.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile
	at scala.Predef$.assert(Predef.scala:165)
	at dotty.tools.dotc.core.classfile.ClassfileParser$ConstantPool.getSuperClass(ClassfileParser.scala:1017)
	at dotty.tools.dotc.core.classfile.ClassfileParser.parseParents$1(ClassfileParser.scala:103)
	at dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:119)
	at dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:54)
	at dotty.tools.dotc.core.ClassfileLoader.load(SymbolLoaders.scala:259)
	at dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:255)
	at dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:205)
	at dotty.tools.dotc.core.SymDenotations$LazyType$$anon$1.complete(SymDenotations.scala:1903)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:210)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.info(SymDenotations.scala:188)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:327)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.flags(SymDenotations.scala:136)
	at dotty.tools.dotc.core.SymDenotations$ModuleCompleter.complete(SymDenotations.scala:1941)
<snipped>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions