-
Notifications
You must be signed in to change notification settings - Fork 421
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
error: ambiguous call with use statement in block scope #14013
Comments
Function calls are always resolved by checking against all versions of the function visible to the call site, no matter their distance from it. This allows us to find the right version if a more specific match was "further out", rather than immediately throwing our hands up at the first version found |
Meta comment - should this be a stackoverflow discussion? |
That makes sense to me, but wouldn't global variables be equally affected? It seems weird to allow shadowed hijacking of global variables via an unqualified access through Edit: I guess the difference is that variables can't be overloaded like functions like you mentioned. |
Yeah, variables can't be overloaded is basically what my answer summarizes to. In unlimited |
I agree with the "functions can be overloaded and variables can't" part of this discussion. Copying a comment over from #11262:
|
Naive question. Is this code something that would be disambiguated by overload sets? |
I had that question too, but based on the discussion on the Arkouda issue, I'd guess not. |
See also #19167. I think that the example at the top of the issue is ambiguous because |
Forked from #11262 (comment)
Why is this code ambiguous? Shouldn't it unambiguously call
M.fn
?chpl version 1.19.0
andchpl version 1.20.0 pre-release (8cb22586)
The text was updated successfully, but these errors were encountered: