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

envWithArgs fails on certain inputs #73

Closed
hellerve opened this issue Oct 19, 2017 · 2 comments
Closed

envWithArgs fails on certain inputs #73

hellerve opened this issue Oct 19, 2017 · 2 comments

Comments

@hellerve
Copy link
Member

When trying to compile this—faulty—program:

(use Array)

(defn add-int [&x &y] (Int.+ (Int.copy x) (Int.copy y)))

(defn main []
  (do (println (Array.reduce add-int 0 [1 2 3 4 5]))))

the compiler dies with the error carp: src/Obj.hs:433:29-104: Non-exhaustive patterns in lambda. The line is envWithArgs, where a pattern match occurs in a lambda that is not exhaustive.

The line of the above program that triggers the bug is (defn add-int [&x &y] (Int.+ (Int.copy x) (Int.copy y))). Typing this in a REPL will also cause a crash.

Cheers

@eriksvedang
Copy link
Collaborator

Ah, it's the '&' in the parameter list. Thanks for pointing this out. Eventually that syntax will work also, but for now it shouldn't crash at least.

@hellerve
Copy link
Member Author

In that case I’ll close this issue for now.

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

2 participants