Skip to content

Revert syntax for context closures #10484

Closed
@odersky

Description

@odersky

We were going back and forth between

x ?=> e
(x: T) ?=> e

and

(using x) => e
(using x: T) => e

The using syntax looks initially more familiar, that's why we chose it over ?=>. But it had a fatal flaw (I should have seen that one earlier):

In all other contexts, (using X) means an implicit parameter of type X. But in closures, it means an implicit parameter with name X and an inferred type. I believe that having two fundamentally different interpretations of the same syntax based on context is unacceptable. So I propose to switch back to the ?=> syntax.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions