Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: Backlog
    • Components: None
    • Labels:

      Description

      Applying keyword arguments doesn't work properly at the moment.

      To reproduce:

      Unable to find source-code formatter for language: clojure. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      (cf (ann fn2 [(HMap :mandatory {}) & {} -> '[] ]))
      (cf (defn fn2 [m & args]
            []))
      
      (cf (ann fn1 [(HMap :mandatory {}) & {} -> Boolean ]))
      (cf (defn fn1 [m & args]
            (empty? (apply fn2 (cons m args)))))
      
      ;;This is how it's used:
       (fn1 {} :a string? :b keyword? :c another-boolean-fn?)
      
      ;; And this is the type error:
      
      ;; Type Error (bouncer.core:2:28) Polymorphic function clojure.core/cons could not be applied to arguments:
      ;; Polymorphic Variables:
      ;;   x
      
      ;; Domains:
      ;; 	x (Option (clojure.lang.Seqable x))
      
      ;; Arguments:
      ;; 	(HMap :mandatory {}) (KwArgsSeq)
      
      ;; Ranges:
      ;; 	(clojure.lang.ASeq x)
      
      ;; in: (clojure.core/cons m args)
      
      ;; in: (clojure.core/empty? (clojure.core/apply bouncer.core/fn2 (clojure.core/cons m args)))
      
      ;;  [2 times]
      ;;  [2 times]
      ;; Type Error (bouncer.core:2:17) Bad arguments to apply: 
      
      ;; Target: 	(Fn [(HMap :mandatory {}) & {} -> []])
      
      ;; Arguments:	Error
      
      ;; in: (clojure.core/empty? (clojure.core/apply bouncer.core/fn2 (clojure.core/cons m args)))
      
      ;;  [2 times]
      ;;  [2 times]
      ;; ExceptionInfo Type Checker: Found 2 errors  clojure.core/ex-info (core.clj:4327)
      
      ;; Mark set
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alex+import import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: