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
Describe the bug
In the following code the program is not terminated correctly. The code works correctly till the end but the program hangs at the
end.
To Reproduce
import extensions;
class IntWrapper
{
int value;
constructor(int value)
{
this value := value
}
int cast()
= value;
}
class MyClass
{
add(int n)
{
console.printLine("add int:(",n,")")
}
add(string s)
{
console.printLine("add literal:(",s,")")
}
add(o)
{
if (o; is int n) {
^ self.add(n);
};
console.printLine("unsupported")
}
}
public program()
{
var o := new MyClass();
var wrapper := new IntWrapper(4);
o.add("string");
o.add(2);
o.add(wrapper);
o.add(2.3); // when this line is commented, the code works correctly and ends without a problem
}
Expected behavior
The code must end without hanging indefinitely
Describe the bug In the following code the program is not terminated correctly. The code works correctly till the end but the program hangs at the end.
To Reproduce
Expected behavior The code must end without hanging indefinitely