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

Broken sections of custom operators starting with pipe '|', "expecting function name" #4879

Open
ulidtko opened this issue Jul 24, 2020 · 0 comments

Comments

@ulidtko
Copy link
Contributor

ulidtko commented Jul 24, 2020

Custom operators starting with the | symbol seem to have a parsing/scoping issue.

Spotted here: LorenzoPerticone/idris-NN#1

Steps to Reproduce

module Foo

infixl 0 |??
(|??) : Num a => a -> a -> a
x |?? y = x * y

issue : Int -> Int -> Int
issue x = (|?? x)

Observed Behavior

$ idris --check Foo.idr
Foo.idr:8:16:
  |
8 | issue x = (|?? x)
  |                ^
unexpected 'x'
expecting function name

The error doesn't happen if:

  • something else is used instead of the pipe symbol;
  • the section is left i.e. (x |??), this works.

idris --version: 1.3.3-git:PRE

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