harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 39759083e51f857773fd7c028ddd17afcb2d4c52
parent bb093f73ab72913b026be9669873bf540ccbcf8f
Author: Eyal Sawady <ecs@d2evs.net>
Date:   Mon, 11 Jan 2021 14:43:26 -0500

Allow all types to be cast to themselves

Diffstat:
Msrc/type_store.c | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/type_store.c b/src/type_store.c @@ -155,6 +155,11 @@ type_is_castable(const struct type *to, const struct type *from) { to = type_dealias(to); from = type_dealias(from); + + if (to == from) { + return true; + } + switch (from->storage) { case TYPE_STORAGE_CHAR: return to->storage == TYPE_STORAGE_U8;