Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in Getting started don't work - ambiguous use of 'buildExpression' #349

Open
oschrenk opened this issue Aug 17, 2024 · 1 comment

Comments

@oschrenk
Copy link

Totally a possibility that I am missing something as I am a beginner Swift programmer, but the example on https://pointfreeco.github.io/swift-parsing/main/documentation/parsing/gettingstarted/

won't compile

  let parser = Parse {
    Int.parser()
    ","
    Bool.parser()
  }

will result in:

Building for debugging...
~/Project/Parser.swift:6:5: error: ambiguous use of 'buildExpression'
    Int.parser()
    ^
/Users/oliver/Projects/personal/swift/plan.swift/.build/checkouts/swift-parsing/Sources/Parsing/Builders/ParserBuilder.swift:533:22: note: found this candidate
  public static func buildExpression<P: Parser>(_ expression: P)
                     ^
/Users/oliver/Projects/personal/swift/plan.swift/.build/checkouts/swift-parsing/Sources/Parsing/Builders/ParserBuilder.swift:544:22: note: found this candidate
  public static func buildExpression<P: Parser>(_ expression: P) -> P
                     ^
error: emit-module command failed with exit code 1 (use -v to see invocation)
~/Project/Parser.swift:6:5: error: ambiguous use of 'buildExpression'
    Int.parser()
    ^
/Users/oliver/Projects/personal/swift/plan.swift/.build/checkouts/swift-parsing/Sources/Parsing/Builders/ParserBuilder.swift:533:22: note: found this candidate
  public static func buildExpression<P: Parser>(_ expression: P)
                     ^
/Users/oliver/Projects/personal/swift/plan.swift/.build/checkouts/swift-parsing/Sources/Parsing/Builders/ParserBuilder.swift:544:22: note: found this candidate
  public static func buildExpression<P: Parser>(_ expression: P) -> P
                     ^
~/Project/Parser.swift:6:5: error: ambiguous use of 'buildExpression'
    Int.parser()
    ^
/Users/oliver/Projects/personal/swift/plan.swift/.build/checkouts/swift-parsing/Sources/Parsing/Builders/ParserBuilder.swift:533:22: note: found this candidate
  public static func buildExpression<P: Parser>(_ expression: P)
                     ^
/Users/oliver/Projects/personal/swift/plan.swift/.build/checkouts/swift-parsing/Sources/Parsing/Builders/ParserBuilder.swift:544:22: note: found this candidate
  public static func buildExpression<P: Parser>(_ expression: P) -> P

I guess this is possibly connected to #309 ?

@oschrenk
Copy link
Author

Ah. It seems that #290 and changes in Swift 5.8 had big impacts and the examples were not updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant