Skip to content
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

Eta-expansion with empty block after fewerBraces colon #16452

Closed
prolativ opened this issue Dec 1, 2022 · 1 comment · Fixed by #16466
Closed

Eta-expansion with empty block after fewerBraces colon #16452

prolativ opened this issue Dec 1, 2022 · 1 comment · Fixed by #16466
Assignees
Milestone

Comments

@prolativ
Copy link
Contributor

prolativ commented Dec 1, 2022

Compiler version

3.3.0-RC1-bin-20221130-72c4ffd-NIGHTLY

Minimized code

val x = Seq(1, 2, 3).map:

Output

This compiles and the type of x is (Int => Any) => Seq[Any]

Expectation

This should not compile and raise a syntax error telling that the argument block after a colon cannot be empty

@prolativ prolativ added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:parser and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Dec 1, 2022
@prolativ
Copy link
Contributor Author

prolativ commented Dec 2, 2022

This is especially problematic in REPL because this doesn't even let you write the body of the indented block after a colon. Nevertheless the issue is not REPL-specific

odersky added a commit to dotty-staging/dotty that referenced this issue Dec 4, 2022
Require indented definitions after a `:` at the end of a line where
an argument is expected.

Fixes scala#16452
odersky added a commit to dotty-staging/dotty that referenced this issue Dec 4, 2022
Require indented definitions after a `:` at the end of a line where
an argument is expected.

Fixes scala#16452
prolativ added a commit that referenced this issue Dec 5, 2022
Require indented definitions after a `:` at the end of a line where an
argument is expected.

Fixes #16452
little-inferno pushed a commit to little-inferno/dotty that referenced this issue Jan 25, 2023
Require indented definitions after a `:` at the end of a line where
an argument is expected.

Fixes scala#16452
@Kordyjan Kordyjan added this to the 3.3.0 milestone Aug 1, 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.

3 participants