Skip to content

"Unreachable pattern" error should be "unresolved name" #13995

Closed
@depp

Description

@depp

If an enum's variants are not imported, then matching on them will give an "unreachable pattern" error instead of "unresolved name". Example:

#[crate_type = "rlib"]
use A::E;

mod A {
    pub enum E { V1, V2 }
}

fn test(e: E) -> int {
    match e {
        V1 => 1,
        V2 => 2,
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions