Skip to content

"Invalid |.u syntax" when mixing pipe styles #6724

Closed
@TheSpyder

Description

@TheSpyder

Thank you for filing! Check list:

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.
  • A minimal, reproducible example.
  • OS and browser versions, if relevant. not browser specific
  • Is it already fixed in master? Instructions no

I'm converting a library to ReScript, and I accidentally saved my file with this weird mix of pipes:

let array = (encoder) => (a) => a|>Array.map(encoder)->Js.Json.array

This compile failed with invalid |.u syntax.

I'm not sure if I should expect the code to compile, but I do expect the compiler to give me a more reasonable error message. Playground example:
https://rescript-lang.org/try?version=v11.0.1&code=C4TwDgpgBMA8DkBDAfFAvFJ7UCkDOAdPgPYB2BwAUJQDYTBSIBOTiIAXFABRxKpqo4zViAQpkASnTcIpAMbEAJhCZSB3RGtSIAPsgCCLNgQC2iMF1kLlqgLTJ8RPGQLC2QA

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