Unknown field errors in _G are suppressed
This commit is contained in:
parent
31c22fe261
commit
be44cda696
@ -65,7 +65,8 @@ find the definition `10`, but if `opts.stop-early?` is set, it would find
|
||||
(stack-add-split! stack (utils.multi-sym-split symbol)))
|
||||
|
||||
(λ search-document [self document stack opts]
|
||||
(doto opts (tset :searched-through-require true))
|
||||
(when (not= (tostring (?. document :binding)) :_G)
|
||||
(set opts.searched-through-require true))
|
||||
(if (= 0 (length stack))
|
||||
document
|
||||
(and document.fields
|
||||
|
||||
@ -87,11 +87,17 @@
|
||||
:main.fnl
|
||||
"(local {: a : c &as guy} (require :the-guy-they-tell-you-not-to-worry-about))
|
||||
(print guy.b guy.d)"}
|
||||
[{:code 302}] [{:code 302 :message "unknown module field: a"}
|
||||
{:code 302 :message "unknown module field: b"}])
|
||||
(check "table.insert2"
|
||||
[{:code 302}]
|
||||
[]))
|
||||
[{:code 302 :message "unknown field: guy.d"}]
|
||||
[{:code 302 :message "unknown field: a"}
|
||||
{:code 302 :message "unknown field: b"}])
|
||||
(check "table.insert2 table.insert"
|
||||
[{:code 302 :message "unknown field: table.insert2"}]
|
||||
[{:code 302 :message "unknown field: table.insert"}])
|
||||
;; if you explicitly write "_G", it should turn off this test. Hardcoded.
|
||||
(check "_G.insert2"
|
||||
[]
|
||||
[{:code 302}])
|
||||
nil)
|
||||
|
||||
(fn test-unnecessary-colon []
|
||||
(check "(let [x :haha] (: x :find :a))"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user