We're updating the issue view to help you get more done. 

variadic defn can be called for missing fixed arities, overlapping arity

Description

For defns with a variadic arity: if invoked with a missing fixed arity, they use the variadic method instead of erroring; if invoked with a fixed arity that is the max fixed arity, variadic mathod instead of fixed form is invoked.

1 2 3 4 5 6 7 8 9 10 11 12 13 (defn f-hole ([a] 1) ([a b c d & args] "4 or more")) (f-hole 1 2) ; =>"4 or more", should be error (defn f-overlap-mfa ([a b] 2) ([a b & c] "2+")) (f-overlap-mfa 1) ;=> "2+", should be error (f-overlap-mfa 1 2) ;=> "2+", should be 2 (f-overlap-mfa 1 2 3) ;=> "2+", correct

A way to fix the f-hole bug is to emit a "case X:" into the switch statement for all X with no signature or less than max-fixed-arity.

The f-overlap-mfa I'm not sure why is happening and didn't investigate deeply.

Environment

None

Status

Assignee

Unassigned

Reporter

Francis Avila

Labels

Approval

None

Patch

None

Fix versions

Affects versions

1.9.671

Priority

Major