Skip to content
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

GenericArgsBinding doesn't account for GATs #1380

Open
lowr opened this issue Jul 11, 2023 · 3 comments
Open

GenericArgsBinding doesn't account for GATs #1380

lowr opened this issue Jul 11, 2023 · 3 comments
Labels
A-grammar Area: Syntax and parsing

Comments

@lowr
Copy link

lowr commented Jul 11, 2023

Currently, GenericArgsBinding is defined as follows (link):

GenericArgsBinding :
   IDENTIFIER = Type

This definition does not account for GATs. It should include optional generic arguments after the identifier.

@ehuss
Copy link
Contributor

ehuss commented Jul 11, 2023

Is there a stable way to actually use that?

@lowr
Copy link
Author

lowr commented Jul 11, 2023

The following code compiles on stable and Assoc<i32> = () part is an example of GenericArgsBinding with a generic argument if I'm not mistaken?

trait Trait {
    type Assoc<T>;
}

fn foo<T>(_: T)
where
    T: Trait<Assoc<i32> = ()>
{}

(playground)

@ehuss
Copy link
Contributor

ehuss commented Jul 11, 2023

Yep, thanks!

@ehuss ehuss added the A-grammar Area: Syntax and parsing label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: Syntax and parsing
Projects
None yet
Development

No branches or pull requests

2 participants