-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Indented function params rules #12554
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
Labels
Milestone
Comments
Yes, that's a separate tweak for newline insertion. A newline is inserted between |
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
Just a follow up. It seems it's exactly the same situation with To quote example from @dos65 : def fun(a: Int, b: Int, c: Int)(d: Int): String = ???
def method: String =
fun(1, 2, 3)
{4} // <- this Term.Apply(Term.Apply("fun", ...), "d")
def method2: String =
fun(1, 2, 3)
{4} // <- doesn't compile - `{4}` is not part of apply
// but scalameta parses it the same way as above - Term.Apply(Term.Apply("fun", ...), "d") |
tgodzik
added a commit
to tgodzik/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
kitbellew
pushed a commit
to scalameta/scalameta
that referenced
this issue
May 24, 2021
Related to scala/scala3#12554 and scalameta/scalafmt#2522 It is now possible to have the next apply in curried functions to start in the next line if there is an indentation: ```scala def f(s: String)(t: String) = s"$t: $s" def g = f("Foo") ("Bar") ```
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Apr 7, 2022
Clarify and test rules for when to suppress a newline insertion based on indentation. Fixes scala#12554
michelou
pushed a commit
to michelou/scala3
that referenced
this issue
Apr 25, 2022
Clarify and test rules for when to suppress a newline insertion based on indentation. Fixes scala#12554
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.0.0
Minimized code
This one compiles:
but:
does not.
This looks like a feature/bug connected to optional braces and I am not sure if the exact rule is mentioned anywhere. It's not mentioned here https://dotty.epfl.ch/docs/reference/other-new-features/indentation.html as far as I can tell.
The text was updated successfully, but these errors were encountered: