-
Notifications
You must be signed in to change notification settings - Fork 277
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
Orphan parens error #3496
Comments
@jxnu-liguobin two requests:
|
also, you seem to have ignored the instructions. version 3.5.9 is not latest. please use the latest version and verify. |
Updated |
./scalafmt will still get the same error
|
In case it helps, I was getting the same error in both the metals logs and using the cli with
Same sort of thing as @jxnu-liguobin reported. This code (Scala 3) compiles fine and works, but showed the error during formatting: val applyAlpha: Layer => SignalFunction[Double, Layer] = l =>
SignalFunction(d =>
val material = l.blending.map(b => b.blendMaterial) match
case Some(m) => m
case None => BlendMaterial.BlendEffects.None
material match
case m: BlendMaterial.BlendEffects =>
l.withBlendMaterial(m.withAlpha(d))
case _ => l
) // <-- Note the bracket type This version works fine, all I've done is change the parenthesis to curly braces after val applyAlpha: Layer => SignalFunction[Double, Layer] = l =>
SignalFunction { d =>
val material = l.blending.map(b => b.blendMaterial) match
case Some(m) => m
case None => BlendMaterial.BlendEffects.None
material match
case m: BlendMaterial.BlendEffects =>
l.withBlendMaterial(m.withAlpha(d))
case _ => l
} // <-- Note the bracket type |
But It's different from my code. implicit def map: Array[Any] => List[String] = a =>
a.map ( ae => {
ae match
case s: String => s
case _ => ae.toString
}
).toList There are two kinds of brackets. Removing any one will work normally. |
Configuration (required)
Steps
Given code like this:
Problem
get error after executing
sbt scalafmt
:This is OK
The text was updated successfully, but these errors were encountered: