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

Update disambiguation rules in spec #8046

Merged
merged 2 commits into from
Feb 1, 2018
Merged

Conversation

mppf
Copy link
Member

@mppf mppf commented Dec 15, 2017

This PR updates the spec to match the currently implemented disambiguation rules. This update is a follow-on to PR #7659.

Reviewed by @daviditen - thanks!

more specific argument mapping than the corresponding legal argument
mapping to $F_2$, then $F_2$ is more specific.

\item Similarly, if at least one argument mapping to $F_2$ is {\em more
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should go back to matching the pattern of the rest of the list items - worded the same as the previous point but with F_1 and F_2 swapped.

\item If all \chpl{param} arguments prefer $F_1$ over $F_2$, then $F_1$ is more specific. In order of preference, a \chpl{param} argument prefers to be passed to (a) a \chpl{param} formal of matching type; (b) a \chpl{param} formal large enough to store the \chpl{param} value; (c) a non-\chpl{param} formal of matching type.
\item If all \chpl{param} arguments prefer $F_2$ over $F_1$, then $F_2$ is more specific.

\item If at least one of the legal argument mappings to $F_1$ is {\em
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to go back to a single level of specific/preferred by defining more ordered rules in the "determining more specific" section below? Having four different levels is a pretty big increase in how confusing this is.

Copy link
Member Author

@mppf mppf Jan 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that it's more confusing. The additional levels are helping with cases where there are say 2 functions f1 and f2 under consideration, and each has two arguments, let's say f1a f1b and f2a f2b. The situation (that comes up a lot) is that f1a is a better match than f2a but f2b is a better match than f2a. The multiple levels help this case. Rearranging the order within the determining more specific functions / arguments can't help that case.

Copy link
Member

@daviditen daviditen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the one change requested on line 1229 I think this is good to merge.

@mppf mppf changed the title Draft spec changes for PR #7659 Update disambiguation rules in spec Feb 1, 2018
@mppf mppf merged commit d467aeb into chapel-lang:master Feb 1, 2018
@mppf mppf deleted the resolution-current branch February 1, 2018 18:44
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

Successfully merging this pull request may close these issues.

2 participants