1 Feb 02:04
Why is the compiler complaining about default argument values?
In a class, the following three method signatures are defined:
def insert(at: Int, insertee: Mark, direction: Direction = Forward): Mark = ...
def insert(at: Mark, insertee: Mark, direction: Direction = Forward): Mark = ...
def insert(at: Mark, content: Content, direction: Direction);
The types of arguments ensure that there can be no possible ambiguity as to which is called (there is no inheritance between Content and Mark). However, the compiler says:
error: in trait Element, multiple overloaded alternatives of method insert define default arguments.
trait Element {
Why is this a problem? There's no erasure happening, so I don't see why there would be any run-time ambiguity.
Thanks,
Ken
RSS Feed