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

Compiler crashes on "recursive value needs type" #9628

Closed
scabug opened this issue Jan 22, 2016 · 1 comment · Fixed by scala/scala#7051
Closed

Compiler crashes on "recursive value needs type" #9628

scabug opened this issue Jan 22, 2016 · 1 comment · Fixed by scala/scala#7051

Comments

@scabug
Copy link

scabug commented Jan 22, 2016

Compiling:

case class Foo(bar: String, foo: String)
case class Bar(bar: String)

object FooBar {
  def crash(): Unit = {
    val foo = Foo("foo", "bar").copy(foo = "foo")
    val bar = Bar(foo.bar)
  }
}

causes the compiler to crash:

Renaming foo into something else, changes the problem into issue #5091 . Renaming bar into something else compiles fine.

Compiler output:

[info] [running phase parser on FooBar.scala]
[info] [running phase namer on FooBar.scala]
[info] [running phase packageobjects on FooBar.scala]
[info] [running phase typer on FooBar.scala]
scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving value foo
	at scala.reflect.internal.Symbols$Symbol$$anonfun$info$3.apply(Symbols.scala:1477)
	at scala.reflect.internal.Symbols$Symbol$$anonfun$info$3.apply(Symbols.scala:1475)
	at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.reflect.internal.Symbols$Symbol.lock(Symbols.scala:533)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1475)
	at scala.reflect.internal.Symbols$Symbol.cookJavaRawInfo(Symbols.scala:1661)
	at scala.tools.nsc.typechecker.Infer$Inferencer.checkAccessible(Infer.scala:270)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$makeAccessible(Typers.scala:559)
	at scala.tools.nsc.typechecker.Typers$Typer.typedIdent$2(Typers.scala:4892)
	at scala.tools.nsc.typechecker.Typers$Typer.typedIdentOrWildcard$1(Typers.scala:4907)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5339)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5465)
	at scala.tools.nsc.typechecker.Typers$Typer.typedLhs$1(Typers.scala:4209)
	at scala.tools.nsc.typechecker.Typers$Typer.typedAssign$1(Typers.scala:4210)
	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5324)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5352)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5462)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$scala$tools$nsc$typechecker$NamesDefaults$$isAmbiguousAssignment$1$$anonfun$18.apply(NamesDefaults.scala:514)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$scala$tools$nsc$typechecker$NamesDefaults$$isAmbiguousAssignment$1$$anonfun$18.apply(NamesDefaults.scala:513)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:693)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$scala$tools$nsc$typechecker$NamesDefaults$$isAmbiguousAssignment$1.apply$mcZ$sp(NamesDefaults.scala:513)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$scala$tools$nsc$typechecker$NamesDefaults$$isAmbiguousAssignment$1.apply(NamesDefaults.scala:497)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$scala$tools$nsc$typechecker$NamesDefaults$$isAmbiguousAssignment$1.apply(NamesDefaults.scala:497)
	at scala.tools.nsc.typechecker.Contexts$Context.savingUndeterminedTypeParams(Contexts.scala:316)
	at scala.tools.nsc.typechecker.NamesDefaults$class.scala$tools$nsc$typechecker$NamesDefaults$$isAmbiguousAssignment(NamesDefaults.scala:497)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$19.apply(NamesDefaults.scala:595)
	at scala.tools.nsc.typechecker.NamesDefaults$$anonfun$19.apply(NamesDefaults.scala:566)
	at scala.reflect.internal.util.Collections$class.mapWithIndex(Collections.scala:193)
	at scala.reflect.internal.SymbolTable.mapWithIndex(SymbolTable.scala:16)
	at scala.tools.nsc.typechecker.NamesDefaults$class.removeNames(NamesDefaults.scala:566)
	at scala.tools.nsc.Global$$anon$1.removeNames(Global.scala:462)
	at scala.tools.nsc.typechecker.Typers$Typer.tryNamesDefaults$1(Typers.scala:3371)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3453)
	at scala.tools.nsc.typechecker.Typers$Typer.tryNamesDefaults$1(Typers.scala:3439)
	at scala.tools.nsc.typechecker.Typers$Typer.doTypedApply(Typers.scala:3453)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$98.apply(Typers.scala:4495)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$98.apply(Typers.scala:4495)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:680)
	at scala.tools.nsc.typechecker.Typers$Typer.tryTypedApply$1(Typers.scala:4495)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4543)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4579)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5342)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5462)
	at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:5553)
	at scala.tools.nsc.typechecker.Namers$Namer.assignTypeToTree(Namers.scala:880)
	at scala.tools.nsc.typechecker.Namers$Namer.valDefSig(Namers.scala:1382)
	at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1533)
	at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1542)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:782)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:781)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:781)
	at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1569)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:781)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:773)
	at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1685)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1693)
	at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1683)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1489)
	at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1634)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5007)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5451)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3047)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
	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:3151)
	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2381)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5317)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedOutsidePatternMode$1$1.apply(Typers.scala:5317)
	at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5316)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5352)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5359)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5604)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2208)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5307)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5358)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5451)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3047)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
	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:3151)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1921)
	at scala.tools.nsc.typechecker.Typers$Typer.typedModuleDef(Typers.scala:1808)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5309)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5358)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typedByValueExpr(Typers.scala:5451)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:3047)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$65.apply(Typers.scala:3151)
	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:3151)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5014)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMemberDef$1(Typers.scala:5311)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5358)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5395)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5369)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5373)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5447)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.apply(Analyzer.scala:102)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:440)
	at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:431)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:440)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:94)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3$$anonfun$run$1.apply(Analyzer.scala:93)
	at scala.collection.Iterator$class.foreach(Iterator.scala:742)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$3.run(Analyzer.scala:93)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1501)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1486)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1481)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1582)
	at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
	at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
	at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:51)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
	at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:75)
	at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:65)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
	at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:62)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:61)
	at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:89)
	at sbt.inc.Incremental$.compile(Incremental.scala:61)
	at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
	at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
	at sbt.Compiler$.compile(Compiler.scala:128)
	at sbt.Compiler$.compile(Compiler.scala:114)
	at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:814)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:805)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:803)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	at sbt.std.Transform$$anon$4.work(System.scala:63)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.Execute.work(Execute.scala:235)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
[warn] !!! ... hit cycle trying to complete value foo
[info] [running phase patmat on FooBar.scala]
[info] [running phase superaccessors on FooBar.scala]
[info] [running phase extmethods on FooBar.scala]
[info] [running phase pickler on FooBar.scala]
[info] [running phase refchecks on FooBar.scala]
[info] [running phase uncurry on FooBar.scala]
[info] [running phase tailcalls on FooBar.scala]
[info] [running phase specialize on FooBar.scala]
[info] [running phase explicitouter on FooBar.scala]
[info] [running phase erasure on FooBar.scala]
[warn] !!! NoSymbol.owner
[warn] scala.reflect.internal.SymbolTable$$anonfun$devWarningDumpStack$1.apply(SymbolTable.scala:76)
[warn]   at scala.reflect.internal.SymbolTable$$anonfun$devWarningDumpStack$1.apply(SymbolTable.scala:76)
[warn]   at scala.tools.nsc.Global.devWarning(Global.scala:292)
[warn]   at scala.tools.nsc.Global.devWarning(Global.scala:288)
[warn]   at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3528)
[warn]   at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.isJvmAccessible$1(Erasure.scala:1084)
[warn]   at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.preErase(Erasure.scala:1085)
[warn]   at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:1140)
[warn]   at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$1.transform(Erasure.scala:872)
[warn]   at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
[warn]   at scala.reflect.api.Trees$Transformer$$anonfun$transformTrees$1.apply(Trees.scala:2559)
[warn]   at scala.collection.immutable.List.loop$1(List.scala:173)
[warn]   at scala.collection.immutable.List.mapConserve(List.scala:189)
[warn]   at scala.reflect.api.Trees$Transformer.transformTrees(Trees.scala:2559)
[warn]   at scala.reflect.internal.Trees$class.itransform(Trees.scala:1347)
[info] [running phase posterasure on FooBar.scala]
[info] [running phase lazyvals on FooBar.scala]
[info] [running phase lambdalift on FooBar.scala]
[info] [running phase constructors on FooBar.scala]
[info] [running phase flatten on FooBar.scala]
[info] [running phase mixin on FooBar.scala]
[info] [running phase cleanup on FooBar.scala]
[info] [running phase delambdafy on FooBar.scala]
[info] [running phase icode on FooBar.scala]
[warn] !!! PJUMP(method matchEnd4)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
[warn] !!! PJUMP(method case6)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
[warn] !!! PJUMP(method matchEnd4)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
[warn] !!! PJUMP(method case6)/scala.tools.nsc.backend.icode.GenICode$PJUMP is not a control flow instruction
[error] 
[error]   Unknown type: <error>, <error> [class scala.reflect.internal.Types$ErrorType$, class scala.reflect.internal.Types$ErrorType$] TypeRef? false
[error]      while compiling: /home/hzwaal/FooBar/src/main/scala/FooBar.scala
[error]         during phase: icode
[error]      library version: version 2.11.7
[error]     compiler version: version 2.11.7
[error]   reconstructed args: -Ydebug -encoding utf8 -deprecation -feature -bootclasspath /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/classes:/home/hzwaal/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar -classpath /home/hzwaal/FooBar/target/scala-2.11/classes -unchecked
[error] 
[error]   last tree to typer: Ident(bar)
[error]        tree position: line 2 of /home/hzwaal/FooBar/src/main/scala/FooBar.scala
[error]             tree tpe: lang.this.String
[error]               symbol: <param> value bar
[error]    symbol definition: <param> bar: lang.this.String (a TermSymbol)
[error]       symbol package: <empty>
[error]        symbol owners: value bar -> primary constructor Bar -> class Bar
[error]            call site: module class FooBar in package <empty>
[error] 
[error] == Source file context for tree position ==
[error] 
[error]      0 case class Foo(bar: String, foo: String)
[error]      1 case class Bar(bar: String)
[error]      2 
[error]      3 object FooBar {
[error]      4   def crash(): Unit = {
[error]      5     val foo = Foo("foo", "bar").copy(foo = "foo")
[error]      6     val bar = Bar(foo.bar)
scala.reflect.internal.FatalError: 
  Unknown type: <error>, <error> [class scala.reflect.internal.Types$ErrorType$, class scala.reflect.internal.Types$ErrorType$] TypeRef? false
     while compiling: /home/hzwaal/FooBar/src/main/scala/FooBar.scala
        during phase: icode
     library version: version 2.11.7
    compiler version: version 2.11.7
  reconstructed args: -Ydebug -encoding utf8 -deprecation -feature -bootclasspath /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/classes:/home/hzwaal/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar -classpath /home/hzwaal/FooBar/target/scala-2.11/classes -unchecked

  last tree to typer: Ident(bar)
       tree position: line 2 of /home/hzwaal/FooBar/src/main/scala/FooBar.scala
            tree tpe: lang.this.String
              symbol: <param> value bar
   symbol definition: <param> bar: lang.this.String (a TermSymbol)
      symbol package: <empty>
       symbol owners: value bar -> primary constructor Bar -> class Bar
           call site: module class FooBar in package <empty>

== Source file context for tree position ==

     0 case class Foo(bar: String, foo: String)
     1 case class Bar(bar: String)
     2 
     3 object FooBar {
     4   def crash(): Unit = {
     5     val foo = Foo("foo", "bar").copy(foo = "foo")
     6     val bar = Bar(foo.bar)
	at scala.reflect.internal.Reporting$class.abort(Reporting.scala:59)
	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:16)
	at scala.tools.nsc.backend.icode.TypeKinds$class.toTypeKind(TypeKinds.scala:401)
	at scala.tools.nsc.backend.icode.ICodes.toTypeKind(ICodes.scala:19)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadSelect$1(GenICode.scala:847)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:869)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1140)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genLoadArguments$1.apply(GenICode.scala:1138)
	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:124)
	at scala.collection.immutable.List.foldLeft(List.scala:84)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1138)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply3$1(GenICode.scala:697)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:707)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadValDef$1(GenICode.scala:525)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:533)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:181)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:155)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:155)
	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:124)
	at scala.collection.immutable.List.foldLeft(List.scala:84)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:922)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:123)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:148)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:98)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:89)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:67)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:63)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply$mcV$sp(Global.scala:440)
	at scala.tools.nsc.Global$GlobalPhase.withCurrentUnit(Global.scala:431)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:440)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:398)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:398)
	at scala.collection.Iterator$class.foreach(Iterator.scala:742)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:398)
	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:55)
	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1501)
	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1486)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1481)
	at scala.tools.nsc.Global$Run.compile(Global.scala:1582)
	at xsbt.CachedCompiler0.run(CompilerInterface.scala:116)
	at xsbt.CachedCompiler0.run(CompilerInterface.scala:95)
	at xsbt.CompilerInterface.run(CompilerInterface.scala:26)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:101)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:47)
	at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:41)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:51)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
	at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:51)
	at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:75)
	at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:50)
	at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:65)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
	at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
	at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:31)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:62)
	at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:61)
	at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:89)
	at sbt.inc.Incremental$.compile(Incremental.scala:61)
	at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
	at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
	at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
	at sbt.Compiler$.compile(Compiler.scala:128)
	at sbt.Compiler$.compile(Compiler.scala:114)
	at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:814)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:805)
	at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:803)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
	at sbt.std.Transform$$anon$4.work(System.scala:63)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
	at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
	at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
	at sbt.Execute.work(Execute.scala:235)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
	at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
	at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
	at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
[error] (CopMain/compile:compileIncremental) scala.reflect.internal.FatalError: 
[error]   Unknown type: <error>, <error> [class scala.reflect.internal.Types$ErrorType$, class scala.reflect.internal.Types$ErrorType$] TypeRef? false
[error]      while compiling: /home/hzwaal/FooBar/src/main/scala/FooBar.scala
[error]         during phase: icode
[error]      library version: version 2.11.7
[error]     compiler version: version 2.11.7
[error]   reconstructed args: -Ydebug -encoding utf8 -deprecation -feature -bootclasspath /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/classes:/home/hzwaal/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.7.jar -classpath /home/hzwaal/FooBar/target/scala-2.11/classes -unchecked
[error] 
[error]   last tree to typer: Ident(bar)
[error]        tree position: line 2 of /home/hzwaal/FooBar/src/main/scala/FooBar.scala
[error]             tree tpe: lang.this.String
[error]               symbol: <param> value bar
[error]    symbol definition: <param> bar: lang.this.String (a TermSymbol)
[error]       symbol package: <empty>
[error]        symbol owners: value bar -> primary constructor Bar -> class Bar
[error]            call site: module class FooBar in package <empty>
[error] 
[error] == Source file context for tree position ==
[error] 
[error]      0 case class Foo(bar: String, foo: String)
[error]      1 case class Bar(bar: String)
[error]      2 
[error]      3 object FooBar {
[error]      4   def crash(): Unit = {
[error]      5     val foo = Foo("foo", "bar").copy(foo = "foo")
[error]      6     val bar = Bar(foo.bar)
[error] Total time: 3 s, completed Jan 22, 2016 4:37:04 PM
@scabug
Copy link
Author

scabug commented Jan 22, 2016

Imported From: https://issues.scala-lang.org/browse/SI-9628?orig=1
Reporter: Hugo Zwaal (hzwaal)
Affected Versions: 2.11.7
Attachments:

  • FooBar.scala (created on Jan 22, 2016 3:41:40 PM UTC, 192 bytes)

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

Successfully merging a pull request may close this issue.

3 participants