Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #16595
Fixes #4009

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner November 16, 2025 15:56
@CyrusNajmabadi
Copy link
Member Author

@dotnet/roslyn-compiler this is ready for review.

@jcouv jcouv self-assigned this Nov 19, 2025
public void InProgressMultipleExpressionsInIfStatement2()
{
UsingTree("""
if (1 2)
Copy link
Member

Choose a reason for hiding this comment

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

Consider testing if (1 2 3)

Copy link
Member Author

Choose a reason for hiding this comment

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

6953506. Note: recovery isn't great. But that's ok.

  1. it's no worse than before
  2. this is not an intermediary state. it woudl require deleting multiple discontinuous tokens to get here.

Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Done with review pass (commit 7)

@CyrusNajmabadi
Copy link
Member Author

Maybe just "operator expected"?

@jcouv
Copy link
Member

jcouv commented Nov 19, 2025

Maybe just "operator expected"?

Meh, I guess. I'm not sure what to expect. I just know that the second expression is unexpected.

@CyrusNajmabadi
Copy link
Member Author

I can just say Unexpected token '...' on the token that follows.

@CyrusNajmabadi CyrusNajmabadi requested a review from jcouv November 19, 2025 12:12
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (commit 10)

Copy link
Member

Choose a reason for hiding this comment

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

Can we add some tests for tuple expressions? And deconstruction assignments?

Copy link
Member Author

@CyrusNajmabadi CyrusNajmabadi Nov 20, 2025

Choose a reason for hiding this comment

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

Added tests. Tuples retain the same poor behavior as before.

I'm not changing this as tuple expression parsing is more complex due to allowing declaration, and being comma separable not just having a close paren that follows but also a comma. Fixing would be move involved and I'd prefer to keep this pr simple and safe :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants