I ran into this today, and I was wondering if something is going wrong here.
module example
public rel[str file, AstNode namespace] relFileNamespace;
public void InitGlobals()
{
relFileNamespace = {};
}
Then in the console:
rascal>import example;
ok
rascal>InitGlobals();
ok
rascal>relFileNamespace
|stdin:///|(0,13,<1,0>,<1,13>): Undeclared variable, function or constructor: relFileNamespace
If I declare it like this it does work.
public rel[str file, AstNode namespace] relFileNamespace = {};
So the question is, why does it have to be initialized in the declaration?