Allow booleans to be assigned to a 1-bit bit field value

This commit is contained in:
gingerBill
2019-05-09 13:04:15 +01:00
parent a66612e8ae
commit 71a733e3b5
4 changed files with 28 additions and 9 deletions
+7
View File
@@ -280,6 +280,13 @@ ExactValue exact_value_from_basic_literal(Token token) {
ExactValue exact_value_to_integer(ExactValue v) {
switch (v.kind) {
case ExactValue_Bool: {
i64 i = 0;
if (v.value_bool) {
i = 1;
}
return exact_value_i64(i);
}
case ExactValue_Integer:
return v;
case ExactValue_Float: {