Aladdin - Scala Bugtracking
[#348] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Burak Martin fixed 2004-07-05 12:19:28.0
subject handling virtual types in nested objects
code
trait Foo {
  type bar <: Bar;
  abstract class Bar;
  case class Baz(r:bar) extends Bar;
  case object NoBar extends Bar;
}
object Test with Application {
  object ConcreteFooBar extends Foo { // if moved to toplevel, it works
    type bar = Bar;
  }
  def foo = {
    import ConcreteFooBar._ ;
    Baz( NoBar )
  }
}
what happened
/tmp> scalac testExpr.scala
Exception in thread "main" scalac.symtab.Type$Malformed: malformed type: ConcreteFooBar[Test.type]#bar
	at scalac.symtab.Type.typeRef(Type.java:201)
	at scalac.symtab.Type$Map.map(Type.java:1015)
	at scalac.symtab.Type$SubstMap.apply(Type.java:1392)
	at scalac.symtab.Type$Map.map(Type.java:1083)
	at scalac.symtab.Type$Map.map(Type.java:1130)
	at scalac.symtab.Type$Map.map(Type.java:1124)
	at scalac.symtab.Type$Map.map(Type.java:1055)
	at scalac.symtab.Type$SubstMap.apply(Type.java:1392)
	at scalac.symtab.Type.subst(Type.java:1558)
	at scalac.ast.TreeGen.TypeApply(TreeGen.java:427)
	at scalac.transformer.ExplicitOuterClassesPhase$12.transform(ExplicitOuterClassesPhase.java:531)
	at scalac.transformer.ExplicitOuterClassesPhase$12.transform(ExplicitOuterClassesPhase.java:439)
	at scalac.ast.GenTransformer.transform(Transformer.java:539)
	at scalac.transformer.ExplicitOuterClassesPhase$12.transform(ExplicitOuterClassesPhase.java:497)
	at scalac.ast.GenTransformer.transform(Transformer.java:495)
	at scalac.transformer.ExplicitOuterClassesPhase$12.transform(ExplicitOuterClassesPhase.java:497)
	at scalac.transformer.ExplicitOuterClassesPhase$12.transform(ExplicitOuterClassesPhase.java:417)
	at scalac.ast.GenTransformer.transform(Transformer.java:597)
	at scalac.transformer.ExplicitOuterClassesPhase$12.transform(ExplicitOuterClassesPhase.java:397)
	at scalac.ast.GenTransformer.transform(Transformer.java:597)
	at scalac.ast.GenTransformer.apply(Transformer.java:406)
	at scalac.ast.GenTransformer.apply(Transformer.java:400)
	at scalac.transformer.ExplicitOuterClassesPhase.apply(ExplicitOuterClassesPhase.java:73)
what expected silent compilation.
I am not sure whether the error is of ExplicitOuter or before.
[back to overview]
Changes of this bug report
Martin  edited on  2004-11-19 19:48:43.0