Aladdin - Scala Bugtracking
[#358] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2004-08-23 17:56:08.0
subject Self-types at top-level not supported
code
trait Foo;
trait Bar: Foo;
what happened
Exception in thread "main" java.lang.AssertionError: [Foo,Bar]
	at scalac.symtab.Type$ExtCompoundType.(Type.java:273)
	at scalac.symtab.Type.compoundTypeWithOwner(Type.java:244)
	at scala.tools.scalac.typechecker.Analyzer$class.defineSelfType(Analyzer.scala:1344)
	at scala.tools.scalac.typechecker.Analyzer$LazySelfType$class.complete(Analyzer.scala:663)
	at scalac.symtab.Symbol.info(Symbol.java:1134)
	at scalac.symtab.Symbol.type(Symbol.java:1291)
	at scalac.symtab.ClassSymbol.typeOfThis(Symbol.java:2105)
	at scalac.symtab.Type.singleDeref(Type.java:355)
	at scalac.symtab.Type.baseType(Type.java:1196)
	at scalac.symtab.Type.isSubType0(Type.java:1917)
	at scalac.symtab.Type.isSubType(Type.java:1863)
	at scala.tools.scalac.typechecker.Analyzer$class.validateParentClasses(Analyzer.scala:341)
	at scala.tools.scalac.typechecker.Analyzer$class.transformTemplate(Analyzer.scala:1924)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2246)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2178)
	at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
	at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:19)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2177)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2118)
	at scala.tools.scalac.typechecker.Analyzer$class.transformStatSeq(Analyzer.scala:1868)
	at scala.tools.scalac.typechecker.Analyzer$class.apply(Analyzer.scala:131)
	at scalac.ast.Transformer.apply(Transformer.java:64)
	at scala.tools.scalac.typechecker.Analyzer$class.apply(Analyzer.scala:67)
	at scala.tools.scalac.typechecker.AnalyzerPhase$class.apply(AnalyzerPhase.scala:69)
	at scalac.Global.compile(Global.java:386)
	at scalac.Global.compile(Global.java:356)
	at scala.tools.scalac.Main$.main1(Main.scala:42)
	at scala.tools.scalac.Main$.main(Main.scala:28)
	at scala.tools.scalac.Main.main(Main.scala:28)
what expected No error. Note that if everything is moved into some class, no error occurs.
[back to overview]
Changes of this bug report
Philippe  edited on  2004-08-23 17:57:27.0
Fixed title
Martin  edited on  2006-03-30 18:44:30.0
fixed in version 2
Martin  edited on  2006-03-30 18:44:47.0