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
227 stars 23 forks source link

Boxing the symbol expression #667

Open arakov opened 4 days ago

arakov commented 4 days 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