elvish/pkg/eval/vals
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
..
aliased_types_test.go Fix staticcheck error. 2021-09-11 02:58:54 +01:00
aliased_types.go pkg/eval/vals: Improve coverage. 2021-09-11 02:54:34 +01:00
assoc_test.go pkg/eval/vals: Remove support for the legacy a:b slice syntax. 2021-10-22 17:41:09 +01:00
assoc.go Remove unused code. 2020-08-23 16:04:44 +01:00
bool_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
bool.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
concat_test.go Make the kind of int, *big.Int and *big.Rat "number". 2021-06-15 19:22:38 +01:00
concat.go Use machine word (int) instead of int64 for fixnum. 2021-04-04 13:37:38 +01:00
conversion_test.go Fix ScanToGo's error message when ptr points to an interface. 2021-12-05 23:49:49 +00:00
conversion.go Fix ScanToGo's error message when ptr points to an interface. 2021-12-05 23:49:49 +00:00
dissoc_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
dissoc.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
doc.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
equal_test.go Fixup for #1342. 2021-06-27 16:41:07 +01:00
equal.go Other float64 cases that should be generalized 2021-06-27 16:32:38 +01:00
errors_test.go pkg/eval/vals: Improve coverage. 2021-09-11 02:54:34 +01:00
feed_test.go pkg: Move util/feed.go to eval/vals. 2020-09-03 05:22:44 +01:00
feed.go pkg: Move util/feed.go to eval/vals. 2020-09-03 05:22:44 +01:00
has_key_test.go pkg/eval/vals: Remove support for the legacy a:b slice syntax. 2021-10-22 17:41:09 +01:00
has_key.go Use the integrated persistent package. 2021-05-03 22:17:46 +01:00
hash_test.go Implement Hash for *big.Int and *big.Rat. 2021-06-27 17:01:12 +01:00
hash.go Implement Hash for *big.Int and *big.Rat. 2021-06-27 17:01:12 +01:00
index_list.go pkg/eval/vals: Remove support for the legacy a:b slice syntax. 2021-10-22 17:41:09 +01:00
index_string.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
index_test.go pkg/eval/vals: Remove support for the legacy a:b slice syntax. 2021-10-22 17:41:09 +01:00
index.go Minor fixup for path:temp-{dir file}. 2021-04-25 23:03:44 +01:00
iterate_keys_test.go pkg/eval/vals: Improve test coverage of index.go and iterate_keys.go. 2021-06-15 19:22:58 +01:00
iterate_keys.go pkg/eval/vals: Introduce "pseudo struct maps". 2020-06-29 00:22:36 +01:00
iterate_test.go pkg/eval/vals: Remove a duplicate test. 2021-09-11 13:57:53 +01:00
iterate.go pkg/eval/vals: Always return structured errors. 2020-01-06 23:02:26 +00:00
kind_test.go Make the kind of int, *big.Int and *big.Rat "number". 2021-06-15 19:22:38 +01:00
kind.go Make the kind of int, *big.Int and *big.Rat "number". 2021-06-15 19:22:38 +01:00
len_test.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
len.go Use the integrated persistent package. 2021-05-03 22:17:46 +01:00
num_test.go pkg/eval/vals: Test expected panics in num.go. 2021-06-15 19:11:57 +01:00
num.go Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
pipe_test.go Merge branch 'master' into testutil-test-coverage 2021-06-06 22:03:34 +01:00
pipe.go Fix typos and add codespell to CI 2021-08-22 23:07:34 +01:00
reflect_wrappers.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
repr_helpers.go Move all libraries to new pkg/. 2019-12-23 20:00:59 +00:00
repr_test.go Cleanup, docs and tests. 2021-04-05 20:48:22 +01:00
repr.go Use machine word (int) instead of int64 for fixnum. 2021-04-04 13:37:38 +01:00
string_test.go Cleanup, docs and tests. 2021-04-05 20:48:22 +01:00
string.go Fixup for #1342. 2021-06-27 16:41:07 +01:00
struct_map_test.go Use the integrated persistent package. 2021-05-03 22:17:46 +01:00
struct_map.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
testutils.go Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00