ClojureScript

Invalid variadic IFn implementations now fail

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: 1.9.655
  • Fix Version/s: 1.9.671
  • Component/s: None
  • Labels:
    None
  • Approval:
    Accepted

Description

(deftype Partial [f args]
  IFn
  (-invoke [_ & a]
    (apply (partial f args) a)))

This code is invalid but worked prior to 1.9.655. We don't currently warn on variadic implementations and this triggers the compiler to generate a variadic method.

The user will see a cryptic error about `self__` not being defined when attempting to leverage this invalid pattern.

Activity

Hide
A. R added a comment -
Show
A. R added a comment - Issue seems to be reagent that uses variadic IFn: https://github.com/reagent-project/reagent/blob/18cb1468a671f5a96a912d2e3ccc13bbdbf3a68e/src/reagent/impl/util.cljs#L69-L72 Related: CLJ-888 Possibly a regression of: CLJS-1445
Hide
David Nolen added a comment -

There is no such thing as variadic IFn or variadic protocols at all.

Show
David Nolen added a comment - There is no such thing as variadic IFn or variadic protocols at all.
Hide
Mike Fikes added a comment -

See CLJS-2134, which will emit a new diagnostic in this scenario.

Show
Mike Fikes added a comment - See CLJS-2134, which will emit a new diagnostic in this scenario.
Hide
Dieter Komendera added a comment -

This relevant code in reagent has been fixed with https://github.com/reagent-project/reagent/commit/3cf045dc8264373d93d9c3a7607dc2a349194681#diff-9ca1adc3660082ab6f20b66f7c7a911c and was released with 0.7.0 (2017-06-27)

Show
Dieter Komendera added a comment - This relevant code in reagent has been fixed with https://github.com/reagent-project/reagent/commit/3cf045dc8264373d93d9c3a7607dc2a349194681#diff-9ca1adc3660082ab6f20b66f7c7a911c and was released with 0.7.0 (2017-06-27)

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: