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
Since the standard input and the command-line argument "files" do not correspond to actual files and they do not originate from a macro expansion, compilation errors do not show any source code for crystal eval:
$ cat test.cr
foo
$ crystal test.cr
Showing last frame. Use --error-trace for full trace.
In test.cr:1:1
1 | foo
^--
Error: undefined local variable or method 'foo' for top-level
$ cat test.cr | crystal eval
error in line 1
Error: undefined local variable or method 'foo' for top-level
$ crystal eval "$(cat test.cr)"
Showing last frame. Use --error-trace for full trace.
error in line 1
Error: undefined local variable or method 'foo' for top-level
The source code does have a fictitious filename of eval, and in fact, if a file with that name exists in the current directory, it will be picked up by the compiler:
$ echo abcde > eval
$ cat test.cr | crystal eval
Showing last frame. Use --error-trace for full trace.
In eval:1:1
1 | abcde
^--
Error: undefined local variable or method 'foo' for top-level
The text was updated successfully, but these errors were encountered:
$ cat test.cr | crystal build --stdin-filename x
Showing last frame. Use --error-trace for full trace.
error in line 1
Error: undefined local variable or method 'foo' for top-level
$ cat test.cr | crystal run --stdin-filename x
Showing last frame. Use --error-trace for full trace.
error in line 1
Error: undefined local variable or method 'foo' for top-level
Since the standard input and the command-line argument "files" do not correspond to actual files and they do not originate from a macro expansion, compilation errors do not show any source code for
crystal eval
:The source code does have a fictitious filename of
eval
, and in fact, if a file with that name exists in the current directory, it will be picked up by the compiler:The text was updated successfully, but these errors were encountered: