I'm sure this is me being silly but I can't make an enum in AS.
I get this.
AS Error: ShipView (29, 3) Expected expression value
AS Error: ShipView (29, 3) Instead found 'enum'
For this.
void Baz()
{
enum Foo
{
BAR
};
}
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
I'm sure this is me being silly but I can't make an enum in AS.
I get this.
AS Error: ShipView (29, 3) Expected expression value
AS Error: ShipView (29, 3) Instead found 'enum'
For this.
void Baz()
{
enum Foo
{
BAR
};
}
I don't know whether AngelScript intends to support enums within function scope, but today it doesn't. Put your enum outside the function scope and it'll work.
enum Foo
{
BAR
};
void Baz()
{
}
I plan on eventually adding support for declaring types as members of classes, e.g. enums and funcdefs. However this is currently not on the top of my priority list.
Declaring types locally in functions is probably not going to happen, unless someone comes up with a very strong argument for this need.