compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Passing arguments by reference unexpected syntax requirement

Open BitFros7y opened this issue 5 years ago • 1 comments

Issue description:

Issue is just small unexpected syntax behavior that should be improved Placing & after tag and before variable drops error error 001: expected token: "-identifier-", but found "&" stock demostrationFunc(Float: &testvarref) Drops error above

I would expect it to work just fine like it does if its in front of tag like here stock demostrationFunc(&Float: testvarref) <- That works fine

Minimal complete verifiable example (MCVE):

#include <a_samp>
#include <fixes>

main()
{
    new Float: mytestvar;
    demostrationFunc(mytestvar);
}

stock demostrationFunc(Float: &testvarref)//These fails, drops error
{
	testvarref = 4.333;
}

Workspace Information:

  • Compiler version: 3.10.10
  • Command line arguments provided (or sampctl version): Standard sublime by Southclaws
  • Operating System: Windows 7 Ultimate x64 SP1

BitFros7y avatar Nov 20 '20 03:11 BitFros7y

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

stale[bot] avatar Jun 22 '21 17:06 stale[bot]