| [#449] | project: compiler | priority: low | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Gilles | Martin | fixed | 2005-06-15 18:06:36.0 | |
| subject | View in scope makes overloaded methods ambiguous in a strange way | |||
| code |
class C;
class B;
class D;
object Convert {
implicit def view (value:B): C = new C;
implicit def view (value:C): B = new B;
}
object Test {
def tata (value:B): D = new D;
def tata (value:C): D = new D;
import Convert._;
val toto: D = tata(new B());
}
|
|||
| what happened | Compilation fails:
|
|||
| what expected | A sucessful compilation. As far as I understand, no view should even approach the code when the type of an expression can be inferred without using such a view (which is the case in my example). |
|||
| [back to overview] | ||||
| Gilles edited on 2006-03-24 18:11:32.0 |
| Fixed in Scala2 |