Tensegritics/ClojureDart

Port new 1.11 behavior for associative varargs

Offen

#109 geöffnet am 13.06.2022

 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Clojure (115 Forks)batch import
help wanted

Repository-Metriken

Stars
 (1.618 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 8T) (2 gemergte PRs in 30 T)

Beschreibung

I think this is related to issue #96.

Calling a variadic function that contains argument destructuring fails with the following exception: Unhandled Exception: Invalid argument(s): Index out of bounds

Example:

(defn one [& {:keys [a b]
              :or {a "a" b "b"}}]
  (dart:core/print (str a b)))

  (one) ;=> ab
  (one nil) ;=> ...Index out of bounds...
  (one {}) ;=> ...Index out of bounds...
  (one {:a "x"}) ;=> ...Index out of bounds...
  (one {:a "x" :b "y"}) ;=> ...Index out of bounds...


(defn two [a & {:keys [b c]
                :or {b "b" c "c"}}]
  (dart:core/print (str a b c)))
  
  (two "x") ;=> xbc
  (two "x" nil) ;=> ...Index out of bounds...
  (two "x" {}) ;=> ...Index out of bounds...
  (two "x" {:b "y"}) ;=> ...Index out of bounds...
  (two "x" {:b "y" :c "z"}) ;=> ...Index out of bounds...

Contributor Guide