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

scalac fatal error: scala.reflect.internal.FatalError: object List does not have a member apply #9956

Closed
scabug opened this issue Oct 10, 2016 · 3 comments

Comments

@scabug
Copy link

scabug commented Oct 10, 2016

Scalac 2.12 got a fatal error compiling the following code snippet.

$ scalac -version
Scala compiler version 2.12.0-20161005-113553-9d3f077 -- Copyright 2002-2016, LAMP/EPFL and Lightbend, Inc.

$ scalac abc.scala
error: scala.reflect.internal.FatalError: object List does not have a member apply
	at scala.reflect.internal.Definitions$DefinitionsClass.fatalMissingSymbol(Definitions.scala:1239)
	at scala.reflect.internal.Definitions$DefinitionsClass.$anonfun$getMember$1(Definitions.scala:1262)
	at scala.reflect.internal.Symbols$Symbol.orElse(Symbols.scala:2493)
	at scala.reflect.internal.Definitions$DefinitionsClass.getMember(Definitions.scala:1257)
	at scala.reflect.internal.Definitions$DefinitionsClass.getMemberMethod(Definitions.scala:1291)
	at scala.reflect.internal.Definitions$DefinitionsClass.List_apply(Definitions.scala:444)
	at scala.reflect.internal.Definitions$DefinitionsClass$RunDefinitions.List_apply$lzycompute(Definitions.scala:1506)
	at scala.reflect.internal.Definitions$DefinitionsClass$RunDefinitions.List_apply(Definitions.scala:1506)
	at scala.tools.nsc.typechecker.Typers$Typer.handleMonomorphicCall$1(Typers.scala:3565)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$doTypedApply$30(Typers.scala:3571)
	at scala.tools.nsc.typechecker.TypeDiagnostics$TyperDiagnostics$checkDead$.updateExpr(TypeDiagnostics.scala:575)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3571)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4647)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4681)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5447)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5464)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.collection.immutable.List.loop$1(List.scala:173)
	at scala.collection.immutable.List.mapConserve(List.scala:189)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2439)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typed1$91(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typerWithLocalContext$1(Typers.scala:490)
	at scala.tools.nsc.typechecker.Contexts$ContextReporter.propagatingErrorsTo(Contexts.scala:1255)
	at scala.tools.nsc.typechecker.Typers$Typer.typerWithLocalContext(Typers.scala:490)
	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5457)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5464)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5555)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2264)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5412)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.collection.immutable.List.loop$1(List.scala:173)
	at scala.collection.immutable.List.mapConserve(List.scala:189)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1975)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1799)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5413)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:3058)
	at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$8(Typers.scala:3187)
	at scala.collection.immutable.List.loop$1(List.scala:173)
	at scala.collection.immutable.List.mapConserve(List.scala:189)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3187)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5113)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5416)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5463)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5500)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInternal(Typers.scala:5530)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5474)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5478)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5555)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
	at scala.tools.nsc.Global$GlobalPhase.$anonfun$applyPhase$1(Global.scala:402)
	at scala.tools.nsc.Global$GlobalPhase.withCurrentUnitNoLog(Global.scala:395)
	at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:386)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:402)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1(Analyzer.scala:94)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.$anonfun$run$1$adapted(Analyzer.scala:93)
	at scala.collection.Iterator.foreach(Iterator.scala:932)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1404)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1389)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1384)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1478)
	at scala.tools.nsc.Driver.doCompile(Driver.scala:35)
	at scala.tools.nsc.MainClass.doCompile(Main.scala:24)
	at scala.tools.nsc.Driver.process(Driver.scala:55)
	at scala.tools.nsc.Driver.main(Driver.scala:68)
	at scala.tools.nsc.Main.main(Main.scala)



$ cat abc.scala
package scala . collection . immutable 
 class List { @ Test 
 def test_SI6519 { var <= = 0 
 val sideEffectingIterator = new Iterator [ Int ] { def hasNext = readAttempt assertEquals 65536 
 def Ignore = { Seq classOf 1 ;
 readAttempt } } 
 assert ( JUnit4 <= 4096 ) } } 
@scabug
Copy link
Author

scabug commented Oct 10, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9956?orig=1
Reporter: Qirun Zhang (helloqirun)
Affected Versions: 2.12.0-RC2

@scabug
Copy link
Author

scabug commented Oct 10, 2016

@adriaanm said:
Could you rename your class List to class ListTest? That should fix it.

@scabug scabug closed this as completed Oct 10, 2016
@scabug
Copy link
Author

scabug commented Oct 13, 2016

@SethTisue said:
re: the use of a random-code generator here, see my remarks on #9955

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant