-
Notifications
You must be signed in to change notification settings - Fork 492
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
Add Spec Identifier Syntax to expressions.md and subchapters #1591
base: master
Are you sure you want to change the base?
Add Spec Identifier Syntax to expressions.md and subchapters #1591
Conversation
…xpr, tuple-expr, and underscore-expr
@@ -169,29 +197,46 @@ Explicitly, the assignee expressions are: | |||
fields). | |||
- [Unit structs][_StructExpression_]. | |||
|
|||
r[expr.place-value.parentehesis] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r[expr.place-value.parentehesis] | |
r[expr.place-value.parenthesis] |
Unlike other expressions, parenthesized expressions are both [place expressions and value expressions][place]. | ||
When the enclosed operand is a place expression, it is a place expression and when the enclosed operand is a value expression, it is a value expression. | ||
|
||
r[expr.paren.overridew-precedence] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r[expr.paren.overridew-precedence] | |
r[expr.paren.override-precedence] |
When looking up a method call, the receiver may be automatically dereferenced or borrowed in order to call a method. | ||
This requires a more complex lookup process than for other functions, since there may be a number of possible methods to call. | ||
The following procedure is used: | ||
|
||
r[expr.method.candidate-recievers] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r[expr.method.candidate-recievers] | |
r[expr.method.candidate-receivers] |
The first step is to build a list of candidate receiver types. | ||
Obtain these by repeatedly [dereferencing][dereference] the receiver expression's type, adding each type encountered to the list, then finally attempting an [unsized coercion] at the end, and adding the result type if that is successful. | ||
|
||
r[expr.method.candidate-recievers-refs] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r[expr.method.candidate-recievers-refs] | |
r[expr.method.candidate-receivers-refs] |
@@ -58,11 +69,14 @@ Then, for each candidate type `T`, search for a [visible] method with a receiver | |||
> } | |||
> ``` | |||
|
|||
r[expr.method.ambiguious-target] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r[expr.method.ambiguious-target] | |
r[expr.method.ambiguous-target] |
This process does not take into account the mutability or lifetime of the receiver, or whether a method is `unsafe`. | ||
Once a method is looked up, if it can't be called for one (or more) of those reasons, the result is a compiler error. | ||
|
||
r[expr.method.ambiguious-search] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r[expr.method.ambiguious-search] | |
r[expr.method.ambiguous-search] |
This adds identifier syntax to
expressions.md
and all subchapters.