Aladdin - Scala Bugtracking
[#377] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2004-11-16 10:51:40.0
subject Symbol of inferred compound type has no owner
code
class Foo;
case class Foo1() extends Foo;
case class Foo2() extends Foo;

object Test {
  def test: Boolean = test;
  def foo = if (test) Foo1() else Foo2();
  foo.equals(new Foo);
}
what happened
Exception in thread "main" scalac.ApplicationError
	at scalac.symtab.NoSymbol.owner(Symbol.java:2302)
	at scalac.transformer.ExplicitOuterClassesPhase.getTypeTransformerFor(ExplicitOuterClassesPhase.java:160)
	at scalac.transformer.ExplicitOuterClassesPhase.transformInfo(ExplicitOuterClassesPhase.java:81)
	at scalac.symtab.Symbol.transformInfo(Symbol.java:1272)
	at scalac.symtab.Symbol.rawInfoAt(Symbol.java:1209)
	at scalac.symtab.Symbol.rawInfo(Symbol.java:1183)
	at scalac.symtab.Symbol.info(Symbol.java:1157)
	at scalac.symtab.Symbol.isInterface(Symbol.java:708)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:139)
	at scalac.ast.GenTransformer.transform(Transformer.java:557)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:147)
	at scalac.ast.GenTransformer.transform(Transformer.java:600)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:117)
	at scalac.ast.GenTransformer.transform(Transformer.java:498)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:147)
	at scalac.ast.GenTransformer.transform(Transformer.java:595)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:117)
	at scalac.ast.GenTransformer.transform(Transformer.java:498)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:147)
	at scalac.transformer.AddInterfaces.member(AddInterfaces.java:208)
	at scalac.transformer.AddInterfaces.template(AddInterfaces.java:174)
	at scalac.transformer.AddInterfaces.transform(AddInterfaces.java:119)
	at scalac.ast.GenTransformer.apply(Transformer.java:409)
	at scalac.transformer.AddInterfacesPhase.apply(AddInterfacesPhase.java:30)
	at scalac.Global.compile(Global.java:393)
	at scalac.Global.compile(Global.java:363)
	at scala.tools.scalac.Main$.main1(Main.scala:45)
	at scala.tools.scalac.Main$.main(Main.scala:28)
	at scala.tools.scalac.Main.main(Main.scala:28)
[paltherr@lamppc4 test]$ 
what expected No error. The problem is caused by the inferred type of method foo. The analyzer infers that foo has type Foo with CaseClass which is a compound type. The phase explicitouter crashes because the symbol of this compound type is owned by Symbol.NONE. It should be owned by class Test. This bug was submitted by Arco Oost. His original code was this one:
import scala.collection.mutable.HashMap;

class Test {
  def test() = {
    val myVal = (new HashMap[String, String]()).get("1");
    myVal.get.equals("two");
  }
}
[back to overview]
Changes of this bug report
Martin  edited on  2006-03-30 18:42:32.0
Fixed in version 2