Aladdin - Scala Bugtracking
[#708] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2006-08-18 08:02:00.0
subject qualified private stack overflow
code
trait A {
  type T;
  trait X {
    private[A] type S <: T;
    private[A] def foo : S;
  }
  trait Y extends X {
    override private[A] type S = Any;
    override private[A] def foo = null;
  }
}
what happened
test/Go.scala:10 error: error overriding type test$A$$S in trait X with bounds : scala.All : A.this.T;
type test$A$$S has incompatible type scala.Any
    override private[A] type S = Any;
                             ^
Exception in thread "main" java.lang.StackOverflowError
	at scala.tools.nsc.symtab.Symbols$Symbol.getFlag(Symbols.scala:310)
	at scala.tools.nsc.symtab.Symbols$ClassSymbol.typeOfThis(Symbols.scala:1043)
	at scala.tools.nsc.symtab.Types$ThisType.singleDeref(Types.scala:542)
	at scala.tools.nsc.symtab.Types$SingletonType.widen(Types.scala:482)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.toPrefix$0(Types.scala:1328)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1330)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1321)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1240)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177)
	at scala.tools.nsc.symtab.Types$class.rebind(Types.scala:1024)
	at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:1087)
	at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:10)
	at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:1243)
	at scala.tools.nsc.symtab.Types$AsSeenFromMap.apply(Types.scala:1361)
	at scala.tools.nsc.symtab.Types$Type.asSeenFrom(Types.scala:194)
	at scala.tools.nsc.symtab.Types$Type.memberType(Types.scala:221)
	at scala.tools.nsc.symtab.Types$Type.findMember(Types.scala:415)
	at scala.tools.nsc.symtab.Types$Type.nonPrivateMember(Types.scala:177) 
        ......
what expected
[back to overview]
Changes of this bug report
Martin  edited on  2006-08-18 15:50:58.0