core.match

OrPattern (:or 1 2) cannot be aot-compiled

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    core.match 0.2.0-rc5

Description

I have a match expression containing an (:or :x :y) and this seems to trip up AOT compilation when running "lein uberjar".

At least I get a

Exception in thread "main"
java.lang.IllegalArgumentException: No method in multimethod 'to-source' for dispatch value: class clojure.core.match.OrPattern

Works fine otherwise, just "lein uberjar" fails.

Activity

Hide
David Nolen added a comment -

hrm, I suspect that the Object multimethod cases are the source of the issue - these were eliminated from the group-pattern logic and many AOT issues evaporated. I'll think on this some.

Show
David Nolen added a comment - hrm, I suspect that the Object multimethod cases are the source of the issue - these were eliminated from the group-pattern logic and many AOT issues evaporated. I'll think on this some.
David Nolen made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]
Hide
Anders Conbere added a comment -

Howdy,

Is it possible that this issues wasn't fixed by that commit?

I can reproduce on master by attempting to aot compile `clojure.core.match.test.core`. In fact, I can go back to when that commit was introduced and get the same error.

Steps to reproduce and patch to test with here: https://gist.github.com/aconbere/b9ce4b05b8bad1de6869

Show
Anders Conbere added a comment - Howdy, Is it possible that this issues wasn't fixed by that commit? I can reproduce on master by attempting to aot compile `clojure.core.match.test.core`. In fact, I can go back to when that commit was introduced and get the same error. Steps to reproduce and patch to test with here: https://gist.github.com/aconbere/b9ce4b05b8bad1de6869
Hide
David Nolen added a comment -

AOT'ing tests adds more variables than I care to consider. Please demonstrate a reproducible bug in a minimal case, preferable a project that I clone and test against, thanks.

Show
David Nolen added a comment - AOT'ing tests adds more variables than I care to consider. Please demonstrate a reproducible bug in a minimal case, preferable a project that I clone and test against, thanks.
Hide
Zane Shelby added a comment -

Here's a Github project that reproduces the issue for me:

https://github.com/zane/core.match-bug/

Show
Zane Shelby added a comment - Here's a Github project that reproduces the issue for me: https://github.com/zane/core.match-bug/
Hide
David Nolen added a comment -

That is not the latest version of core.match. Please demonstrate that 0.2.1 has the issue.

Show
David Nolen added a comment - That is not the latest version of core.match. Please demonstrate that 0.2.1 has the issue.
Hide
Sun Ning added a comment -

I'm using 0.2.1 and it's still broken.

@Zane, you can just update core.match to 0.2.1 in your project.clj

Show
Sun Ning added a comment - I'm using 0.2.1 and it's still broken. @Zane, you can just update core.match to 0.2.1 in your project.clj
Hide
David Nolen added a comment -

I was able to determine that this was in fact still an issue and fixed it in master https://github.com/clojure/core.match/commit/23adaf466fd026f9d4a12443032037dfc006b901

Show
David Nolen added a comment - I was able to determine that this was in fact still an issue and fixed it in master https://github.com/clojure/core.match/commit/23adaf466fd026f9d4a12443032037dfc006b901
Hide
Sun Ning added a comment -

Any chance to issue a release for this fix? Thanks!

Show
Sun Ning added a comment - Any chance to issue a release for this fix? Thanks!
Hide
David Nolen added a comment -

It's already in a release - 0.2.2

Show
David Nolen added a comment - It's already in a release - 0.2.2

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: