elena-lang
elena-lang copied to clipboard
Auto generating multi-method default handler with type casting
When there is only single variant of multi-method, the autogenerated multi-dispatcher should typecast the value to expected types
E.g. in the following code:
public interface Glyph
{
abstract draw(Window w);
}
The default implementation should be auto.generated, to be equivalent to:
public interface Glyph
{
abstract draw(Window w);
draw(o)
<= draw(cast Window(o));
}
When types are known in compile-time it should inject typecasting and call it directly
resolved