elena-lang icon indicating copy to clipboard operation
elena-lang copied to clipboard

Auto generating multi-method default handler with type casting

Open arakov opened this issue 4 years ago • 1 comments

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));
}

arakov avatar Sep 18 '20 09:09 arakov

When types are known in compile-time it should inject typecasting and call it directly

arakov avatar Sep 18 '20 09:09 arakov

resolved

arakov avatar Jul 01 '23 21:07 arakov