pawn-lang / compiler

Pawn compiler for SA-MP with bug fixes and new features - runs on Windows, Linux, macOS
Other
303 stars 70 forks source link

Error 25 should be less aggressive. #654

Open AliLogic opened 3 years ago

AliLogic commented 3 years ago

(Posting on behalf of @Y-Less)

Issue description:

Error 25 should be less aggressive.

Currently, forwards and publics need to match exactly. Not just in type/const, but even in tags and names of variables. For example this is considered an error: (Look Code A)

There's really no reason why it should be. The callback will be called fine, because the shape is still correct. There's an argument that this can detect bugs when some parameters change, but the same isn't true for any other function type. This makes it almost impossible to do even minor things like correct spelling mistakes in headers. Different tags are also marked as an error: (Look Code B)

Minimal complete verifiable example (MCVE):

(Code A)

forward Func(a);

public Func(b)
{
}

(Code B)

forward Func(Tag:a);

public Func(a)
{
}

Tag mismatches are bad, but we already have a warning for them, which I believe should be used here as well.

Workspace Information:

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity.