commit b599b7c2304975ae3ec862acc0758c373dce88b5 parent 78cbd653c5adbbcd43dcaa4cb75f29742fbef9de Author: Brian Swetland <swetland@frotz.net> Date: Mon, 24 May 2021 15:41:25 -0700 compiler: allow int32 and bool assign into byte - this fixes demo/life.src Diffstat:
M | src/compiler.c | | | 6 | ++++++ |
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/compiler.c b/src/compiler.c @@ -586,6 +586,12 @@ bool compatible_type(Type dst, Type src, Item x) { return true; } } + // TODO: should we care about int to byte truncation anywhere? + if (dst->kind == tByte) { + if ((src->kind == tInt32) || (src->kind == tBool)) { + return true; + } + } return same_type(dst, src); }