lilactown / helix

A simple, easy to use library for React development in ClojureScript.
Eclipse Public License 2.0
631 stars 52 forks source link

Non-exhaustive dependency warning #28

Open lilactown opened 4 years ago

lilactown commented 4 years ago

defnc should detect if dependencies are exhaustively filled in, and if not signal a compiler warning. It could be silenced by filling in the dependencies or annotating with metadata.

;; Warning! Non-exhaustive dependencies
(use-memo
 [foo]
 (+ foo bar))

;; Ignore specific dependency in the body
(use-memo
 ^{:ignore-deps [bar]} [foo]
 (+ foo bar))

;; Don't warn ever
(use-memo
 ^:ignore-deps []
 (+ foo bar))