Skip to content

Dotty 0.20.0-RC1: Cannot write a given alias for a function #7515

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

Closed
j-mie6 opened this issue Nov 7, 2019 · 3 comments
Closed

Dotty 0.20.0-RC1: Cannot write a given alias for a function #7515

j-mie6 opened this issue Nov 7, 2019 · 3 comments

Comments

@j-mie6
Copy link

j-mie6 commented Nov 7, 2019

minimized code

given (Int => Int) = identity[Int]

Produces three errors:
end of statement expected but '(' found
';' expected, but identifier found
anonymous instance must implement a type or have at least one extension method

expectation

The code above should work, just like the below does:

type IntFunc = Int => Int
given IntFunc = identity[Int]
@nicolasstucki
Copy link
Contributor

I am not sure if the current syntax is supposed to allow it.

@j-mie6
Copy link
Author

j-mie6 commented Nov 7, 2019

It worked as of 0.19.0-RC1, which was the release that I would have expected that to have been banned in... Seems a shame to either use type aliases or I assume Function[Int, Int] would work too.

@odersky
Copy link
Contributor

odersky commented Nov 16, 2019

This will be fixed by #7557.

@odersky odersky closed this as completed Nov 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants