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

GRAM&ANN&TY: Support if let guard syntax #7799

Merged
merged 4 commits into from Nov 14, 2021
Merged

GRAM&ANN&TY: Support if let guard syntax #7799

merged 4 commits into from Nov 14, 2021

Conversation

mchernyavsky
Copy link
Member

@mchernyavsky mchernyavsky commented Sep 6, 2021

Closes #7794.

changelog: Support if let guard syntax

@mchernyavsky mchernyavsky changed the title PARSE&ANN: Annotate if let guard syntax as experimental GRAM&ANN: Annotate if let guard syntax as experimental Sep 6, 2021
@Undin Undin added this to In Progress in To test via automation Sep 6, 2021
@mchernyavsky mchernyavsky assigned artemmukhin and unassigned Undin Sep 20, 2021
@mchernyavsky mchernyavsky changed the title GRAM&ANN: Annotate if let guard syntax as experimental GRAM&ANN: Support if let guard syntax Sep 27, 2021
Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

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

It would be great to support type inference and name resolution for items from if let guard.
For example, in the following example

#![feature(if_let_guard)]

enum Foo {
    Bar(i32),
    Baz
}

fn foo(f: Foo, y: i32) {
    match y {
        1 if let Foo::Bar(z) = f => { z + y }
        _ => 0
    };
}

the plugin knows neither the type nor location of z variable

Don't insist on implementing it in this PR. But probably it's worth converting the original issue into a meta issue for if let guard feature support and track progress there

@mchernyavsky mchernyavsky changed the title GRAM&ANN: Support if let guard syntax GRAM&ANN&TY: Support if let guard syntax Nov 9, 2021
@mchernyavsky mchernyavsky force-pushed the if-let-guard branch 3 times, most recently from 2ec24e5 to 83a249e Compare November 9, 2021 21:06
@mchernyavsky
Copy link
Member Author

@Undin fixed.

@mchernyavsky mchernyavsky assigned Undin and unassigned artemmukhin Nov 9, 2021
Copy link
Member

@Undin Undin left a comment

Choose a reason for hiding this comment

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

👍
bors r+

@bors
Copy link
Contributor

bors bot commented Nov 14, 2021

Build succeeded:

@bors bors bot merged commit 4c192cd into master Nov 14, 2021
To test automation moved this from In Progress to Test Nov 14, 2021
@bors bors bot deleted the if-let-guard branch November 14, 2021 12:07
@github-actions github-actions bot added this to the v160 milestone Nov 14, 2021
@neonaot neonaot self-assigned this Nov 15, 2021
@neonaot neonaot moved this from Test to Done in To test Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
To test
  
Done
Development

Successfully merging this pull request may close these issues.

IDE can't parse #![feature(if_let_guard)] syntax
5 participants