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

Illegal cyclic reference when compiling scala-io #8276

Closed
scabug opened this issue Feb 13, 2014 · 7 comments
Closed

Illegal cyclic reference when compiling scala-io #8276

scabug opened this issue Feb 13, 2014 · 7 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 13, 2014

We've got regression (from Scala 2.10.2) where illegal cyclic reference is reported but previously was not. It can be seen when compiling scala-io:

[info] Compiling 69 Scala sources to /Users/grek/tmp/play-deps/scala-io/core/target/scala-2.11.0-M8/classes...
[error] /Users/grek/tmp/play-deps/scala-io/core/src/main/scala/scalax/io/LongTraversableLike.scala:49: illegal cyclic reference involving trait LongTraversableLike
[error] trait LongTraversableLike[+A, +Repr <: LongTraversableLike[A, Repr]] extends TraversableLike[A, Repr] {
[error]                                                                              ^
[error] /Users/grek/tmp/play-deps/scala-io/core/src/main/scala/scalax/io/AbstractLazyIteratorBasedBuilder.scala:25: type mismatch;
[error]  found   : scalax.io.CloseableIterator[_]
[error]  required: Iterator[A]
[error]       case lt: LongTraversableLike[_, _] => builderIterators += (() => lt.iterator)
[error]                                                                           ^
[trace] Stack trace suppressed: run last core/compile:compile for the full output.
[error] (core/compile:compile) java.lang.IndexOutOfBoundsException: 0
[error] Total time: 1 s, completed Feb 13, 2014 3:22:13 PM

How to reproduce:

  1. Checkout scala-io from https://github.com/jesseeichar/scala-io at 67249e63c60ff4a7468992dbb8dea62bbc5361be
  2. Apply the following patch:
diff --git a/project/Build.scala b/project/Build.scala
index a367f19..c9a24c6 100644
--- a/project/Build.scala
+++ b/project/Build.scala
@@ -7,7 +7,7 @@ object BuildConstants {
   val version = "0.4.2"
   val armVersion = "1.3"
   val armScalaVersion = "2.10"
-  val scalaVersion = "2.10.2"
+  val scalaVersion = "2.11.0-M8"
 }
 
 object ScalaIoBuild extends Build {
@@ -120,7 +120,7 @@ object ScalaIoBuild extends Build {
   // ------------------------------ Docs Project ------------------------------ //
   lazy val docsSite = TaskKey[Unit]("docs-site","Generate documentation web-site")
   lazy val siteDir = TaskKey[File]("site-dir","Directory of the generated website")
-  lazy val SiteTask = docsSite in Docs <<= (siteDir,baseDirectory,scalaVersion,resourceDirectory,docDirectory in Docs) map {
+  lazy val SiteTask = docsSite in Docs <<= (siteDir,baseDirectory,scalaVersion,resourceDirectory,target in doc) map {
     (out,baseDirectory,scalaVersion,resourceDirectory,docDirectory) =>
 
     val model = new WebsiteModel(
diff --git a/project/PerformanceReport.scala b/project/PerformanceReport.scala
index fa13b60..101eb4b 100644
--- a/project/PerformanceReport.scala
+++ b/project/PerformanceReport.scala
@@ -50,7 +50,7 @@ object PerformanceReport {
     </span>
   }
   def formatName(string:String)=string.capitalize.flatMap{
-    case c if c.isUpperCase => " "+c
+    case c if c.isUpper => " "+c
     case c => Seq(c)
   }.trim
   def childReport(imgFile:File) = {
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 3695627..97d3438 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -2,7 +2,7 @@ addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
 
 resolvers += Resolver.url("sbt-plugin-releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
 
-addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
+//addSbtPlugin("com.jsuereth" % "xsbt-gpg-plugin" % "0.6")
 
 // resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
  1. Run compile in sbt console.
@scabug
Copy link
Author

scabug commented Feb 13, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8276?orig=1
Reporter: @gkossakowski
Affected Versions: 2.11.0-M8
See #1786

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@gkossakowski said:
I just realized that the real error is hidden. The last compile reveals it:

java.lang.IndexOutOfBoundsException: 0
	at scala.collection.LinearSeqOptimized$class.apply(LinearSeqOptimized.scala:51)
	at scala.collection.immutable.List.apply(List.scala:83)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.correspondingTypeArgument(TypeMaps.scala:551)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.loop$3(TypeMaps.scala:585)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.classParameterAsSeen(TypeMaps.scala:590)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:467)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:441)
	at scala.collection.immutable.List.loop$1(List.scala:172)
	at scala.collection.immutable.List.mapConserve(List.scala:188)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:115)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:468)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:441)
	at scala.collection.immutable.List.loop$1(List.scala:172)
	at scala.collection.immutable.List.mapConserve(List.scala:188)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:115)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:468)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.applyToSymbolInfo(TypeMaps.scala:218)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.loop$1(TypeMaps.scala:227)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.noChangeToSymbols(TypeMaps.scala:229)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:243)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:128)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:468)
	at scala.reflect.internal.tpe.TypeMaps$TypeMap.mapOver(TypeMaps.scala:134)
	at scala.reflect.internal.tpe.TypeMaps$AsSeenFromMap.apply(TypeMaps.scala:468)
	at scala.reflect.internal.Types$Type.asSeenFrom(Types.scala:660)
	at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:695)
	at scala.reflect.internal.Symbols$MethodSymbol.typeAsMemberOf(Symbols.scala:2778)
	at scala.reflect.internal.Types$Type.memberType(Types.scala:686)
	at scala.tools.nsc.typechecker.Infer$Inferencer.checkAccessible(Infer.scala:273)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$makeAccessible(Typers.scala:572)
	at scala.tools.nsc.typechecker.Typers$Typer.typedIdent$2(Typers.scala:4855)
	at scala.tools.nsc.typechecker.Typers$Typer.typedIdentOrWildcard$1(Typers.scala:4870)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5305)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5325)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5361)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5335)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5339)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$98.apply(Typers.scala:4489)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$98.apply(Typers.scala:4489)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:686)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4488)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4543)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5308)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5325)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5361)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5335)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5339)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5428)
	at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:5519)
	at scala.tools.nsc.typechecker.Namers$Namer.assignTypeToTree(Namers.scala:861)
	at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:1188)
	at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1500)
	at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1512)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:763)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:762)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:762)
	at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1539)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:762)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:754)
	at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1654)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1662)
	at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1652)
	at scala.tools.nsc.typechecker.Namers$PolyTypeCompleter.completeImpl(Namers.scala:1695)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1662)
	at scala.tools.nsc.typechecker.Namers$PolyTypeCompleter.complete(Namers.scala:1674)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1331)
	at scala.reflect.internal.Symbols$Symbol.tpeHK(Symbols.scala:1265)
	at scala.reflect.internal.Types$Type.computeMemberType(Types.scala:691)
	at scala.reflect.internal.Symbols$MethodSymbol.typeAsMemberOf(Symbols.scala:2778)
	at scala.reflect.internal.Types$Type.memberType(Types.scala:686)
	at scala.reflect.internal.Types$Type.scala$reflect$internal$Types$Type$$findMemberInternal$1(Types.scala:1114)
	at scala.reflect.internal.Types$Type.findMember(Types.scala:1163)
	at scala.reflect.internal.Types$Type.memberBasedOnName(Types.scala:628)
	at scala.reflect.internal.Types$Type.nonLocalMember(Types.scala:619)
	at scala.tools.nsc.typechecker.Typers$Typer.member(Typers.scala:661)
	at scala.tools.nsc.typechecker.Typers$Typer.typedSelectInternal$1(Typers.scala:4667)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedSelect$1(Typers.scala:4645)
	at scala.tools.nsc.typechecker.Typers$Typer.typedSelectOrSuperCall$1(Typers.scala:4784)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5309)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5325)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5361)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5335)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5339)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$98.apply(Typers.scala:4489)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$98.apply(Typers.scala:4489)
	at scala.tools.nsc.typechecker.Typers$Typer.silent(Typers.scala:686)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4488)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4543)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5308)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5325)
	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5361)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5388)
	at scala.tools.nsc.typechecker.Typers$Typer.body$2(Typers.scala:5335)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5339)
	at scala.tools.nsc.typechecker.Typers$Typer.typedArg(Typers.scala:3130)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedArgToPoly$1(Typers.scala:3453)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$73.apply(Typers.scala:3461)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$73.apply(Typers.scala:3461)
[...]

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@retronym said:
You are seeing a few errors.

It regressed in :

commit 2dbd17a226f624aff9e51e424f214555cc753339
Merge: e2f094b b4751a6
Author: Adriaan Moors <adriaan.moors@typesafe.com>
Date:   Fri May 17 16:27:20 2013 -0700

    Merge pull request #2518 from paulp/issue/1786

    SI-1786 incorporate defined bounds in inference

We actually just decided to revert this so it compiles again in master.

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@retronym said:
Here's the stack trace of the first cyclic error:

time scalac-hash v2.11.0-M3~5 -Ydebug @args.txt
[running phase parser on 69 compilation units]
[running phase namer on 69 compilation units]
[running phase packageobjects on 69 compilation units]
[running phase typer on 69 compilation units]
scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving trait LongTraversableLike
	at scala.reflect.internal.Symbols$Symbol$$anonfun$info$3.apply(Symbols.scala:1299)
	at scala.reflect.internal.Symbols$Symbol$$anonfun$info$3.apply(Symbols.scala:1297)
	at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
	at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
	at scala.reflect.internal.Symbols$Symbol.lock(Symbols.scala:493)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1297)
	at scala.reflect.internal.Types$ClassTypeRef$class.baseType(Types.scala:2101)
	at scala.reflect.internal.Types$ClassArgsTypeRef.baseType(Types.scala:2445)
	at scala.reflect.internal.tpe.TypeComparers$class.firstTry$1(TypeComparers.scala:367)
	at scala.reflect.internal.tpe.TypeComparers$class.isSubType2(TypeComparers.scala:514)
	at scala.reflect.internal.tpe.TypeComparers$class.isSubType(TypeComparers.scala:284)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:14)
	at scala.reflect.internal.Types$Type.$less$colon$less(Types.scala:776)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAppliedTypeTree$1$1.canEnhanceIdent$1(Typers.scala:4901)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAppliedTypeTree$1$1.apply(Typers.scala:4906)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAppliedTypeTree$1$1.apply(Typers.scala:4880)
	at scala.reflect.internal.util.Collections$class.foreach2(Collections.scala:149)
	at scala.reflect.internal.SymbolTable.foreach2(SymbolTable.scala:14)
	at scala.tools.nsc.typechecker.Typers$Typer.typedAppliedTypeTree$1(Typers.scala:4880)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5240)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5425)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedParentType(Typers.scala:1519)
	at scala.tools.nsc.typechecker.Typers$Typer.typedParentTypes(Typers.scala:1662)
	at scala.tools.nsc.typechecker.Namers$Namer.templateSig(Namers.scala:870)
	at scala.tools.nsc.typechecker.Namers$Namer.classSig(Namers.scala:919)
	at scala.tools.nsc.typechecker.Namers$Namer.getSig$1(Namers.scala:1435)
	at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:1453)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply$mcV$sp(Namers.scala:733)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:732)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1$$anonfun$apply$1.apply(Namers.scala:732)
	at scala.tools.nsc.typechecker.Namers$Namer.scala$tools$nsc$typechecker$Namers$Namer$$logAndValidate(Namers.scala:1480)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:732)
	at scala.tools.nsc.typechecker.Namers$Namer$$anonfun$monoTypeCompleter$1.apply(Namers.scala:724)
	at scala.tools.nsc.typechecker.Namers$$anon$1.completeImpl(Namers.scala:1595)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1603)
	at scala.tools.nsc.typechecker.Namers$$anon$1.complete(Namers.scala:1593)
	at scala.tools.nsc.typechecker.Namers$PolyTypeCompleter.completeImpl(Namers.scala:1636)
	at scala.tools.nsc.typechecker.Namers$LockingTypeCompleter$class.complete(Namers.scala:1603)
	at scala.tools.nsc.typechecker.Namers$PolyTypeCompleter.complete(Namers.scala:1615)
	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1310)
	at scala.reflect.internal.Symbols$Symbol.baseTypeSeqLength$1(Symbols.scala:1693)
	at scala.reflect.internal.Symbols$Symbol.isLess(Symbols.scala:1696)
	at scala.reflect.internal.Types$Type.baseTypeIndex(Types.scala:895)
	at scala.reflect.internal.Types$CompoundType.baseType(Types.scala:1532)
	at scala.reflect.internal.Types$ClassTypeRef$class.baseType(Types.scala:2101)
	at scala.reflect.internal.Types$ClassNoArgsTypeRef.baseType(Types.scala:2448)
	at scala.reflect.internal.tpe.TypeComparers$class.firstTry$1(TypeComparers.scala:367)
	at scala.reflect.internal.tpe.TypeComparers$class.isSubType2(TypeComparers.scala:514)
	at scala.reflect.internal.tpe.TypeComparers$class.isSubType(TypeComparers.scala:284)
	at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:14)
	at scala.reflect.internal.Types$Type.$less$colon$less(Types.scala:776)
	at scala.reflect.internal.tpe.GlbLubs$$anonfun$16.apply(GlbLubs.scala:178)
	at scala.reflect.internal.tpe.GlbLubs$$anonfun$16.apply(GlbLubs.scala:178)
	at scala.collection.TraversableLike$$anonfun$filterImpl$1.apply(TraversableLike.scala:259)
	at scala.collection.immutable.List.foreach(List.scala:302)
	at scala.collection.TraversableLike$class.filterImpl(TraversableLike.scala:258)
	at scala.collection.TraversableLike$class.filter(TraversableLike.scala:270)
	at scala.collection.AbstractTraversable.filter(Traversable.scala:104)
	at scala.reflect.internal.tpe.GlbLubs$class.elimSuper(GlbLubs.scala:178)
	at scala.reflect.internal.tpe.GlbLubs$class.glb(GlbLubs.scala:439)
	at scala.reflect.internal.SymbolTable.glb(SymbolTable.scala:14)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAppliedTypeTree$1$1.enhanceBounds$1(Typers.scala:4889)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAppliedTypeTree$1$1.apply(Typers.scala:4904)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedAppliedTypeTree$1$1.apply(Typers.scala:4880)
	at scala.reflect.internal.util.Collections$class.foreach2(Collections.scala:149)
	at scala.reflect.internal.SymbolTable.foreach2(SymbolTable.scala:14)
	at scala.tools.nsc.typechecker.Typers$Typer.typedAppliedTypeTree$1(Typers.scala:4880)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5240)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.typedType(Typers.scala:5422)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTyped$1(Typers.scala:5060)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5249)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.typedBind$1(Typers.scala:4114)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5241)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$120$$anonfun$apply$50.apply(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$120$$anonfun$apply$50.apply(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Contexts$Context.withMode(Contexts.scala:343)
	at scala.tools.nsc.typechecker.Contexts$Context.withImplicitsDisabledAllowEnrichment(Contexts.scala:349)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$120.apply(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$120.apply(Typers.scala:5414)
	at scala.tools.nsc.typechecker.TypeDiagnostics$class.typingInPattern(TypeDiagnostics.scala:62)
	at scala.tools.nsc.Global$$anon$1.typingInPattern(Global.scala:446)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPattern(Typers.scala:5414)
	at scala.tools.nsc.typechecker.Typers$Typer.typedCase(Typers.scala:2437)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedCases$1.apply(Typers.scala:2468)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$typedCases$1.apply(Typers.scala:2467)
	at scala.collection.immutable.List.loop$1(List.scala:172)
	at scala.collection.immutable.List.mapConserve(List.scala:188)
	at scala.tools.nsc.typechecker.Typers$Typer.typedCases(Typers.scala:2467)
	at scala.tools.nsc.typechecker.Typers$Typer.typedMatch(Typers.scala:2479)
	at scala.tools.nsc.typechecker.Typers$Typer.typedVirtualizedMatch$1(Typers.scala:4237)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5243)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2858)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2962)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2962)
	at scala.collection.immutable.List.loop$1(List.scala:172)
	at scala.collection.immutable.List.mapConserve(List.scala:188)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2962)
	at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2418)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5237)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.transformedOrTyped(Typers.scala:5496)
	at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:2249)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5236)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2858)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2962)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2962)
	at scala.collection.immutable.List.loop$1(List.scala:172)
	at scala.collection.immutable.List.mapConserve(List.scala:188)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2962)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:1966)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1790)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5250)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5302)
	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedStat$1(Typers.scala:2858)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2962)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$59.apply(Typers.scala:2962)
	at scala.collection.immutable.List.loop$1(List.scala:172)
	at scala.collection.immutable.List.mapConserve(List.scala:188)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:2962)
	at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:4939

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@retronym said:
BTW, I find it useful to extract this from SBT with sbt export compile, which gives you a command line for scalac.

I then stick that into args.txt, converting spaces to newlines and removing -bootclasspath.

Then, I can use scalac-hash to quickly bisect the behaviour with different scala versions.

It is also possible to use sbt -scala-home $(scala-hash -h v2.11.0-M1) to run within SBT.

-Ydebug is good for cyclic errors as it will prints a stack trace when a cyclic error is hit.

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@adriaanm said:
We should have a list of pro-tips like this somewhere.

@scabug
Copy link
Author

scabug commented Feb 13, 2014

@retronym said:
Here's a test case with a minimization of the cyclic error.

scala/scala#3526

@scabug scabug closed this as completed Feb 14, 2014
@scabug scabug added this to the 2.11.0-RC1 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants