Skip to content

impl Fn which returns an impl #19

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

Open
Alphapage opened this issue Feb 2, 2024 · 1 comment
Open

impl Fn which returns an impl #19

Alphapage opened this issue Feb 2, 2024 · 1 comment
Labels
question Further information is requested

Comments

@Alphapage
Copy link

Alphapage commented Feb 2, 2024

Hello,

fn fun(p: impl Fn(i32)) {} compiles. But:
fn fun(p: impl Fn(i32) -> impl Fn(i32)){} doesn't.

Is it intentional ?

Thank you in advance for your answers.

@Alphapage Alphapage added the question Further information is requested label Feb 2, 2024
@madsmtm
Copy link

madsmtm commented Feb 2, 2024

A better place to ask this is probably the users forum, but the answer is that yes, it is indeed intentional, though I'm not the right person to answer in detail why ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants