File tree Expand file tree Collapse file tree 2 files changed +18
-40
lines changed
Expand file tree Collapse file tree 2 files changed +18
-40
lines changed Original file line number Diff line number Diff line change @@ -190,18 +190,31 @@ end
190190```
191191
192192### implicit-global
193- This is raised when the ` global ` keyword is enabled and a global was declared without it. See [ Explicit Globals ] ( < Explicit Globals > ) .
193+ This is raised when a global is declared without an explicit prefix, such as the optional ` global ` keyword:
194194``` pluto showLineNumbers
195195pluto_use global
196-
197196a = 1
198197```
199198```
200- file.pluto:3: warning: implicit global creation [implicit-global]
201- 3 | a = 1
202- | ^^^^^ here: prefix this with 'global' to be explicit
199+ file.pluto:2: warning: implicit global creation [implicit-global]
200+ 2 | a = 1
201+ | ^^^^^ here: prefix this with '_G.' or 'global' to be explicit
202+ ```
203+
204+ Examples of code that does not raise this warning:
205+ ``` pluto
206+ pluto_use global
207+ global a = 1
208+ a = 2
209+ ```
210+ ``` pluto
211+ -- @pluto_warnings enable-implicit-global
212+ _G.a = 1
213+ a = 2
203214```
204215
216+ This warning type is enabled via ` pluto_use global ` or [ compile-time configuration] ( #compile-time-configuration ) .
217+
205218### discarded-return
206219This is raised when the return value of a function declared ` <nodiscard> ` was discarded. See [ Nodiscard Functions] ( < Nodiscard Functions > ) .
207220``` pluto showLineNumbers
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments