Skip to content

Wrong "Incorrect arity" on top-level function calls inside deftest: claims the arity is 1 larger than it actually is #2577

@luontola

Description

@luontola

In the following code, the top-level function calls inside foo2 have false warnings about incorrect arity, but the identical calls inside foo1 are fine. Invalidating caches doesn't help.

(ns example
  (:require [clojure.test :refer :all]))

(defn foo1 []
  (is (= 3 (+ 1 2))
      "math")
  (cons nil 1)
  (count []))

(deftest foo2
  (is (= 3 (+ 1 2)) ; Incorrect arity 3 for clojure.test/is
      "math")
  (cons nil 1) ; Incorrect arity 3 for clojure.core/cons
  (count [])) ; Incorrect arity 2 for clojure.core/count

incorrect arity

IntelliJ IDEA 2021.2 (Ultimate Edition)
Build #IU-212.4746.92, built on July 27, 2021
Runtime version: 11.0.11+9-b1504.13 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 8
Registry: ide.tooltip.initialDelay=0, ide.images.show.chessboard=true
Non-Bundled Plugins: com.jetbrains.ChooseRuntime (1.2), org.intellij.plugins.hcl (0.7.10), AWSCloudFormation (212.4746.57), org.nik.presentation-assistant (1.0.9), String Manipulation (8.15.203.000.3), intellij.prettierJS (212.4746.57), Pythonid (212.4746.96), org.jetbrains.plugins.ruby (212.4746.92), org.jetbrains.plugins.go (212.4746.92), com.cursiveclojure.cursive (1.10.3-2021.2)
Kotlin: 212-1.5.10-release-IJ4746.92

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugMarks issues describing bugs

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions