Aladdin - Scala Bugtracking
[#262] project: compiler priority: high category: bug
submitter assigned to status date submitted
Erik Martin fixed 2003-12-15 12:58:14.0
subject symtab.Type.lub loops
code
object O {
  abstract class A {
    def f:A; 
  }
  class B extends A {
    def f = if(1 == 2) new C else new D;
  }
  class C extends A { 
    def f = this;
  }
  class D extends A {
    def f = this;
  }
}
what happened
Exception in thread "main" java.lang.StackOverflowError
        at scalac.Phase.precedes(Phase.java:54)
        at scalac.symtab.Symbol.rawInfoAt(Symbol.java:864)
        at scalac.symtab.Symbol.rawInfo(Symbol.java:846)
        at scalac.symtab.Symbol.info(Symbol.java:820)
        at scalac.symtab.Symbol.type(Symbol.java:944)
        at scalac.symtab.TypeSymbol.type(Symbol.java:1542)
        at scalac.symtab.ClassSymbol.typeOfThis(Symbol.java:1852)
        at scalac.symtab.Type.singleDeref(Type.java:342)
        at scalac.symtab.Type.baseType(Type.java:1161)
        at scalac.symtab.Type.toPrefix(Type.java:1314)
        at scalac.symtab.Type.toPrefix(Type.java:1314)
        at scalac.symtab.Type.toPrefix(Type.java:1314)
        at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1233)
        at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1246)
        at scalac.symtab.Type$Map.map(Type.java:1084)
        at scalac.symtab.Type.asSeenFrom(Type.java:1330)
        at scalac.symtab.Type.parents(Type.java:524)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1621)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1616)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1607)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1621)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1616)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1607)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1621)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1616)
        at scalac.symtab.TypeSymbol.inclClosure(Symbol.java:1607)
        at scalac.symtab.TypeSymbol.computeClosureAt(Symbol.java:1589)
        at scalac.symtab.TypeSymbol.closure(Symbol.java:1556)
        at scalac.symtab.Symbol.closurePos(Symbol.java:1062)
        at scalac.symtab.Symbol.baseType(Symbol.java:1077)
        at scalac.symtab.Type.baseType(Type.java:1177)
        at scalac.symtab.Type.baseType(Type.java:1161)
        at scalac.symtab.Type.toPrefix(Type.java:1314)
        at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1233)
        at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1269)
        at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1246)
        at scalac.symtab.Type$Map.map(Type.java:1063)
        at scalac.symtab.Type$Map.map(Type.java:1104)
        at scalac.symtab.Type$Map.map(Type.java:1098)
        at scalac.symtab.Type$Map.map(Type.java:1035)
        at scalac.symtab.Type$AsSeenFromMap.apply(Type.java:1276)
        at scalac.symtab.Type.asSeenFrom(Type.java:1324)
        at scalac.symtab.Type.memberInfo(Type.java:1336)
        at scalac.symtab.Type.memberTp(Type.java:2600)
        at scalac.symtab.Type.lub(Type.java:2568)
        at scalac.symtab.Type.methodLub(Type.java:2660)
        at scalac.symtab.Type.lub(Type.java:2537)
        at scalac.symtab.Type.lub(Type.java:2675)
        at scalac.symtab.Type.lub(Type.java:2583)
        at scalac.symtab.Type.methodLub(Type.java:2660)
        at scalac.symtab.Type.lub(Type.java:2537)
        at scalac.symtab.Type.lub(Type.java:2675)
        at scalac.symtab.Type.lub(Type.java:2583)
        at scalac.symtab.Type.methodLub(Type.java:2660)
        at scalac.symtab.Type.lub(Type.java:2537)
        at scalac.symtab.Type.lub(Type.java:2675)
        at scalac.symtab.Type.lub(Type.java:2583)
        at scalac.symtab.Type.methodLub(Type.java:2660)
        at scalac.symtab.Type.lub(Type.java:2537)
        at scalac.symtab.Type.lub(Type.java:2675)
...
what expected A nice, silent compilation.
[back to overview]
Changes of this bug report
Matthias  edited on  2003-12-17 00:05:51.0
Martin  edited on  2004-01-07 19:07:06.0
Fixed by elimimating refinements from the language.