We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.7.x
using private val
version = 3.7.3 runner.dialect = scala3 style = defaultWithAlign rewrite { rules = [ SortModifiers ] sortModifiers.order = [ "override", "implicit", "private", "protected", "sealed", "abstract", "final", "lazy" ] }
When I run scalafmt via CLI like this: scalafmt Test.scala
scalafmt Test.scala
Given code like this:
//> using scala "3.2.1" //> using option "-new-syntax" //> using dep "org.typelevel::cats-effect:3.5.0" import cats.effect.Concurrent final class Test[F[_]](using private val F: Concurrent[F]) extends AnyVal: def both[A](fa1: F[A], fa2: F[A]): F[(A, A)] = F.both(fa1, fa2)
Scalafmt reports error during format:
~/Test.scala:8: error: [dialect scala3] val expected but identifier found final class Test[F[_]](private using val F: Concurrent[F]) extends AnyVal:
At the same time adding using to rewrite.sortModifiers.order results in error
using
rewrite.sortModifiers.order
Unknown input 'using'. Expected one of: lazy, inline, open, implicit, final, opaque, transparent, sealed, infix, protected, private, override, abstract
I would like the Scalafmt to respect implicit modifiers order.
implicit
Also, scala compiler prohibits using between private & val: final class Test[F[_]](private using val F: Concurrent[F]) results in
scala
private
val
final class Test[F[_]](private using val F: Concurrent[F])
[error] ./Test.scala:8:32 [error] `val` or `var` expected [error] final class Test[F[_]](private using val F: Concurrent[F]) extends AnyVal:
I've found that by replacing using with implicit with problem could be mitigated.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Configuration (required)
Command-line parameters (required)
When I run scalafmt via CLI like this:
scalafmt Test.scala
Steps
Given code like this:
Problem
Scalafmt reports error during format:
At the same time adding
using
torewrite.sortModifiers.order
results in errorUnknown input 'using'. Expected one of: lazy, inline, open, implicit, final, opaque, transparent, sealed, infix, protected, private, override, abstract
Expectation
I would like the Scalafmt to respect
implicit
modifiers order.Also,
scala
compiler prohibitsusing
betweenprivate
&val
:final class Test[F[_]](private using val F: Concurrent[F])
results inWorkaround
I've found that by replacing
using
withimplicit
with problem could be mitigated.The text was updated successfully, but these errors were encountered: