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

use Enum::* confuses type inference #5533

Closed
kornelski opened this issue Jul 25, 2020 · 1 comment
Closed

use Enum::* confuses type inference #5533

kornelski opened this issue Jul 25, 2020 · 1 comment

Comments

@kornelski
Copy link

kornelski commented Jul 25, 2020

enum Enum {
    Bar(u32)
}

fn main() {
    let e = Enum::Bar(1);
    use Enum::*;
    match e {
        Bar(_i_am_unknown) => {}
        Enum::Bar(_works_fine) => {}
    }
}

In vscode hint for _i_am_unknown is {unknown} | u32. The _works_fine variable gets u32 | u32 hint. The {unknown} variable doesn't get type-based autocomplete, etc.

borks works

@lnicola
Copy link
Member

lnicola commented Jul 25, 2020

Duplicate of #1165.

@lnicola lnicola closed this as completed Jul 25, 2020
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

No branches or pull requests

2 participants