[core.specs] spec for fn does not allow anonymous function name

Description

In the following macro code fragment, the function ID `fixture-fn` causes the anonymous function to fail clojure.spec:

When function name fixture-fn is absent, compilation proceeds and clojure.spec works fine. When function name is present,
the error message is:

Environment

Ubuntu 16.04
Java 10

Activity

Show:
Alan Thompson
November 21, 2018, 7:11 AM

You are correct. Using

~'fixture-fn

solved the issue.

Alex Miller
November 21, 2018, 2:31 AM

Going to decline this as I believe the issue is in the code, not the spec. If it's not this, please re-open.

Alex Miller
November 21, 2018, 2:30 AM

I'm about 99% sure this is the issue. A minimal repro would be something like:

which should just be:

Alex Miller
November 21, 2018, 2:27 AM

The problem here I think is that the syntax quote will fully resolve fixture-fn and the spec requires an unqualified symbol in a function name. You can easily fix that by preventing resolution but leaving the symbol:

Would appreciate if you could try that and see if it works.

Alex Miller
November 21, 2018, 2:24 AM

Fixed the formatting for you

Declined
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Unassigned

Reporter

Alan Thompson

Labels

Priority

Minor

Affects versions