[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:
Alex Miller
November 21, 2018, 1:24 PM

Fixed the formatting for you

Alex Miller
November 21, 2018, 1:27 PM

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, 1:30 PM

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, 1:31 PM

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

Alan Thompson
November 21, 2018, 6:11 PM

You are correct. Using

~'fixture-fn

solved the issue.

Declined

Assignee

Unassigned

Reporter

Alan Thompson

Labels

Approval

None

Patch

None

Affects versions

Priority

Minor