Skip to content

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

Closed
@japgolly

Description

@japgolly

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions