Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious error in the IDE: ambiguous reference to overloaded definition 'canEqual' #6578

Closed
scabug opened this issue Oct 29, 2012 · 10 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Oct 29, 2012

I just had the following wrong error reported in a Scala source (https://github.com/scala-ide/scala-worksheet/blob/master/org.scalaide.worksheet/src/org/scalaide/worksheet/ScriptCompilationUnit.scala):

ambiguous reference to overloaded definition, both method canEqual in class ScriptCompilationUnit of type (x$1: Any)Boolean and method canEqual in class ScriptCompilationUnit of type (x$1: Any)Boolean match argument types (org.scalaide.worksheet.ScriptCompilationUnit) and expected result type Boolean

This happened with the latest Scala 2.10.0-SNAPSHOT (version: 2.10.0-20121011-125927-25ad7876a9)

UPDATE

After careful investigation we found the issue to be an API method of the presentation compiler. In certain cases it can lead to type checking twice in one run. The resolution is to deprecate, and later remove this method. The method is CompilerControl.askTyped.

@scabug
Copy link
Author

@scabug scabug commented Oct 29, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6578?orig=1
Reporter: @dragos
Affected Versions: 2.10.0

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

@dragos said:
Using Paul's patch, I found this stack trace for the second round of adding synthetics. I will modify the patch to record the previous stack trace as well, so we can compare the two codepaths that lead to this issue:

java.lang.AssertionError: assertion failed: Not adding synthetic methods: already has method equals, method hashCode, method toString, method productPrefix, method productArity, method productElement, method productIterator, method canEqual
	at scala.Predef$.assert(Predef.scala:179)
	at scala.tools.nsc.Global.assert(Global.scala:238)
	at scala.tools.nsc.typechecker.SyntheticMethods$class.addSyntheticMethods(SyntheticMethods.scala:60)
	at scala.tools.nsc.Global$$anon$1.addSyntheticMethods(Global.scala:490)
	at scala.tools.nsc.typechecker.Typers$Typer.finishMethodSynthesis(Typers.scala:1784)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1723)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
	at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:205)
	at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1093)
	at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:578)
	at scala.tools.nsc.interactive.Global.typedTree(Global.scala:744)
	at scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:756)
	at scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:756)
	at scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:609)
	at scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:609)
	at scala.tools.nsc.interactive.Global.respondGradually(Global.scala:616)
	at scala.tools.nsc.interactive.Global.respond(Global.scala:609)
	at scala.tools.nsc.interactive.Global.getTypedTree(Global.scala:756)
	at scala.tools.nsc.interactive.CompilerControl$AskTypeItem.apply$mcV$sp(CompilerControl.scala:336)
	at scala.tools.nsc.interactive.CompilerControl$class.postWorkItem(CompilerControl.scala:111)
	at scala.tools.nsc.interactive.CompilerControl$class.askType(CompilerControl.scala:144)
	at scala.tools.nsc.interactive.Global.askType(Global.scala:27)
	at scala.tools.eclipse.ScalaPresentationCompiler.body(ScalaPresentationCompiler.scala:102)
	at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1$$anonfun$index$1.apply(ScalaOccurrencesFinder.scala:53)
	at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1$$anonfun$index$1.apply(ScalaOccurrencesFinder.scala:53)
	at scala.tools.eclipse.util.Utils$.debugTimed(Utils.scala:25)
	at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1.index$lzycompute(ScalaOccurrencesFinder.scala:52)
	at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1.index(ScalaOccurrencesFinder.scala:52)
	at scala.tools.refactoring.implementations.MarkOccurrences.scala$tools$refactoring$implementations$MarkOccurrences$$occurrencesForSymbol$1(MarkOccurrences.scala:23)
	at scala.tools.refactoring.implementations.MarkOccurrences$$anonfun$2.apply(MarkOccurrences.scala:66)
	at scala.tools.refactoring.implementations.MarkOccurrences$$anonfun$2.apply(MarkOccurrences.scala:32)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
	at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
	at scala.collection.immutable.List.foreach(List.scala:309)
	at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
	at scala.tools.refactoring.implementations.MarkOccurrences.occurrencesOf(MarkOccurrences.scala:32)
	at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:61)
	at scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:41)
	at scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
	at scala.tools.nsc.interactive.Global.pollForWork(Global.scala:336)
	at scala.tools.nsc.interactive.Global.checkForMoreWork(Global.scala:397)
	at scala.tools.nsc.interactive.Global.signalDone(Global.scala:250)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5458)
	at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5554)
	at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5557)
	at scala.tools.nsc.typechecker.Typers$Typer.typedValDef(Typers.scala:1897)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2334)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typed1$1.apply(Typers.scala:5371)
	at scala.tools.nsc.typechecker.Typers$Typer.typerWithLocalContext(Typers.scala:497)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5371)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5641)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2163)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5370)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$27.apply(Typers.scala:1721)
	at scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1720)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
	at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:205)
	at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1093)
	at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:578)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:494)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:490)
	at scala.Option.foreach(Option.scala:236)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:490)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:490)
	at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:773)
	at scala.collection.immutable.List.foreach(List.scala:309)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:772)
	at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:490)
	at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

@paulp said:
The surviving pull request is: scala/scala#1543

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

@dragos said (edited on Oct 31, 2012 2:52:13 PM UTC):
I have now two stack traces that show the two code paths that arrive in addSyntheticMethods:

The first one:

scala.tools.nsc.typechecker.SyntheticMethods$class.addSyntheticMethods(SyntheticMethods.scala:74)
scala.tools.nsc.Global$$anon$1.addSyntheticMethods(Global.scala:490)
scala.tools.nsc.typechecker.Typers$Typer.finishMethodSynthesis(Typers.scala:1784)
scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1723)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
scala.collection.immutable.List.loop$1(List.scala:164)
scala.collection.immutable.List.mapConserve(List.scala:180)
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:1100)
scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:205)
scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1100)
scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1093)
scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:578)
scala.tools.nsc.interactive.Global.typedTree(Global.scala:744)
scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:756)
scala.tools.nsc.interactive.Global$$anonfun$getTypedTree$1.apply(Global.scala:756)
scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:609)
scala.tools.nsc.interactive.Global$$anonfun$respond$1.apply(Global.scala:609)
scala.tools.nsc.interactive.Global.respondGradually(Global.scala:616)
scala.tools.nsc.interactive.Global.respond(Global.scala:609)
scala.tools.nsc.interactive.Global.getTypedTree(Global.scala:756)
scala.tools.nsc.interactive.CompilerControl$AskTypeItem.apply$mcV$sp(CompilerControl.scala:336)
scala.tools.nsc.interactive.CompilerControl$class.postWorkItem(CompilerControl.scala:111)
scala.tools.nsc.interactive.CompilerControl$class.askType(CompilerControl.scala:144)
scala.tools.nsc.interactive.Global.askType(Global.scala:27)
scala.tools.eclipse.ScalaPresentationCompiler.body(ScalaPresentationCompiler.scala:102)
scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1$$anonfun$index$1.apply(ScalaOccurrencesFinder.scala:53)
scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1$$anonfun$index$1.apply(ScalaOccurrencesFinder.scala:53)
scala.tools.eclipse.util.Utils$.debugTimed(Utils.scala:25)
scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1.index$lzycompute(ScalaOccurrencesFinder.scala:52)
scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1$$anonfun$1$$anon$1.index(ScalaOccurrencesFinder.scala:52)
scala.tools.refactoring.implementations.MarkOccurrences.scala$tools$refactoring$implementations$MarkOccurrences$$occurrencesForSymbol$1(MarkOccurrences.scala:23)
scala.tools.refactoring.implementations.MarkOccurrences$$anonfun$2.apply(MarkOccurrences.scala:66)
scala.tools.refactoring.implementations.MarkOccurrences$$anonfun$2.apply(MarkOccurrences.scala:32)
scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
scala.collection.immutable.List.foreach(List.scala:309)
scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
scala.tools.refactoring.implementations.MarkOccurrences.occurrencesOf(MarkOccurrences.scala:32)
scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:61)
scala.tools.eclipse.markoccurrences.ScalaOccurrencesFinder$$anonfun$findOccurrences$1$$anonfun$apply$1.apply(ScalaOccurrencesFinder.scala:41)
scala.tools.nsc.util.InterruptReq.execute(InterruptReq.scala:26)
scala.tools.nsc.interactive.Global.pollForWork(Global.scala:336)
scala.tools.nsc.interactive.Global.checkForMoreWork(Global.scala:397)
scala.tools.nsc.interactive.Global.signalDone(Global.scala:250)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5458)
scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5554)
scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5557)
scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2146)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5370)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
scala.collection.immutable.List.loop$1(List.scala:164)
scala.collection.immutable.List.mapConserve(List.scala:180)
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1856)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$28.apply(Typers.scala:1764)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$28.apply(Typers.scala:1764)
scala.tools.nsc.typechecker.Typers$Typer.typerReportAnyContextErrors(Typers.scala:505)
scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1763)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5385)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
scala.collection.immutable.List.loop$1(List.scala:164)
scala.collection.immutable.List.mapConserve(List.scala:180)
scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:1100)
scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:205)
scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1100)
scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1093)
scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:578)
scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:494)
scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:490)
scala.Option.foreach(Option.scala:236)
scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:490)
scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:490)
scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:773)
scala.collection.immutable.List.foreach(List.scala:309)
scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:772)
scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:490)
scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)

