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

Boxing the symbol expression #667

Closed arakov closed 4 months ago

arakov commented 4 months ago

Describe the bug

The static symbol must box the expression to the symbol type

To Reproduce

static Reference<int> Seed = 0;

int getSeed()
{
   int newVal := Seed + 1;

   Seed.Value := newVal;

   ^ newVal;
}

public program()
{
   console.writeLine(getSeed());
   console.writeLine(getSeed());
   console.writeLine(getSeed());
}

Expected behavior

The code must work corectly : generating three numbers : 1,2,3

arakov commented 4 months ago

fixed in 6.2.2