Skip to content

Struct literal constructors don't check type parameters on typedefs #15875

Closed
@pcwalton

Description

@pcwalton

I believe this compiles but shouldn't:

struct MyStruct<T> {
    x: T,
}
type OtherStruct = MyStruct<bool>;
let s = OtherStruct {
    x: 1,
};

Nominating for 1.0, P-backcompat-lang.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions