First of all, thanks for the useful feature.
I'm curious, is this a bug or working as intended:
PHP Code:
// This compiles (SourcePawn Compiler 1.10)
enum struct Foo {
int a;
int bar()
{
int b = this.a;
return b;
}
}
public void OnPluginStart()
{
Foo foo;
foo.bar();
}
But this doesn't work, regardless of the pragma.
PHP Code:
// This doesn't compile:
// plugin.sp(10) : error 147: new-style declarations are required
#pragma newdecls optional
enum struct Foo {
int a;
int bar()
{
new b = this.a; // old-style decl
return b;
}
}
public void OnPluginStart()
{
Foo foo;
foo.bar();
}
While you might wonder why I'd want to do this in the first place, I ran into the issue while using some legacy boilerplate for a newer project. Not a big deal having to rewrite it in newdecls style, but just wondering whether the pragma is actually supposed to allow this.