Aladdin - Scala Bugtracking
[#802] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-11-05 15:53:34.0
subject Strange recursive type crash
code
package test;
trait Test {
  abstract class BracesImpl { 
    type Singleton;
    type Brace <: Singleton with BraceImpl;
    trait BraceImpl; 
    trait ForFile;
  }
  abstract class ParensImpl extends BracesImpl { 
    type Brace <: Singleton with BraceImpl;
    trait BraceImpl extends super.BraceImpl;
  }
  val parens : ParensImpl;
  abstract class BracksImpl extends BracesImpl { 
    type Brace <: Singleton with BraceImpl;
    trait BraceImpl extends super.BraceImpl;
  }
  val bracks : BracksImpl;
  trait File {
    def parens0 : parens.BraceImpl;
    def bracks0 : bracks.BraceImpl;
    def braces(b : BracesImpl) = b match {
    case b if b == parens => parens0;
    case b if b == bracks => bracks0;
    }
  }
}
what happened
sean-mcdirmids-computer:~/workspace/test28/src mcdirmid$ ../../scala/build/quick/bin/scalac -d ../bin/ -sou\
rcepath . test/Test.scala
Exception in thread "main" java.lang.Error: recursive <:<
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1831)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1876)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1918)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1876)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$TypeBounds.containsType(Types.scala:653)
	at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$specializesSym(Types.scala:1968)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.specializesSym(Types.scala:1957)
	at scala.tools.nsc.symtab.SymbolTable.specializesSym(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.specializes(Types.scala:283)
	at scala.tools.nsc.symtab.Types$$anonfun$29.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$29.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1873)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1918)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1876)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$TypeBounds.containsType(Types.scala:653)
	at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$specializesSym(Types.scala:1968)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.specializesSym(Types.scala:1957)
	at scala.tools.nsc.symtab.SymbolTable.specializesSym(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.specializes(Types.scala:283)
	at scala.tools.nsc.symtab.Types$$anonfun$29.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$29.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1873)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1918)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1876)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$TypeBounds.containsType(Types.scala:653)
	at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$specializesSym(Types.scala:1968)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.specializesSym(Types.scala:1957)
	at scala.tools.nsc.symtab.SymbolTable.specializesSym(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.specializes(Types.scala:283)
	at scala.tools.nsc.symtab.Types$$anonfun$29.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$29.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1873)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.tools.nsc.symtab.Types$$anonfun$31.apply(Types.scala:1918)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1918)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1876)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.tools.nsc.symtab.Types$$anonfun$28.apply(Types.scala:1915)
	at scala.List.forall(List.scala:832)
	at scala.tools.nsc.symtab.Types$class.isSubType0(Types.scala:1915)
	at scala.tools.nsc.symtab.SymbolTable.isSubType0(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:1832)
	at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:266)
	at scala.tools.nsc.symtab.Types$TypeBounds.containsType(Types.scala:653)
	at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$specializesSym(Types.scala:1968)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.tools.nsc.symtab.Types$$anonfun$33.apply(Types.scala:1958)
	at scala.List.exists(List.scala:848)
	at scala.tools.nsc.symtab.Types$class.specializesSym(Types.scala:1957)
	at scala.tools.nsc.symtab.SymbolTable.specializesSym(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$Type.specializes(Types.scala:283)
	at scala.tools.nsc.symtab.Types$class.addMember(Types.scala:2392)
	at scala.tools.nsc.symtab.SymbolTable.addMember(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$$anonfun$67.apply(Types.scala:2227)
	at scala.tools.nsc.symtab.Types$$anonfun$67.apply(Types.scala:2222)
	at scala.List.foreach(List.scala:687)
	at scala.tools.nsc.symtab.Types$class.lub0$0(Types.scala:2222)
	at scala.tools.nsc.symtab.Types$$anonfun$69.apply(Types.scala:2238)
	at scala.tools.nsc.symtab.Types$$anonfun$69.apply(Types.scala:2238)
	at scala.tools.nsc.symtab.Types$class.limitRecursion(Types.scala:2047)
	at scala.tools.nsc.symtab.Types$class.lub(Types.scala:2238)
	at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$mergePrefixAndArgs(Types.scala:2362)
	at scala.tools.nsc.symtab.Types$class.lubList(Types.scala:2111)
	at scala.tools.nsc.symtab.Types$class.lubArray(Types.scala:2122)
	at scala.tools.nsc.symtab.Types$class.lub0$0(Types.scala:2183)
	at scala.tools.nsc.symtab.Types$$anonfun$69.apply(Types.scala:2238)
	at scala.tools.nsc.symtab.Types$$anonfun$69.apply(Types.scala:2238)
	at scala.tools.nsc.symtab.Types$class.limitRecursion(Types.scala:2047)
	at scala.tools.nsc.symtab.Types$class.lub(Types.scala:2238)
	at scala.tools.nsc.symtab.SymbolTable.lub(SymbolTable.scala:10)
	at scala.tools.nsc.typechecker.Typers$Typer.ptOrLub$0(Typers.scala:1436)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1873)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2108)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2140)
	at scala.tools.nsc.typechecker.Typers$Typer.computeType(Typers.scala:2183)
	at scala.tools.nsc.typechecker.Namers$Namer.methodSig(Namers.scala:503)
	at scala.tools.nsc.typechecker.Namers$Namer.typeSig(Namers.scala:563)
	at scala.tools.nsc.typechecker.Namers$Namer$$anon$0.complete(Namers.scala:336)
	at scala.tools.nsc.symtab.Symbols$Symbol.info(Symbols.scala:395)
	at scala.tools.nsc.symtab.Symbols$Symbol.initialize(Symbols.scala:472)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1729)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2108)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2140)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1199)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1220)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1220)
	at scala.List$.loop$0(List.scala:238)
	at scala.List$.mapConserve(List.scala:255)
	at scala.List$.loop$0(List.scala:242)
	at scala.List$.mapConserve(List.scala:255)
	at scala.List$.loop$0(List.scala:242)
	at scala.List$.mapConserve(List.scala:255)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1220)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:872)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:786)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1739)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2108)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2140)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1199)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1220)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1220)
	at scala.List$.loop$0(List.scala:238)
	at scala.List$.mapConserve(List.scala:255)
	at scala.List$.loop$0(List.scala:242)
	at scala.List$.mapConserve(List.scala:255)
	at scala.List$.loop$0(List.scala:242)
	at scala.List$.mapConserve(List.scala:255)
	at scala.List$.loop$0(List.scala:242)
	at scala.List$.mapConserve(List.scala:255)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1220)
	at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:872)
	at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:786)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1739)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2108)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2140)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStat$0(Typers.scala:1199)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1220)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$48.apply(Typers.scala:1220)
	at scala.List$.loop$0(List.scala:238)
	at scala.List$.mapConserve(List.scala:255)
	at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:1220)
	at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:1735)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2108)
	at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:2140)
	at scala.tools.nsc.typechecker.Analyzer$typerFactory$$anon$1.apply(Analyzer.scala:38)
	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:219)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:208)
	at scala.tools.nsc.Global$GlobalPhase$$anonfun$1.apply(Global.scala:208)
	at scala.Iterator$class.foreach(Iterator.scala:316)
	at scala.collection.mutable.ListBuffer$$anon$0.foreach(ListBuffer.scala:244)
	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:208)
	at scala.tools.nsc.Global$Run.compileSources(Global.scala:473)
	at scala.tools.nsc.Global$Run.compile(Global.scala:542)
	at scala.tools.nsc.Main$.process(Main.scala:74)
	at scala.tools.nsc.Main$.main(Main.scala:96)
	at scala.tools.nsc.Main.main(Main.scala)
Note: giving an explicit type for File.braces (BracesImpl#BraceImpl) avoids the crash.
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2006-11-17 18:32:21.0