Skip to content

Generic parameters in some paths in patterns are ignored #16353

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

Closed
huonw opened this issue Aug 8, 2014 · 0 comments
Closed

Generic parameters in some paths in patterns are ignored #16353

huonw opened this issue Aug 8, 2014 · 0 comments
Labels
A-type-system Area: Type system

Comments

@huonw
Copy link
Member

huonw commented Aug 8, 2014

The following compiles fine (the Some::<u8> line does not, however).

fn main() {
    match Some("foo") {
        None::<int> => {}
        // Some::<u8>(_) => {}
        Some(_) => {}
    }
}  

(Nominated for backcompat-lang :( since changing this can cause programs to break.)

bors added a commit that referenced this issue Aug 12, 2014
patterns.

This breaks code like:

    fn main() {
        match Some("foo") {
            None::<int> => {}
            Some(_) => {}
        }
    }

Change this code to not contain a type error. For example:

    fn main() {
        match Some("foo") {
            None::<&str> => {}
            Some(_) => {}
        }
    }

Closes #16353.

[breaking-change]

r? @huonw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant