pawn-lang / compiler

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

`tagof` default vars incredibly fragile #690

Open Y-Less opened 2 years ago

Y-Less commented 2 years ago

Issue description:

Minimal complete verifiable example (MCVE):

This works (tag is tagof (b:)):

Func({a, b, c}:arg, tag = tagof (arg))
{
}

main()
{
    Func(b:0);
}

This doesn't (tag is tagof (a:)):

Func({a, b, c}:arg, tag = _:tagof (arg))
{
}

main()
{
    Func(b:0);
}

Neither does this:

Func({a, b, c}:arg, tag = (tagof (arg)))
{
}

main()
{
    Func(b:0);
}

It seems that even the slightest change to the default tagof argument breaks its semantics entirely.

Workspace Information:

Daniel-Cortez commented 2 years ago

Operator sizeof is breaking from the slightest changes in the same way and I already explained the cause of this bug in that issue. The potential way to fix this is also described there, although I'd say such fix would be very complicated.

stale[bot] commented 2 years ago

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