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

An invalid type annotation for a function with a record argument passes a type check

    Details

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

      Description

      Following code (unexpectedly) passes a type check.

      (ns tst
        (:require
         [clojure.core.typed :refer [Int Kw ann] :as typed]))
      
      (typed/defprotocol [[a :variance :covariant]] P
                         (f [p :- (P a)] :- a))
      
      (typed/ann-record [[a :variance :covariant]] R [_f :- a])
      (defrecord R [_f]
        P
        (f [self] _f))
      
      (ann fr [(R Int) -> Kw])
      (defn fr [x] (f x))
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated: