We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Type aliases using associated types / as to resolve to a concrete type do not work as expected:
as
trait Tr { type Ty; fn f(self) -> Self::Ty; } impl Tr for () { type Ty = f32; fn f(self) -> Self::Ty { 0.5 } } type TrTy<T> = <T as Tr>::Ty; fn main() { let _: <() as Tr>::Ty = Tr::f(()); // works let _: TrTy<()> = Tr::f(()); // error }
error: mismatched types [--explain E0308] --> <anon>:16:23 16 |> let _: TrTy<()> = Tr::f(()); // error |> ^^^^^^^^^ expected associated type, found f32 note: expected type `<() as Tr>::Ty` note: found type `f32`
playpen repro
The text was updated successfully, but these errors were encountered:
At the very least related to, but probably a dupe of #28828.
Sorry, something went wrong.
Any workaround for this issue?
Example given compiles today. Tests were added in fix for #28828 which seem to cover this, closing.
No branches or pull requests
Type aliases using associated types /
as
to resolve to a concrete type do not work as expected:playpen repro
The text was updated successfully, but these errors were encountered: