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

[Feature Request]: Better error for parenful call to parenless proc #26647

Open
riftEmber opened this issue Feb 4, 2025 · 0 comments
Open

[Feature Request]: Better error for parenful call to parenless proc #26647

riftEmber opened this issue Feb 4, 2025 · 0 comments

Comments

@riftEmber
Copy link
Member

Summary of Feature

Description:

It would be nice if, when calling a parenless proc as though it were a 0-argument parenful proc, the error message specifically called that out as the potential cause.

Is this issue currently blocking your progress?

no

Code Sample

proc doSomething do return 1;
var x = doSomething(); // parenful call to parenless

Output:

mytest.chpl:1: In module 'mytest':
mytest.chpl:2: error: unresolved access of 'int(64)' by '()'
mytest.chpl:2: note: unresolved call had id 318109

Dyno output:

─── error in mytest.chpl:2 [NoMatchingCandidates] ───
  Unable to resolve call to 'this': no matching candidates.
      |
    2 | var x = doSomething(); // parenful call to parenless
      |

[long list of failed candidates]

Both errors reflect performing the parenless call, then trying to call a 0-arg parenful this proc on it. That could be what the user intended so that error output is potentially helpful. However, it's also likely the user just forgot they're calling a parenless. It would be nice for the error output to include something like:

note: perhaps you meant to call the parenless proc 'doSomething'?
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

1 participant