Skip to content

battling implicits for String.lines (augmentString and stringToProcess) #5994

@scabug

Description

@scabug

in both 2.9 and 2.10.0-M4:

scala> import sys.process._
import sys.process._

scala> "foo".lines
<console>:11: error: type mismatch;
 found   : String("foo")
 required: ?{def lines: ?}
Note that implicit conversions are not applicable because they are ambiguous:
 both method augmentString in object Predef of type (x: String)scala.collection.immutable.StringOps
 and method stringToProcess in trait ProcessImplicits of type (command: String)scala.sys.process.ProcessBuilder
 are possible conversion functions from String("foo") to ?{def lines: ?}
              "foo".lines
              ^

I'm working around it by writing {code}stringToProcess("foo").lines{code}, but I have a sad.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions