Understanding Generic Associated Types extension

It seems according to Generic Associated Types RFC at least line A of this code below is valid (and the nightly agrees) but the compiler seems to complain on line B:

#![feature(generic_associated_types)]

pub trait Blah {
    type Type<T>; // (line A)
    fn f<T>() -> Self::Type<T>; // (line B)
}

What I'm trying to understand is what's the point of line A if I can't actually access the result in something like line B? How do I actually get to "Type" (surely there's a way or it wouldn't be valid)?

The RFC seems to indicate this should work, so presumably this is just something that's not been implemented yet.

GATs are no where near complete, there isn't a working implementation yet. It is blocked on chalk integration into Rust. Currently, only the syntax for GATs is checked, and nothing else.

4 Likes