You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ shellcheck b.sh
In b.sh line 6:
foo
^-^ SC2218: This function is only defined later. Move the definition up.
For more information:
https://www.shellcheck.net/wiki/SC2218 -- This function is only defined lat...
Here's what I wanted or expected to see:
No error, because it is not true, that "this function is only defined later", b.sh works as expected:
$ ./b.sh
foo
overridden
Optionally, there could be a warning that I'm overriding existing function.
The text was updated successfully, but these errors were encountered:
Encountering this SC issue while trying to isolate a double free in bash.
The way Shellcheck's error is worded isn't factually accurate. SC says, "only defined later," which in this case isn't true. In my opinion, it's something concerning this idea of, "can I trust ShellCheck to give me accurate information?" Perhaps it would be more accurate for ShellCheck to say something like, "This function is defined later. Please consider moving the definition up."
In ./test-script.sh_2 line 28:
test; echo "$?"
^--^ SC2218 (error): This function is only defined later. Move the definition up.
For bugs
shellcheck --version
or "online"): 0.6.0Here's a snippet or screenshot that shows the problem:
File
b.sh
:Here's what shellcheck currently says:
Here's what I wanted or expected to see:
No error, because it is not true, that "this function is only defined later",
b.sh
works as expected:Optionally, there could be a warning that I'm overriding existing function.
The text was updated successfully, but these errors were encountered: