Uploaded image for project: 'core.typed'
  1. CTYP-306

pred doesn't work for non-literal HVecs with varargs

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: None
    • Fix versions: Backlog
    • Components: Clojure Checker
    • Labels:
      None

      Description

      Problem

      Predicate generation for HVec's do not support uniform variable parameters.

      ((t/pred (t/HVec [(t/Value :foo) t/Keyword *])) [:foo :bar])
      CompilerException clojure.lang.ExceptionInfo: Internal Error (*cider-repl service*:97:17) :Protocol not supported in type->pred: * {:type-error :clojure.core.typed.errors/internal-error, :env {:line 97, :column 17, :file "*cider-repl service*", :ns spark.dev.repl}}, compiling:(*cider-repl service*:97:17)
      

      Solution

      This seems to be a symptom of * not being parsed correctly.

      First, HVec's clearly ignores the variable parameters when they are parsed.

      This is actually correctly done for quoted HVec types like '[Foo Bar *] here.

      This change should fix things; the contract generation already works for quoted HVec's since it expects a rest entry,

      Pull request:
      Commit:
      Version:

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: