Aladdin - Scala Bugtracking
[#151] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2003-09-29 13:42:46.0
subject confuising error message with type selection
code
abstract class Foo {
  type T;
  def foo(a: T): Int = 0;
  val foo: Foo = null;
  def a: foo.T = a;
}
what happened
./tmp/test.scala:5: malformed type: Foo#T
  def a: foo.T = a;
            ^
one error found
what expected

A less confusing error message.

The error occurs because there are two definitions of foo. If the first one is renamed, there is no error. The analyzer probably tries to select T from the overloaded symbol foo which is illegal and which is probably the origin of this error message. However, a message like "don't know from which foo select T" would be less confusing and more usefull to the user.

[back to overview]
Changes of this bug report
Martin  edited on  2003-10-09 15:01:02.0
The spec is not quite clear on this, but I think it can be read that no error should be generated in this case. That's what the compiler does now.