Skip to content

Disambiguate between () as type and as value in const generic arguments #66615

Description

@varkor
#![feature(const_generics)]

trait Trait<const U: ()> {}

impl Trait<()> for () {} // error (expected const argument, found type argument)

I wonder if we can resolve the unit value correctly here (though maybe it'll require a small hack), because this is quite unfortunate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions