| [#136] | project: compiler | priority: medium | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Philippe | Martin | fixed | 2003-09-12 11:19:51.0 | |
| subject | type of this not always used | |||
| code |
class Foo;
class Bar: Foo {
val bar: Bar = null;
val foo1: Foo = this;
val foo2: Foo = bar;
}
object bar: Foo {
val foo1: Foo = this;
val foo2: Foo = bar;
}
|
|||
| what happened | tmp/test.scala:5: type mismatch;
found : Bar#0
required: Foo#1
val foo2: Foo = bar;
^
tmp/test.scala:8: type mismatch;
found : bar#2
required: Foo#1
val foo1: Foo = this;
^
|
|||
| what expected | There should be no error. | |||
| [back to overview] | ||||
| Martin edited on 2003-09-17 21:37:35.0 |
| The first error message is correct, as Bar is not a subtype of Foo. The second error message was a bug. |