Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid error for keyword arguments #290

Open
pvogt09 opened this issue Apr 24, 2024 · 0 comments
Open

Invalid error for keyword arguments #290

pvogt09 opened this issue Apr 24, 2024 · 0 comments

Comments

@pvogt09
Copy link

pvogt09 commented Apr 24, 2024

MISS_HIT Component affected
Please choose one from:

  • Style checker

Your MATLAB/Octave environment

  • MATLAB
  • R2023B

Your operating system and Python version

  • Linux
  • python 3.8.10

Describe the bug
The file

 function [] = test()
    a = 0;
    arguments = struct(...
        'test', 1.0...
    );
end

gives the error

In arguments.m, line 3
|     arguments = struct(...
|     ^^^^^^^^^ error: expected valid statement, found keyword 'arguments' instead
MISS_HIT Style Summary: 1 file(s) analysed, 1 error(s)

which should not be the case because it is allowed to have variables called arguments as long as the keyword does not appear as the first expression in the function body (a = 0; makes the difference here between invalid Matlab syntax and correct code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant