Skip to content

New by-name implicits doesn't work anonymously #11997

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
japgolly opened this issue Apr 6, 2021 · 0 comments · Fixed by #12001
Closed

New by-name implicits doesn't work anonymously #11997

japgolly opened this issue Apr 6, 2021 · 0 comments · Fixed by #12001
Milestone

Comments

@japgolly
Copy link
Contributor

japgolly commented Apr 6, 2021

Compiler version

3.0.1-RC1-bin-20210402-775d881-NIGHTLY

Minimized code

def a(using i: => Int ) = () // ok
def b(using    => Int ) = () // error
def c(using   (=> Int)) = () // error

Output

[error] -- [E040] Syntax Error: ~/scala3bug/sbt/src/main/scala/BUG.scala:2:15 
[error] 2 |def b(using    => Int ) = () // error
[error]   |               ^^
[error]   |               an identifier expected, but '=>' found
[error] -- [E022] Syntax Error: ~/scala3bug/sbt/src/main/scala/BUG.scala:3:15 
[error] 3 |def c(using   (=> Int)) = () // error
[error]   |               ^^^^^^
[error]   |               By-name parameter type => Int not allowed here.
[error] two errors found

Expectation

It should compile.

odersky added a commit to dotty-staging/dotty that referenced this issue Apr 6, 2021
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 6, 2021
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 6, 2021
@Kordyjan Kordyjan added this to the 3.0.1 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants