Skip to content

Type parameter defaults are not checked correctly #26633

Closed
@Tobba

Description

@Tobba

This typechecks:

pub trait Foo {
    fn foo<E=<Self as Bar>::A>(_: E) { }
}

pub trait Bar {
    type A;
}

fn main() { }

Which doesn't really make a lot of sense and seems like it could be a backwards compatibility footgun.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemT-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions