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

Ambiguities in grammar ambiguities #935

Open
BillWagner opened this issue Sep 15, 2023 · 1 comment
Open

Ambiguities in grammar ambiguities #935

BillWagner opened this issue Sep 15, 2023 · 1 comment
Assignees
Labels
type: clarity While not technically incorrect, the Standard is potentially confusing
Milestone

Comments

@BillWagner
Copy link
Member

BillWagner commented Sep 15, 2023

See #757 (comment)

In 6.2.5, this paragraph can be hard to understand:

If the following token is among this list, or an identifier in such a context, then the type_argument_list is retained as part of the simple_name, member_access or pointer_member-access and any other possible parse of the sequence of tokens is discarded. Otherwise, the type_argument_list is not considered to be part of the simple_name, member_access or pointer_member_access, even if there is no other possible parse of the sequence of tokens. (These rules are not applied when parsing a type_argument_list in a namespace_or_type_name §7.8.)

also See #757 (comment)

In 12.12, the grammar for relational and type testing operators has some ambiguities related to is type and is pattern:

  1. A nullable type is allowed for is type, but not for is pattern.
  2. For is pattern, the pattern expression must be the same or higher precedence than shift_expression.

This was deferred from the C# 7.3 standard.

@jskeet jskeet added this to the C# 8.0 milestone Sep 20, 2023
@jskeet jskeet added the type: clarity While not technically incorrect, the Standard is potentially confusing label Sep 20, 2023
@jskeet jskeet modified the milestones: C# 8.0, Pre-C# 8.0 Sep 21, 2023
@Nigel-Ecma
Copy link
Contributor

@gafter – can you give an example (or two) where there is an ambiguity in is pattern or between it and is type? TIA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: clarity While not technically incorrect, the Standard is potentially confusing
Projects
None yet
Development

No branches or pull requests

3 participants