Using AngelScript 2.30.0, I encountered these two today:
An unjustified compile time error when a method of a class in a namespace calls a function with an argument that defaults to a global variable:
int i;
void f(int a = i) {}
namespace n {
class c {
void m() {
f();
}
}
}
script.as (5, 3) : INFO : Compiling void c::m()
default arg (1, 1) : ERR : 'i' is not declared
script.as (6, 4) : ERR : Failed while compiling default arg for parameter 0 in function 'void f(int = i)'
An unjustified compile time error when a class in a namespace has a property that defaults to a global variable:
int i;
namespace n {
class c {
int p = i;
}
}
script.as (3, 8) : INFO : Compiling c::c()
script.as (4, 11) : ERR : 'i' is not declared
The errors disappear if "::" is added in front of "i" in the appropriate places in the above examples but given the conditions it shouldn't be required (and, in the former case, may be impossible to add from script level if the function in question is registered by the application).