IFn implementors have a broken call implementation, all args after 20th argument should be collected into a seq

Description

Regular fns (which are just JavaScript fns) have no such limit. For IFn implementors we should not allow arities above 21 args, and we should transform the 21st arity into a var args signature.

Environment

None

Activity

Show:
Antonin Hildebrand
July 6, 2016, 12:07 AM

I believe I hit this problem in my code using core.async[1].

If it is not possible to implement ATM, I would kindly ask for a compiler warning at least. This thing manifested as a infinite recursive loop ending up in a cryptic stack overflow.

[1] https://github.com/binaryage/dirac/commit/cce56470975a287c0164e6f79cd525d6ed27a543

Fran├žois De Serres
June 18, 2016, 3:13 PM

we should transform the 21st arity into a var args signature

Unless misunderstanding, can't do that. Var args sigs aren't allowed in protocols.

we should not allow arities above 21 args

Emitting an analyzer warning is what you want?

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

Assignee

Unassigned

Reporter

David Nolen