Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type-mismatch doesn't correctly interpret qualified keywords with aliased namespaces #1467

Closed
hsartoris-bard opened this issue Nov 19, 2021 · 2 comments

Comments

@hsartoris-bard
Copy link
Contributor

version v2021.10.19

platform native

problem
type-mismatch is indicating missing required keys when the keys are in fact present, but have aliased namespaces.

repro
/tmp/lint-test.clj

(ns test-ns
  (:require [some-ns :as s]))

(defn- x [y] y)

(x {::s/thing 1})
(x #::s{:thing 1})
(x {:some-ns/thing 1})

/tmp/lint-test-config.edn

{:linters
 {:type-mismatch
  {:namespaces
   {test-ns
    {x {:arities {1 {:args [{:op :keys, :req {:some-ns/thing :any}}]}}}}}}}}
$ cat /tmp/lint-test.clj | clj-kondo --lint - --config /tmp/lint-test-config.edn
.
<stdin>:6:4: error: Missing required key: :some-ns/thing
linting took 36ms, errors: 1, warnings: 0

expected behavior
Lines 6, 7, and 8 should be equivalent and result in no errors overall, but line 6 is treated differently.

I assume this is related to code modified in #1251, but I could be wrong.

@borkdude
Copy link
Member

Note to self: so only the (x {::s/thing 1}) one is failing.

@borkdude
Copy link
Member

Fixed on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants