fastparse icon indicating copy to clipboard operation
fastparse copied to clipboard

Mention fix for scala 2.13.7

Open francisdb opened this issue 4 years ago • 3 comments

Looks like all our fastparse definitions won't compile any more with scala 2.13.7

 identifier expected but '_' found.
[error]   private def wholeNumber[_: P]: P[Int] = P(CharIn("0-9").rep(1).!.map(_.toInt))

Our compiler flags:

      "-Xsource:3",
      "--target:11",
      "-feature",
      "-unchecked",
      "-deprecation",
      "-encoding",
      "UTF-8", // yes, this is 2 args
      "-language:existentials",
      "-language:higherKinds",
      "-language:implicitConversions",
      "-unchecked",
      "-Xlint:-unused,_"

something is mentioned here: https://github.com/scala/scala/pull/9712

But maybe the docs here could be updated showing how to fix these?

francisdb avatar Nov 02 '21 08:11 francisdb

@SethTisue IIRC we only made compilations fail when using eta expansion? Or did we make the use of underscore here a compile failure as well?

lihaoyi avatar Nov 02 '21 09:11 lihaoyi

Under -Xsource:3 it's a failure, as per scala/scala#9712

SethTisue avatar Nov 02 '21 14:11 SethTisue

Replace the _ with any old identifier. The documentation should change, though.

bwbecker avatar Apr 26 '22 19:04 bwbecker