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

Having 2 functions with the same name should throw an error. #235

Open
Remi-Gau opened this issue Oct 4, 2021 · 4 comments
Open

Having 2 functions with the same name should throw an error. #235

Remi-Gau opened this issue Oct 4, 2021 · 4 comments
Labels
component: parser Affects the parser requires: sem Change can only be implemented once semantic analysis works tool: mh_lint Affects the linter

Comments

@Remi-Gau
Copy link
Contributor

Remi-Gau commented Oct 4, 2021

What kind of feature is this?

New feature in MISS_HIT

Your MATLAB/Octave environment

MATLAB

Octave is not affected by this

MISS_HIT component affected

I think this falls under the linter.

Describe the solution you'd like

Matlab will not use a file where 2 functions have the same name. I suspect that ms lint should flag this, no?

Example:

function temp()
end

function foo()
end

function foo()
end
@florianschanda
Copy link
Owner

Yes, it definitely should; but right now there is zero semantic analysis going on.

There is a sanity check that a function name doesn't clash with some important built-ins (like true, and yes this happened for real once, just remember all safety rules are written in blood) but other than that there is nothing going on: no symbol table no name resolution, nothing.

I have a very big project ahead of me to do this, as it would enable a large number of useful checks (e.g. look at issues requiring sem that are open right now).

I plan to do this; but don't expect anything this year...

@florianschanda florianschanda added requires: sem Change can only be implemented once semantic analysis works tool: mh_lint Affects the linter component: parser Affects the parser labels Oct 5, 2021
@florianschanda
Copy link
Owner

In fact I've re-opened #236 and put the same labels on it to make sure I capture this

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Oct 5, 2021

I plan to do this; but don't expect anything this year...

No rush at all.

miss_hit as it is has already brought much joy and removed a lot of my pain from my every day life. So anything beyond that is just icing on the cake. 👍

@florianschanda
Copy link
Owner

That is some really nice feedback, it makes me very happy to hear that. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: parser Affects the parser requires: sem Change can only be implemented once semantic analysis works tool: mh_lint Affects the linter
Projects
None yet
Development

No branches or pull requests

2 participants