Skip to content

type parameters on field references are allowed #18680

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
nikomatsakis opened this issue Nov 6, 2014 · 2 comments
Closed

type parameters on field references are allowed #18680

nikomatsakis opened this issue Nov 6, 2014 · 2 comments
Milestone

Comments

@nikomatsakis
Copy link
Contributor

It's not clear to me why this even parses, much less compiles:

struct Foo { f: uint }

fn foo(f: Foo) -> uint {
    f.f::<int>
}

fn main() { }
@huonw
Copy link
Member

huonw commented Nov 6, 2014

Nominating, seems like something that should be removed before 1.0 if we don't want to support it.

@pnkfelix
Copy link
Member

pnkfelix commented Nov 6, 2014

Assigning P-backcompat-lang, 1.0.

(I will note that a number of team pointed out that it would be very suprising if fixing this actually broke anyone's code, even post 1.0...)

@pnkfelix pnkfelix added this to the 1.0 milestone Nov 6, 2014
bors added a commit that referenced this issue Nov 13, 2014
This breaks code like:

    struct Foo {
        x: int,
    }

    let f: Foo = ...;
    ... f.x::<int> ...

Change this code to not contain an unused type parameter. For example:

    struct Foo {
        x: int,
    }

    let f: Foo = ...;
    ... f.x ...

Closes #18680.

[breaking-change]

r? @aturon
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

Successfully merging a pull request may close this issue.

3 participants