Ensure that defining a function on an arg counts as a reference.
Otherwise you get a warning here saying that t is unused:
(fn f [t x] (fn t.f []) x)
This commit is contained in:
parent
765b3d784f
commit
5acaac966e
@ -80,7 +80,7 @@ later by fennel-ls.language to answer requests from the client."
|
|||||||
(table.insert target.referenced-by ast)))))
|
(table.insert target.referenced-by ast)))))
|
||||||
|
|
||||||
(λ symbol-to-expression [ast scope ?reference?]
|
(λ symbol-to-expression [ast scope ?reference?]
|
||||||
(if ?reference?
|
(when (or ?reference? (fennel.multi-sym? ast))
|
||||||
(reference ast scope)))
|
(reference ast scope)))
|
||||||
|
|
||||||
(λ define [?definition binding scope]
|
(λ define [?definition binding scope]
|
||||||
|
|||||||
@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
(it "does not warn if a field is used"
|
(it "does not warn if a field is used"
|
||||||
(let [self (create-client)
|
(let [self (create-client)
|
||||||
responses (self:open-file! filename "(fn [abc] (set abc.xyz 10))")]
|
responses (self:open-file! filename "(fn [a b] (set a.x 10) (fn b.f []))")]
|
||||||
(assert (not (?. responses 1 :params :diagnostics 1)))))
|
(assert (not (?. responses 1 :params :diagnostics 1)))))
|
||||||
|
|
||||||
(it "warns when using the : special when a multisym would do"
|
(it "warns when using the : special when a multisym would do"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user