ELENA-LANG / elena-lang

ELENA is a general-purpose language with late binding. It is multi-paradigm, combining features of functional and object-oriented programming. Rich set of tools are provided to deal with message dispatching : multi-methods, message qualifying, generic message handlers, run-time interfaces
https://elena-lang.github.io/
MIT License
236 stars 26 forks source link

Dispatch handle : dispatching to an expression #516

Closed arakov closed 5 months ago

arakov commented 4 years ago

Describe the bug A dispatch handler ignores the target expression (as it was only an object without any operation).

To Reproduce

import extensions;

singleton FieldExtender
{
    Field = new
    {
        foo()
        {
            console.printLine("extended foo")
        }
    };    
}

A
{
    extender := FieldExtender;

    dispatch() => extender.Field;
}

public program()
{
    var a := new A();

    a.foo();
}

Expected behavior A foo method should be correctly invoked

arakov commented 5 months ago

fixed indirectly in the previous releases