and later:

ava.lang.AssertionError: assertion failed: Not adding synthetic methods: already has method equals, method hashCode, method toString, method productPrefix, method productArity, method productElement, method productIterator, method canEqual
	at scala.Predef$.assert(Predef.scala:179)
	at scala.tools.nsc.Global.assert(Global.scala:238)
	at scala.tools.nsc.typechecker.SyntheticMethods$class.addSyntheticMethods(SyntheticMethods.scala:67)
	at scala.tools.nsc.Global$$anon$1.addSyntheticMethods(Global.scala:490)
	at scala.tools.nsc.typechecker.Typers$Typer.finishMethodSynthesis(Typers.scala:1784)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1723)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5384)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2754)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$55.apply(Typers.scala:2854)
	at scala.collection.immutable.List.loop$1(List.scala:164)
	at scala.collection.immutable.List.mapConserve(List.scala:180)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2854)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5111)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5442)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5493)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:98)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:461)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun$$anonfun$applyPhase$1.apply(Global.scala:1100)
	at scala.reflect.internal.SymbolTable.atPhase(SymbolTable.scala:205)
	at scala.tools.nsc.interactive.Global$TyperRun.applyPhase(Global.scala:1100)
	at scala.tools.nsc.interactive.Global$TyperRun.typeCheck(Global.scala:1093)
	at scala.tools.nsc.interactive.Global.scala$tools$nsc$interactive$Global$$typeCheck(Global.scala:578)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:494)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5$$anonfun$apply$7.apply(Global.scala:490)
	at scala.Option.foreach(Option.scala:236)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:490)
	at scala.tools.nsc.interactive.Global$$anonfun$backgroundCompile$5.apply(Global.scala:490)
	at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:773)
	at scala.collection.immutable.List.foreach(List.scala:309)
	at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:772)
	at scala.tools.nsc.interactive.Global.backgroundCompile(Global.scala:490)
	at scala.tools.nsc.interactive.PresentationCompilerThread.run(PresentationCompilerThread.scala:25)

@scabug
Copy link
Author

@scabug scabug commented Oct 31, 2012

@dragos said:
Those traces suggest the problem lies deeper in the architecture of the presentation compiler: it can be interrupted during type-checking and asked to type-check a file (but it may be the same file it was typechecking when it was interrupted in the first place). I'll open another ticket for hardening the presentation compiler not to allow such calls.

@scabug
Copy link
Author

@scabug scabug commented Nov 1, 2012

@adriaanm said:
since scala/scala#1543 was merged, I'll lower the priority to critical pending further investigation and a structural fix

@scabug
Copy link
Author

@scabug scabug commented Nov 9, 2012

@ijuma said:
This is still marked as a 2.10.0 blocker. Is it really the case?

@scabug
Copy link
Author

@scabug scabug commented Jan 29, 2013

@gkossakowski said:
Iulian, what's the status of this?

@scabug
Copy link
Author

@scabug scabug commented Jan 29, 2013

@dragos said:
It looks like Jira does not send email notifications, even though I'm watching this ticket. I will change the description of this ticket to reflect the current state.

@scabug
Copy link
Author

@scabug scabug commented Feb 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants