elvish/pkg/eval
Qi Xiao ab88de7c15 Fix ScanToGo's error message when ptr points to an interface.
When the destination to scan into is an interface, its zero value is simply a
nil interface, losing the information of the original type and resulting in
error messages like "need nil, got $actual-type".

ScanToGo now handles this case specifically, and uses the string representation
of the interface type in the error message.

Before:

~> ns []
Exception: wrong type of argument 0: wrong type: need nil, got list
~> var x~ = x
Exception: wrong type: need nil, got string

After:

~> ns []
Exception: wrong type of argument 0: wrong type: need !!hashmap.Map, got list
~> var x~ = x
Exception: wrong type: need !!eval.Callable, got string

This is still not ideal, since the "need" type is not given as an Elvish "kind",
but it's much less confusing than than old "need nil" messages.

This fixes #715.
2021-12-05 23:49:49 +00:00
..
errs Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
evaltest pkg/eval: Deliver message for finished bg job using editor notification. 2021-10-05 00:08:14 +01:00
vals Fix ScanToGo's error message when ptr points to an interface. 2021-12-05 23:49:49 +00:00
vars Check assignments to read-only variable during compilation. 2021-10-13 23:57:14 +01:00
benchmarks_test.go pkg/eval: Reorganize benchmarks. 2021-12-02 00:30:01 +00:00
builtin_fn_cmd_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
builtin_fn_cmd_unix_test.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
builtin_fn_cmd_unix.go Reorganize pkg/sys into portable and non-portable system utilities. 2021-10-02 13:14:00 +01:00
builtin_fn_cmd_windows.go Change signature of "exec" and "fg" on Windows to match that on Unix. 2020-12-26 22:59:18 +00:00
builtin_fn_cmd.go pkg/eval: Export the config fields and remove access methods. 2021-10-05 00:53:38 +01:00
builtin_fn_container_test.go Fixup for #1435. 2021-12-05 20:51:17 +00:00
builtin_fn_container.go Fixup for #1435. 2021-12-05 20:51:17 +00:00
builtin_fn_debug.go Change all builtin commands that write to byte output to surface write errors. 2021-06-11 22:20:27 +01:00
builtin_fn_env_test.go Fixup for #1332 2021-06-06 22:46:27 +01:00
builtin_fn_env.go pkg/eval: Move test framework into new evaltest package. 2020-09-03 06:51:21 +01:00
builtin_fn_flow_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
builtin_fn_flow.go Fix broken relative links. 2021-11-29 20:03:09 +00:00
builtin_fn_fs_test.go Make use of (*testing.T).Cleanup for test cleanups. 2021-08-06 23:21:23 +01:00
builtin_fn_fs.go pkg/eval: Export the config fields and remove access methods. 2021-10-05 00:53:38 +01:00
builtin_fn_io_test.go pkg/eval/evaltest: Clean up godoc and some minor API details. 2021-09-12 14:13:18 +01:00
builtin_fn_io.go Document the use of slurp with printf 2021-11-14 16:19:46 +00:00
builtin_fn_misc_test.go Fixup for #1440. 2021-11-28 21:32:41 +00:00
builtin_fn_misc_unix_test.go pkg/testutil: ScaledMs -> Scaled, takes a time.Duration instead. 2021-10-05 01:02:54 +01:00
builtin_fn_misc.go Fix broken relative links. 2021-11-29 20:03:09 +00:00
builtin_fn_num_test.go Fixup for #1439. 2021-12-05 20:22:44 +00:00
builtin_fn_num.go Fix broken relative links. 2021-11-29 20:03:09 +00:00
builtin_fn_pred_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
builtin_fn_pred.go Document that "eq" requires values to have the same type to be considered equal. 2021-06-27 01:54:31 +01:00
builtin_fn_str_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
builtin_fn_str.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
builtin_fn_styled_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
builtin_fn_styled.go Fixup for #1440. 2021-11-28 21:32:41 +00:00
builtin_ns_test.go Fix use of the builtin module via explicit "builtin". 2021-10-28 22:28:13 +01:00
builtin_ns.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
builtin_special_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
builtin_special.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
callable.go pkg/eval: Break up value.go. 2020-10-10 22:28:13 +01:00
chdir_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
closure_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
closure.go Check assignments to read-only variable during compilation. 2021-10-13 23:57:14 +01:00
compile_effect_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
compile_effect_unix_test.go Support turning off implicit external command resolution. 2021-10-07 01:21:28 +01:00
compile_effect.go pkg/eval: Execute the last form in a pipeline on the current goroutine. 2021-12-02 00:34:36 +00:00
compile_lvalue.go Deprecate the local: and up: special namespaces in 0.17. 2021-10-15 22:45:02 +01:00
compile_value_test.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
compile_value.go Deprecate the legacy lambda syntax from 0.17.x. 2021-10-14 23:10:29 +01:00
compiler_test.go Remove commands deprecated in 0.16.0, and deprecate dir-history. 2021-10-03 16:47:51 +01:00
compiler.go Check assignments to read-only variable during compilation. 2021-10-13 23:57:14 +01:00
deprecation.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
eval_test.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
eval.go Replace legacy lambda with new lambda examples 2021-11-28 21:30:59 +00:00
exception_test.go Add more test for special forms. 2021-06-20 18:18:45 +01:00
exception_unix_test.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
exception.go Add more test for special forms. 2021-06-20 18:18:45 +01:00
external_cmd_test.go Make use of (*testing.T).Cleanup for test cleanups. 2021-08-06 23:21:23 +01:00
external_cmd_unix_internal_test.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
external_cmd_unix_test.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
external_cmd_unix.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
external_cmd_windows_test.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
external_cmd_windows.go Detect and suppress SIGPIPE caused by the next command in a pipeline exiting early. 2021-05-20 00:10:17 +01:00
external_cmd.go Detect and suppress SIGPIPE caused by the next command in a pipeline exiting early. 2021-05-20 00:10:17 +01:00
frame.go Throw exception when writing values to a port without a value component. 2021-06-22 00:35:30 +01:00
glob_test.go pkg/eval: Slightly improve coverage of glob.go. 2021-09-10 19:08:22 +01:00
glob.go pkg/eval: Improve coverage of glob.go. 2021-09-10 18:57:11 +01:00
go_fn_internal_test.go pkg/eval: Convert elements of slice return value from a GoFn to individual outputs. 2021-10-03 16:34:52 +01:00
go_fn_test.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
go_fn.go pkg/eval: Convert elements of slice return value from a GoFn to individual outputs. 2021-10-03 16:34:52 +01:00
interrupts.go Use buffered channels with signal.Notify. 2021-08-23 00:22:11 +01:00
node_utils.go Extract utilities for compound nodes into pkg/parse/cmpd. 2021-02-24 00:02:47 +00:00
ns_test.go Check assignments to read-only variable during compilation. 2021-10-13 23:57:14 +01:00
ns.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
options_test.go Increase options.go coverage to 100% 2020-08-26 20:40:22 +01:00
options.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
plugin_gccgo.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
plugin.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
port_helper_test.go Remove most uses of the ioutil package. 2021-08-23 00:36:26 +01:00
port_unix.go Run gofmt with Go 1.17. 2021-08-23 00:19:49 +01:00
port_windows.go pkg/eval: Fix EPIPE on Windows. 2021-06-18 00:45:25 +01:00
port.go pkg/eval: Fill in default dummy ports in Evaler.prepareFrame. 2021-08-01 21:38:30 +01:00
process_unix.go Reorganize pkg/sys into portable and non-portable system utilities. 2021-10-02 13:14:00 +01:00
process_windows.go
purely_eval_test.go Refactor the API of eval.NsBuilder to be completely based on methods. 2021-10-23 21:44:11 +01:00
purely_eval.go Fix "indicies" -> indices. 2021-08-22 23:31:26 +01:00
pwd_test.go Make use of (*testing.T).Cleanup for test cleanups. 2021-08-06 23:21:23 +01:00
pwd.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
value_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
var_parse_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
var_parse.go A couple of TODO cleanups 2021-05-30 00:40:42 +01:00
var_ref.go pkg/eval: Clean up the Ns type a bit. 2021-10-23 18:18:31 +01:00