Skip to content

Error with parser type in the documentation #1091

@TheDeadOne

Description

@TheDeadOne

steps

  1. Open https://www.scala-sbt.org/1.x/docs/Parsing-Input.html#Combining+parsers
  2. Copy-paste next snippet to sbt console or build.sbt
val color: Parser[String] = literal("blue") | literal("green")

val select: Parser[String] = literal("fg") | literal("bg")

val setColor: Parser[(String, Char, String)] = select ~ ' ' ~ color

problem

error: type mismatch;
found   : sbt.internal.util.complete.Parser[((String, Char), String)]
required: sbt.internal.util.complete.Parser[(String, Char, String)]
val setColor: Parser[(String, Char, String)] = select ~ ' ' ~ color

expectation

Parser of type that described in the documentation.

notes

sbt 1.2.8, 1.6.2
scala 2.12.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions