Aladdin - Scala Bugtracking
[#558] project: eclipse-plugin priority: high category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-03-27 15:29:11.0
subject typer in presentation compiler not stable
code
package scala.tools.nsc.models;
import scala.tools.util._;

abstract class NewModel {
  abstract class SymbolURL {
    val top   : RootURL;
    val name  : String;
    val source  : AbstractFile;
  }
  abstract class NodeURL extends SymbolURL {
    val parent : SymbolURL;
    final val top = parent.top;
    final val source = top.file;
    
  }
  abstract class RootURL extends SymbolURL {
    final val top   : RootURL = this;
  }
}
what happened
Crash in presentation compiler because type error (top.file should be top.source):

java.lang.Error: tail of empty list
	at scala.Predef$.error(Predef.scala:155)
	at scala.Nil$.tail(List.scala:1063)
	at scala.tools.nsc.typechecker.SyntheticMethods$class.forwardingMethod$0(SyntheticMethods.scala:84)
	at scala.tools.nsc.typechecker.SyntheticMethods$class.addSyntheticMethods(SyntheticMethods.scala:168)
	at scala.tools.nsc.Global$analyzer$.addSyntheticMethods(Global.scala:224)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:625)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1261)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1586)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1612)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:953)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$43.apply(Typers.scala:943)
	at scala.List$.loop$0(List.scala:232)
	at scala.List$.mapConserve(List.scala:249)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:943)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1257)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1586)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:1612)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:39)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:213)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:202)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:202)
	at scala.Iterator$class.foreach(Iterator.scala:285)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:216)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:202)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:427)
	at ch.epfl.lamp.sdt.build.ScalaCompilerManager$SemanticCompiler.unitFor(ScalaCompilerManager.java:320)
	at ch.epfl.lamp.sdt.build.ScalaCompilerManager$SemanticCompiler.modelFor(ScalaCompilerManager.java:353)
	at ch.epfl.lamp.sdt.core.ScalaProject.outline(ScalaProject.java:143)
	at ch.epfl.lamp.sdt.ui.scalaeditor.ScalaEditor.outline(ScalaEditor.java:155)
	at ch.epfl.lamp.sdt.ui.scalaeditor.ScalaContentOutline.createControl(ScalaContentOutline.java:30)
	at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage(ContentOutline.java:133)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:393)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:731)
	at org.eclipse.ui.views.contentoutline.ContentOutline.partBroughtToTop(ContentOutline.java:206)
	at org.eclipse.ui.internal.PartListenerList$2.run(PartListenerList.java:86)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:816)
	at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)
	at org.eclipse.ui.internal.PartListenerList.firePartBroughtToTop(PartListenerList.java:84)
	at org.eclipse.ui.internal.PartService.firePartBroughtToTop(PartService.java:87)
	at org.eclipse.ui.internal.WorkbenchPagePartList.firePartBroughtToTop(WorkbenchPagePartList.java:75)
	at org.eclipse.ui.internal.WorkbenchPagePartList.fireActiveEditorChanged(WorkbenchPagePartList.java:51)
	at org.eclipse.ui.internal.PartList.setActiveEditor(PartList.java:143)
	at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1133)
	at org.eclipse.ui.internal.WorkbenchPage.updateActivePart(WorkbenchPage.java:1078)
	at org.eclipse.ui.internal.WorkbenchPage.partAdded(WorkbenchPage.java:1425)
	at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:207)
	at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:805)
	at org.eclipse.ui.internal.EditorManager.openEditorFromDe5cr1p7-haX0Ror(EditorManager.java:705)
	at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2390)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2325)
	at org.eclipse.ui.internal.WorkbenchPage.access$10(WorkbenchPage.java:2317)
	at org.eclipse.ui.internal.WorkbenchPage$9.run(WorkbenchPage.java:2303)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2298)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2283)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:384)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:347)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:275)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:139)
	at org.eclipse.jdt.internal.ui.actions.OpenActionUtil.open(OpenActionUtil.java:49)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:181)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:165)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:267)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:243)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.jav\
a:296)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:650)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:780)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.core.runtime.Platform.run(Platform.java:816)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
	at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:778)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1009)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1108)
	at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:244)
	at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:239)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:278)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1074)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3158)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2838)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1899)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1863)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:417)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:99)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:374)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169)
	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.core.launcher.Main.invokeFramework(Main.java:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
what expected Should not crash (does not crash in normal build compiler that goes after type checking).
[back to overview]
Changes of this bug report
Martin  edited on  2006-03-27 16:22:51.0
I get: nsc> neg/bug558.scala neg/bug558.scala:13 error: value file is not a member of NewModel.this.RootURL final val source = top.file; ^ nsc> It looks very much like the bug I fixed last week. Maybe an outdated source?
Martin  edited on  2006-03-27 19:17:54.0
Fixed after reading everything in scala.runtime as classfiles in the presentation compiler.