You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SIP-64 changes context bound and given clause syntaxes. It has been committed to Scala 3 codebase by the commit 14acdc0.
traitDisplay[A]:defdisplay(value: A):StringfinalcaseclassCat(name: String, age: Int, color: String)
givencatDisplay:Display[Cat]:defdisplay(cat: Cat):String=s"${cat.name} is a ${cat.age} year-old ${cat.color} cat."
Note the given definition ends with :, not with, as the latter has been deprecated and emits a warning:
Given member definitions starting with with are no longer supported; use {...} or : followed by newline instead
Using scalafmt 3.8.3 (even the latest v3.8.4-RC3), this fails.
[6] error: /path/to/Cat.scala: org.scalafmt.dynamic.exceptions.PositionExceptionImpl: /path/to/Cat.scala:6: error: [dialect scala3] `;` expected but `:` found
[6] given catDisplay: Display[Cat]:
[6] ^
[6] Caused by: /path/to/Cat.scala:6: error: [dialect scala3] `;` expected but `:` found
[6] given catDisplay: Display[Cat]:
[6] ^
[6] at org.scalafmt.Scalafmt$.$anonfun$doFormatOne$2(Scalafmt.scala:111)
[6] at scala.meta.parsers.Parsed.fold(Errors.scala:12)
[6] at scala.meta.parsers.Parsed.fold$(Errors.scala:10)
[6] at scala.meta.parsers.Parsed$Error.fold(Errors.scala:28)
[6] at org.scalafmt.Scalafmt$.doFormatOne(Scalafmt.scala:114)
[6] at org.scalafmt.Scalafmt$.doFormat(Scalafmt.scala:90)
[6] at org.scalafmt.Scalafmt$.$anonfun$formatCode$3(Scalafmt.scala:78)
The text was updated successfully, but these errors were encountered:
asarkar
changed the title
Fails on SIP-64 changes
Parsing fails on SIP-64 changes
Dec 21, 2024
SIP-64 changes context bound and given clause syntaxes. It has been committed to Scala 3 codebase by the commit 14acdc0.
Note the
given
definition ends with:
, notwith
, as the latter has been deprecated and emits a warning:Using scalafmt 3.8.3 (even the latest v3.8.4-RC3), this fails.
The text was updated successfully, but these errors were encountered: