Skip to content

Bizzare error for invalid if #512

@Y-Less

Description

@Y-Less

Issue description:

Missing the brackets on an if statement gives an error about invalid subscripts:

error 028: invalid subscript (not an array or too many subscripts): "var"
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "-end of file-"

This would be a far better error:

error 001: expected token: "(", but found "-identifier-"

Minimal complete verifiable example (MCVE):

main()
{
	new var;
	if var
	{
	}
}

Workspace Information:

  • Compiler version:
  • Command line arguments provided (or sampctl version):
  • Operating System:

3.10.10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions