question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

value | is not a member of String in Scala 2.10

See original GitHub issue

It seems that the ParserApi implicit does not get invoked in Scala 2.10. The same source code compiles with Scala 2.11.

Sample build.sbt:

scalaVersion := "2.10.6"

libraryDependencies += "com.lihaoyi" %% "fastparse" % "0.3.4"

Hello.scala:

import fastparse.all._

object Hello {
  val t: P[String] = P("boo" | "bar")
}

sbt compile:

[info] Compiling 1 Scala source to /tmp/fp/target/scala-2.10/classes...
[error] /tmp/fp/Hello.scala:4: value | is not a member of String
[error]   val t: P[String] = P("boo" | "bar")
[error]                              ^
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 1 s, completed Dec 27, 2015 5:36:13 PM

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jrpelkonencommented, Jun 25, 2016

I had the same issue. I fixed it by including macro paradise as it does not come with Scala 2.10. Basically, for Scala 2.10.6 this works, for other versions of scala 2.10, tweaks may be needed:

libraryDependencies ++= Seq(
  ...
  "com.lihaoyi" %% "fastparse" % "0.3.7",
  compilerPlugin("org.scalamacros" % "paradise" % "2.0.1" cross CrossVersion.full),
...
0reactions
lihaoyicommented, May 14, 2017

Probably going to call this wontfix; most people should have upgraded to 2.11, and if you’re still on 2.10 upgrading is probably the higher priority

Read more comments on GitHub >

github_iconTop Results From Across the Web

value | is not a member of String in Scala 2.10 #72 - GitHub
It seems that the ParserApi implicit does not get invoked in Scala 2.10. The same source code compiles with Scala 2.11. Sample build.sbt:....
Read more >
value should is not a member of String - Scala2.10
I get this error message while compiling specs for 2.10 only. 2.11 and 2.12 work fine: value should is not a member of...
Read more >
`for` syntax failure for Either - Question - Scala Users
I'm using Scala 2.11.12. The following fails to compile, but if I attempt to desugar it myself, it works. for { x <-...
Read more >
scala.collection.immutable.StringOps
This class serves as a wrapper providing scala.Predef.Strings with all the operations found in indexed sequences. Where needed, String s are implicitly ...
Read more >
Why "value _1 is not a member of (("X" : String), ("Y"
The completed code as following: Welcome to Scala 3.1.0 (17.0.1, Java Java HotSpot(TM) 64-Bit Server VM). Type in expressions for evaluation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found