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

False positive "nullary function should not be overloaded" for functions that accept tuple patterns #2105

Open
jurgenvinju opened this issue Dec 18, 2024 · 3 comments
Assignees

Comments

@jurgenvinju
Copy link
Member

Describe the bug

image
@PaulKlint
Copy link
Member

Can you give more details? I cannot reproduce this.

@jurgenvinju
Copy link
Member Author

I've reduced it to the following minimal module:

module BugTest

data Enum = x();

value f(<x>) = [];    // Nullary function `f` should not be overloaded
value f(<x,y>) = []; // Nullary function `f` should not be overloaded

@jurgenvinju
Copy link
Member Author

jurgenvinju commented Dec 23, 2024

  • the data Enum = x(); is essential; without it the errors are not reported.
  • the interpreter executes this code correctly for any x that is wrapped by singleton or binary tuple.
  • this code should have types for the x and y patterns, per the static semantics of Rascal. So this is not correct code in any way.

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

No branches or pull requests

2 participants