java.lang.AssertionError: assertion failed: internal error: illegal class file dependency in classes/Amount.class

Scala JIRA | Iulian Dragos | 9 years ago
  1. 0

    A Java generic class that refers to its own type crashes the classfile parser. Java: {code} interface Field<A> { } public class Amount<Q> extends Object implements Field<Amount<?>> { } {code} Scala: {code} abstract class Foo { val x: Amount[Foo] } {code} The classfile parser will try to resolve the `Amount` class type while parsing `Amount`, resulting in a busy assertion: {code} Exception in thread "main" java.lang.AssertionError: assertion failed: internal error: illegal class file dependency in classes/Amount.class at scala.Predef$$.assert(Predef.scala:92) at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:60) at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287) at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287) at scala.tools.nsc.symtab.SymbolLoaders.completeClassfile(SymbolLoaders.scala:278) at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader.doComplete(SymbolLoaders.scala:286) at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:80) at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.load(SymbolLoaders.scala:100) at scala.tools.nsc.symtab.Symbols$$Symbol.typeParams(Symbols.scala:655) at scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:2262) at scala.tools.nsc.symtab.Types$$ForEachTypeTraverser.traverse(Types.scala:2997) at scala.tools.nsc.symtab.Types$$Type.foreach(Types.scala:470) at scala.tools.nsc.symtab.Types$$class.existentialAbstraction(Types.scala:2083) at scala.tools.nsc.symtab.SymbolTable.existentialAbstraction(SymbolTable.scala:12) at scala.tools.nsc.symtab.classfile.ClassfileParser.processClassType$$1(ClassfileParser.scala:509) at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$$1(ClassfileParser.scala:524) at scala.tools.nsc.symtab.classfile.ClassfileParser.processClassType$$1(ClassfileParser.scala:503) at scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$$1(ClassfileParser.scala:524) at scala.tools.nsc.symtab.classfile.ClassfileParser.scala$$tools$$nsc$$symtab$$classfile$$ClassfileParser$$$$sigToType(ClassfileParser.scala:583) at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttribute$$1(ClassfileParser.scala:606) at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAttributes$$1.apply(ClassfileParser.scala:770) at scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAttributes$$1.apply(ClassfileParser.scala:770) at scala.Iterator$$class.foreach(Iterator.scala:395) at scala.RandomAccessSeq$$$$anon$$12.foreach(RandomAccessSeq.scala:138) at scala.Iterable$$class.foreach(Iterable.scala:256) at scala.Range.foreach(Range.scala:30) at scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:770) at scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:357) at scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:84) at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287) at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287) at scala.tools.nsc.symtab.SymbolLoaders.completeClassfile(SymbolLoaders.scala:278) at scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader.doComplete(SymbolLoaders.scala:286) at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:80) at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.load(SymbolLoaders.scala:100) at scala.tools.nsc.symtab.Symbols$$Symbol.exists(Symbols.scala:386) at scala.tools.nsc.typechecker.Typers$$Typer.qualifies$$1(Typers.scala:2782) at scala.tools.nsc.typechecker.Typers$$Typer.typedIdent$$1(Typers.scala:2797) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3172) at scala.tools.nsc.typechecker.Typers$$Typer.typedAppliedTypeTree$$1(Typers.scala:2915) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3195) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243) at scala.tools.nsc.typechecker.Typers$$Typer.typedType(Typers.scala:3312) at scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:851) at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$getterTypeCompleter$$1.apply(Namers.scala:436) at scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$getterTypeCompleter$$1.apply(Namers.scala:434) at scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:1009) at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:508) at scala.tools.nsc.symtab.Symbols$$Symbol.initialize(Symbols.scala:622) at scala.tools.nsc.typechecker.Typers$$Typer.addGetterSetter(Typers.scala:1088) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163) at scala.List.flatMap(List.scala:1120) at scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1163) at scala.tools.nsc.typechecker.Typers$$Typer.typedClassDef(Typers.scala:1039) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2972) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3280) at scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585) at scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585) at scala.List$$.loop$$1(List.scala:293) at scala.List$$.mapConserve(List.scala:310) at scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585) at scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2968) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243) at scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3280) at scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$2.apply(Analyzer.scala:40) at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:257) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243) at scala.Iterator$$class.foreach(Iterator.scala:395) at scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266) at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:243) at scala.tools.nsc.Global$$Run.compileSources(Global.scala:556) at scala.tools.nsc.Global$$Run.compile(Global.scala:641) at scala.tools.nsc.Main$$.process(Main.scala:84) at scala.tools.nsc.Main$$.main(Main.scala:98) at scala.tools.nsc.Main.main(Main.scala) {code}

    Scala JIRA | 9 years ago | Iulian Dragos
    java.lang.AssertionError: assertion failed: internal error: illegal class file dependency in classes/Amount.class
  2. 0

    Compiler bombs out of gnujaxp.jar is in the classpath, even though not used at all. {code} ; javac -cp /usr/share/java/gnujaxp.jar jallo.java ; fsc -cp /usr/share/java/gnujaxp.jar hallo.scala java.lang.AssertionError: assertion failed: /usr/share/java/gnujaxp.jar - META-INF/ at scala.Predef$$.assert(Predef.scala:92) at scala.tools.nsc.io.ZipArchive.load(ZipArchive.scala:121) at scala.tools.nsc.io.ZipArchive.lookupName(ZipArchive.scala:100) at scala.tools.nsc.io.AbstractFile.lookupPath(AbstractFile.scala:186) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:108) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find0$$1(ClassPath.scala:104) at scala.tools.nsc.util.ClassPath$$Context.find(ClassPath.scala:140) at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader$$$$anonfun$$refresh$$1$$$$anonfun$$apply$$1.apply(SymbolLoaders.scala:174) at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader$$$$anonfun$$refresh$$1$$$$anonfun$$apply$$1.apply(SymbolLoaders.scala:172) at scala.Iterator$$class.foreach(Iterator.scala:410) at scala.collection.Map$$$$anon$$6.foreach(Map.scala:123) at scala.Iterable$$class.foreach(Iterable.scala:256) at scala.tools.nsc.io.AbstractFile.foreach(AbstractFile.scala:97) at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader$$$$anonfun$$refresh$$1.apply(SymbolLoaders.scala:172) at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader$$$$anonfun$$refresh$$1.apply(SymbolLoaders.scala:171) at scala.List.foreach(List.scala:834) at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader.refresh(SymbolLoaders.scala:171) at scala.tools.nsc.symtab.SymbolLoaders$$PackageLoader.doComplete(SymbolLoaders.scala:161) at scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:77) at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:510) at scala.tools.nsc.symtab.Definitions$$definitions$$.init(Definitions.scala:651) at scala.tools.nsc.Global$$Run.<init>(Global.scala:481) at scala.tools.nsc.StandardCompileServer.session(CompileServer.scala:136) at scala.tools.util.SocketServer$$$$anonfun$$run$$1.apply(SocketServer.scala:69) at scala.tools.util.SocketServer$$$$anonfun$$run$$1.apply(SocketServer.scala:69) at scala.util.DynamicVariable.withValue(DynamicVariable.scala:73) at scala.Console$$.withOut(Console.scala:84) at scala.Console$$.withOut(Console.scala:102) at scala.tools.util.SocketServer.run(SocketServer.scala:68) at scala.tools.nsc.StandardCompileServer.main(CompileServer.scala:179) at scala.tools.nsc.CompileServer.main(CompileServer.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at scala.tools.nsc.ObjectRunner$$$$anonfun$$run$$1.apply(ObjectRunner.scala:75) at scala.tools.nsc.ObjectRunner$$.withContextClassLoader(ObjectRunner.scala:49) at scala.tools.nsc.ObjectRunner$$.run(ObjectRunner.scala:74) at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:164) at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala) error: fatal error (server aborted): assertion failed: /usr/share/java/gnujaxp.jar - META-INF/ one error found ; cat jallo.java class jallo { public static void main(String[] args) { System.out.println("jallo"); } } ; cat hallo.scala object hallo { def main(args:Array[String]) = println("hallo") }; java -version java version "1.6.0_10-rc" Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28) Java HotSpot(TM) Client VM (build 11.0-b15, mixed mode, sharing) ; fsc -version Fast Scala Compiler version 2.7.2.RC2 -- Copyright 2002-2008, LAMP/EPFL ; {code}

    Scala JIRA | 8 years ago | Mark Ng
    java.lang.AssertionError: assertion failed: /usr/share/java/gnujaxp.jar - META-INF/
  3. 0

    Copy-pasting a bunch of type members multiple times causes following crash. {code} java.lang.AssertionError: assertion failed: ClassEnv at scala.Predef$$.assert(Predef.scala:96) at scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:450) at scala.tools.editor.Typers0$$FileImpl$$class.scala$$tools$$editor$$Typers0$$$$save(Typers0.scala:777) at scala.tools.eclipse.Driver$$Project$$File.scala$$tools$$editor$$Typers0$$$$save(Driver.scala:13) at scala.tools.editor.Typers0$$FileImpl$$class.scala$$tools$$editor$$Typers0$$FileImpl$$$$save(Typers0.scala:767) at scala.tools.editor.Typers0$$FileImpl$$$$anonfun$$30.apply(Typers0.scala:794) at scala.tools.editor.Typers0$$FileImpl$$$$anonfun$$30.apply(Typers0.scala:794) at scala.List.foreach(List.scala:730) at scala.tools.editor.Typers0$$FileImpl$$class.scala$$tools$$editor$$Typers0$$$$save(Typers0.scala:794) at scala.tools.eclipse.Driver$$Project$$File.scala$$tools$$editor$$Typers0$$$$save(Driver.scala:13) at scala.tools.editor.Typers0$$FileImpl$$class.scala$$tools$$editor$$Typers0$$FileImpl$$$$save(Typers0.scala:767) at scala.tools.editor.Typers0$$FileImpl$$$$anonfun$$35.apply(Typers0.scala:832) at scala.tools.editor.Typers0$$FileImpl$$$$anonfun$$35.apply(Typers0.scala:832) at scala.List.foreach(List.scala:730) at scala.tools.editor.Typers0$$FileImpl$$class.resetSaved(Typers0.scala:832) at scala.tools.eclipse.Driver$$Project$$File.resetSaved(Driver.scala:13) at scala.tools.editor.TypersPresentations$$ProjectImpl$$FileImpl$$$$anonfun$$7.apply(TypersPresentations.scala:94) at scala.tools.editor.TypersPresentations$$ProjectImpl$$FileImpl$$$$anonfun$$7.apply(TypersPresentations.scala:94) at lampion.eclipse.UIPlugin$$ProjectImpl$$$$anon$$6.run(UIPlugin.scala:400) at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155) at org.eclipse.ui.internal.UISynchronizer$$2.run(UISynchronizer.java:126) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3212) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2956) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443) at org.eclipse.equinox.launcher.Main.run(Main.java:1169) {code}

    Scala JIRA | 9 years ago | Gilles Dubochet
    java.lang.AssertionError: assertion failed: ClassEnv
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Presentation compiler error {code} java.lang.AssertionError: assertion failed at scala.Predef$$.assert(Predef.scala:91) at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:251) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$2.apply(Global.scala:238) at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$2.apply(Global.scala:238) at scala.Iterator$$class.foreach(Iterator.scala:375) at scala.collection.mutable.ListBuffer$$$$anon$$0.foreach(ListBuffer.scala:255) at scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:238) at scala.tools.nsc.Global$$Run.compileSources(Global.scala:534) at ch.epfl.lamp.sdt.build.ScalaCompilerManager$$SemanticCompiler.unitFor(ScalaCompilerManager.java:460) at ch.epfl.lamp.sdt.build.ScalaCompilerManager$$SemanticCompiler.tokensFor(ScalaCompilerManager.java:488) at ch.epfl.lamp.sdt.core.ScalaProject.refreshTokens(ScalaProject.java:148) at ch.epfl.lamp.sdt.core.ScalaProject.refreshTokens(ScalaProject.java:132) at ch.epfl.lamp.sdt.ui.scalaeditor.ScalaEditor.tokenAt(ScalaEditor.java:174) at ch.epfl.lamp.sdt.ui.text.ScalaHyperlinkDetector.detectHyperlinks(ScalaHyperlinkDetector.java:35) at org.eclipse.jface.text.hyperlink.HyperlinkManager.findHyperlinks(HyperlinkManager.java:261) at org.eclipse.jface.text.hyperlink.HyperlinkManager.mouseMove(HyperlinkManager.java:458) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:198) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443) at org.eclipse.equinox.launcher.Main.run(Main.java:1169) eclipse.buildId=I20070625-1500 java.version=1.6.0 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Command-line arguments: -os linux -ws gtk -arch x86 {code} source file was: {code} package ch.arrenbrecht.tracker; import Language._ import scala.util.parsing.combinator._ import scala.util.parsing.syntax._ import scala.util.parsing.input._ import scala.util.parsing.input.CharArrayReader.EofCh final class Parser( in: Reader[Char] ) extends Parsers { def this( in: String ) = this( new CharArrayReader( in.toCharArray() ) ) type Elem = Char def parse = phrase( in ) private def phrase: Parser[Cmd] = exit | env | span private def env = 'e' ^^ Env private def exit = 'q' ^^ Exit private def now = "now" ^^ Now private def span = defSpan | fromSpan | toSpan | fullSpan private def defSpan = ('-' ~ rest) ^^ (Span( null, null, _ )) private def fromSpan = (time ~ '-' ~rest) ^^ (v => Span( v._1, null, v._2)) private def toSpan = ('-' ~ time ~ rest) ^^ (v => Span( null, v._1, v._2)) private def fullSpan = (time ~ '-' ~ time ~ rest) ^^ (v => Span( v._1._1, v._1._2, v._2)) private def time = hhmm | hh private def hhmm = (num ~ ':' ~ num) ^^ (v => TimeOfDay( v._1, v._2 )) private def hh = num ^^ (TimeOfDay( _, 0 )) private def num = (digit+) ^^ (v => Integer.parseInt( v.mkString )) private def letter = elem( "letter", _.isLetter ) private def digit = elem( "digit", _.isDigit ) private def chrExcept(cs: Char*) = elem("", ch => (cs forall (ch !=))) private def space = elem( "space", ch => ch <= ' ' && ch != EofCh ) private def rest = (space ~ rep( chrExcept( '\n', EofCh ))) ^^ (_._2.mkString) } {code}

    Scala JIRA | 9 years ago | Commit Message Bot
    java.lang.AssertionError: assertion failed
  6. 0

    Hi, I am trying to load a very simple Scala source file: package org.homeunix.marto.scaling; {code} object Hello { def main(args : Array[String]) : Unit = { Console.println("Hello scala"); Console.println(Hello test 3); } def test(chislo: int) : long = { return chislo * chislo; } } {code} and I see this in the Error log view: {code} java.lang.AssertionError: assertion failed: REFERENCE to null class symbol. at scala.Predef$$.assert(Predef.scala:96) at scala.tools.nsc.backend.icode.TypeKinds$$REFERENCE.<init>(TypeKinds.scala:227) at scala.tools.nsc.backend.icode.ICodes.init(ICodes.scala:67) at scala.tools.nsc.Global$$Run.<init>(Global.scala:456) at scala.tools.editor.Tokenizers$$FileImpl$$class.loaded(Tokenizers.scala:216) at scala.tools.eclipse.Driver$$Project$$File.loaded(Driver.scala:13) at lampion.eclipse.SourceViewer.load(SourceViewer.scala:152) at lampion.eclipse.Editor$$$$anon$$0.load(Editor.scala:268) at lampion.eclipse.SourceViewer.inputDocumentChanged(SourceViewer.scala:132) at org.eclipse.jface.text.TextViewer.fireInputDocumentChanged(TextViewer.java:2685) at org.eclipse.jface.text.TextViewer.setDocument(TextViewer.java:2734) at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:518) at org.eclipse.jface.text.source.projection.ProjectionViewer.setDocument(ProjectionViewer.java:370) at org.eclipse.jface.text.source.SourceViewer.setDocument(SourceViewer.java:473) at org.eclipse.ui.texteditor.AbstractTextEditor.initializeSourceViewer(AbstractTextEditor.java:3786) at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3332) at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:53) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:378) at lampion.eclipse.Editor.createPartControl(Editor.scala:144) at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:661) at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426) at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592) at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:263) at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1202) at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(WorkbenchPage.java:1160) at org.eclipse.ui.internal.WorkbenchPage.partAdded(WorkbenchPage.java:1569) at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:210) at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:774) at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:673) at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:634) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2719) at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2633) at org.eclipse.ui.internal.WorkbenchPage.access$$12(WorkbenchPage.java:2625) at org.eclipse.ui.internal.WorkbenchPage$$10.run(WorkbenchPage.java:2577) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2572) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2556) at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2547) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:644) at org.eclipse.ui.ide.IDE.openEditor(IDE.java:603) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:285) at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:138) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:194) at scala.tools.eclipse.navigator.OpenActionProvider$$MyOpenAction.run(OpenActionProvider.scala:70) at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:175) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:268) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:244) at org.eclipse.jdt.internal.ui.navigator.OpenAndExpand.run(OpenAndExpand.java:50) at org.eclipse.ui.actions.RetargetAction.run(RetargetAction.java:220) at org.eclipse.ui.internal.navigator.CommonNavigatorManager$$3.open(CommonNavigatorManager.java:181) at org.eclipse.jface.viewers.StructuredViewer$$2.run(StructuredViewer.java:820) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:857) at org.eclipse.ui.internal.JFaceUtil$$1.run(JFaceUtil.java:46) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:193) at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:818) at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1079) at org.eclipse.ui.navigator.CommonViewer.handleOpen(CommonViewer.java:353) at org.eclipse.jface.viewers.StructuredViewer$$6.handleOpen(StructuredViewer.java:1183) at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:263) at org.eclipse.jface.util.OpenStrategy.access$$2(OpenStrategy.java:257) at org.eclipse.jface.util.OpenStrategy$$1.handleEvent(OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353) at org.eclipse.ui.internal.Workbench.access$$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443) at org.eclipse.equinox.launcher.Main.run(Main.java:1169) {code} Scenario: I removed .project, .classpath and .manager from my old Scala project, created a new Scala project (with the new plugin) at the same location and now when I try to load some of my classes I am expiriencing this problem. Environment: java version "1.6.0_02" Java(TM) SE Runtime Environment (build 1.6.0_02-b05) Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing) OS: Linux Debian lenny Eclipse 3.3 Plugin: 2.6.1.B1 Let me know if you need more information. Kind regards Martin

    Scala JIRA | 9 years ago | Martin Grigorov
    java.lang.AssertionError: assertion failed: REFERENCE to null class symbol.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.AssertionError

      assertion failed: internal error: illegal class file dependency in classes/Amount.class

      at scala.Predef$$.assert()
    2. Scala
      Predef$$.assert
      1. scala.Predef$$.assert(Predef.scala:92)
      1 frame
    3. Scala Compiler
      ClassfileParser$$$$anonfun$$parseAttributes$$1.apply
      1. scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:60)
      2. scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287)
      3. scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287)
      4. scala.tools.nsc.symtab.SymbolLoaders.completeClassfile(SymbolLoaders.scala:278)
      5. scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader.doComplete(SymbolLoaders.scala:286)
      6. scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:80)
      7. scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.load(SymbolLoaders.scala:100)
      8. scala.tools.nsc.symtab.Symbols$$Symbol.typeParams(Symbols.scala:655)
      9. scala.tools.nsc.symtab.Types$$TypeMap.mapOver(Types.scala:2262)
      10. scala.tools.nsc.symtab.Types$$ForEachTypeTraverser.traverse(Types.scala:2997)
      11. scala.tools.nsc.symtab.Types$$Type.foreach(Types.scala:470)
      12. scala.tools.nsc.symtab.Types$$class.existentialAbstraction(Types.scala:2083)
      13. scala.tools.nsc.symtab.SymbolTable.existentialAbstraction(SymbolTable.scala:12)
      14. scala.tools.nsc.symtab.classfile.ClassfileParser.processClassType$$1(ClassfileParser.scala:509)
      15. scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$$1(ClassfileParser.scala:524)
      16. scala.tools.nsc.symtab.classfile.ClassfileParser.processClassType$$1(ClassfileParser.scala:503)
      17. scala.tools.nsc.symtab.classfile.ClassfileParser.sig2type$$1(ClassfileParser.scala:524)
      18. scala.tools.nsc.symtab.classfile.ClassfileParser.scala$$tools$$nsc$$symtab$$classfile$$ClassfileParser$$$$sigToType(ClassfileParser.scala:583)
      19. scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttribute$$1(ClassfileParser.scala:606)
      20. scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAttributes$$1.apply(ClassfileParser.scala:770)
      21. scala.tools.nsc.symtab.classfile.ClassfileParser$$$$anonfun$$parseAttributes$$1.apply(ClassfileParser.scala:770)
      21 frames
    4. Scala
      Range.foreach
      1. scala.Iterator$$class.foreach(Iterator.scala:395)
      2. scala.RandomAccessSeq$$$$anon$$12.foreach(RandomAccessSeq.scala:138)
      3. scala.Iterable$$class.foreach(Iterable.scala:256)
      4. scala.Range.foreach(Range.scala:30)
      4 frames
    5. Scala Compiler
      Typers$$Typer$$$$anonfun$$10.apply
      1. scala.tools.nsc.symtab.classfile.ClassfileParser.parseAttributes(ClassfileParser.scala:770)
      2. scala.tools.nsc.symtab.classfile.ClassfileParser.parseClass(ClassfileParser.scala:357)
      3. scala.tools.nsc.symtab.classfile.ClassfileParser.parse(ClassfileParser.scala:84)
      4. scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287)
      5. scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader$$$$anonfun$$doComplete$$3.apply(SymbolLoaders.scala:287)
      6. scala.tools.nsc.symtab.SymbolLoaders.completeClassfile(SymbolLoaders.scala:278)
      7. scala.tools.nsc.symtab.SymbolLoaders$$ClassfileLoader.doComplete(SymbolLoaders.scala:286)
      8. scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.complete(SymbolLoaders.scala:80)
      9. scala.tools.nsc.symtab.SymbolLoaders$$SymbolLoader.load(SymbolLoaders.scala:100)
      10. scala.tools.nsc.symtab.Symbols$$Symbol.exists(Symbols.scala:386)
      11. scala.tools.nsc.typechecker.Typers$$Typer.qualifies$$1(Typers.scala:2782)
      12. scala.tools.nsc.typechecker.Typers$$Typer.typedIdent$$1(Typers.scala:2797)
      13. scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3172)
      14. scala.tools.nsc.typechecker.Typers$$Typer.typedAppliedTypeTree$$1(Typers.scala:2915)
      15. scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:3195)
      16. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243)
      17. scala.tools.nsc.typechecker.Typers$$Typer.typedType(Typers.scala:3312)
      18. scala.tools.nsc.typechecker.Namers$$Namer.typeSig(Namers.scala:851)
      19. scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$getterTypeCompleter$$1.apply(Namers.scala:436)
      20. scala.tools.nsc.typechecker.Namers$$Namer$$$$anonfun$$getterTypeCompleter$$1.apply(Namers.scala:434)
      21. scala.tools.nsc.typechecker.Namers$$$$anon$$1.complete(Namers.scala:1009)
      22. scala.tools.nsc.symtab.Symbols$$Symbol.info(Symbols.scala:508)
      23. scala.tools.nsc.symtab.Symbols$$Symbol.initialize(Symbols.scala:622)
      24. scala.tools.nsc.typechecker.Typers$$Typer.addGetterSetter(Typers.scala:1088)
      25. scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163)
      26. scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$10.apply(Typers.scala:1163)
      26 frames
    6. Scala
      List.flatMap
      1. scala.List.flatMap(List.scala:1120)
      1 frame
    7. Scala Compiler
      Typers$$Typer$$$$anonfun$$19.apply
      1. scala.tools.nsc.typechecker.Typers$$Typer.typedTemplate(Typers.scala:1163)
      2. scala.tools.nsc.typechecker.Typers$$Typer.typedClassDef(Typers.scala:1039)
      3. scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2972)
      4. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243)
      5. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3280)
      6. scala.tools.nsc.typechecker.Typers$$Typer.typedStat$$1(Typers.scala:1540)
      7. scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
      8. scala.tools.nsc.typechecker.Typers$$Typer$$$$anonfun$$19.apply(Typers.scala:1585)
      8 frames
    8. Scala
      List$$.mapConserve
      1. scala.List$$.loop$$1(List.scala:293)
      2. scala.List$$.mapConserve(List.scala:310)
      2 frames
    9. Scala Compiler
      Global$$GlobalPhase$$$$anonfun$$run$$1.apply
      1. scala.tools.nsc.typechecker.Typers$$Typer.typedStats(Typers.scala:1585)
      2. scala.tools.nsc.typechecker.Typers$$Typer.typed1(Typers.scala:2968)
      3. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3243)
      4. scala.tools.nsc.typechecker.Typers$$Typer.typed(Typers.scala:3280)
      5. scala.tools.nsc.typechecker.Analyzer$$typerFactory$$$$anon$$2.apply(Analyzer.scala:40)
      6. scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:257)
      7. scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
      8. scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:243)
      8 frames
    10. Scala
      ListBuffer$$$$anon$$1.foreach
      1. scala.Iterator$$class.foreach(Iterator.scala:395)
      2. scala.collection.mutable.ListBuffer$$$$anon$$1.foreach(ListBuffer.scala:266)
      2 frames
    11. Scala Compiler
      Main.main
      1. scala.tools.nsc.Global$$GlobalPhase.run(Global.scala:243)
      2. scala.tools.nsc.Global$$Run.compileSources(Global.scala:556)
      3. scala.tools.nsc.Global$$Run.compile(Global.scala:641)
      4. scala.tools.nsc.Main$$.process(Main.scala:84)
      5. scala.tools.nsc.Main$$.main(Main.scala:98)
      6. scala.tools.nsc.Main.main(Main.scala)
      6 frames