core.typed

Type Error Cannot invoke type: Keyword with non-literal keywords

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:

Description

Using non-literal keywords for map lookup results in "Type Error Cannot invoke Keyword"

Code to reproduce:

(ns foo
  (:require [clojure.core.typed :as t])
  (:import clojure.lang.Keyword))

(t/ann bar [Keyword -> Number])
(defn bar [k]
  (k {:a 1 :b 2}))

Repl:

clojure-programming.core=> (check-ns 'foo)
Initializing core.typed ...
Loading Clojurescript...
Clojurescript not found
"Elapsed time: 2419.011 msecs"
core.typed initialized.
Start collecting foo
Finished collecting foo
Collected 1 namespaces in 2507.171 msecs
Start checking foo
Checked foo in 64.561 msecs
Type Error (foo:7:3) Cannot invoke type: Keyword
in: (k (quote {:a 1, :b 2}))

ExceptionInfo Type Checker: Found 1 error  clojure.core/ex-info (core.clj:4327)

Activity

Ambrose Bonnaire-Sergeant made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Ambrose Bonnaire-Sergeant made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: