| ... | ... | @@ -853,7 +853,7 @@ static TypeTableEntry * resolve_rhs_number_literal(CodeGen *g, AstNode *non_lite |
| 853 | 853 | assert(literal_node->codegen_node); |
| 854 | 854 | NumberLiteralNode *codegen_num_lit = &literal_node->codegen_node->data.num_lit_node; |
| 855 | 855 | |
| 856 | | if (num_lit_fits_in_other_type(g, literal_type, non_literal_type)) { |
| 856 | if (non_literal_type && num_lit_fits_in_other_type(g, literal_type, non_literal_type)) { |
| 857 | 857 | assert(!codegen_num_lit->resolved_type); |
| 858 | 858 | codegen_num_lit->resolved_type = non_literal_type; |
| 859 | 859 | return non_literal_type; |
| ... | ... | @@ -1711,13 +1711,8 @@ static TypeTableEntry *analyze_compiler_fn_type(CodeGen *g, ImportTableEntry *im |
| 1711 | 1711 | uint64_t size_in_bytes = type_entry->size_in_bits / 8; |
| 1712 | 1712 | |
| 1713 | 1713 | TypeTableEntry *num_lit_type = get_number_literal_type_unsigned(g, size_in_bytes); |
| 1714 | | |
| 1715 | | NumberLiteralNode *codegen_num_lit = &node->codegen_node->data.num_lit_node; |
| 1716 | | assert(!codegen_num_lit->resolved_type); |
| 1717 | | codegen_num_lit->resolved_type = resolve_type_compatibility(g, context, node, |
| 1718 | | expected_type, num_lit_type); |
| 1719 | | |
| 1720 | | return num_lit_type; |
| 1714 | TypeTableEntry *resolved_type = resolve_rhs_number_literal(g, nullptr, expected_type, node, num_lit_type); |
| 1715 | return resolved_type ? resolved_type : num_lit_type; |
| 1721 | 1716 | } else if (buf_eql_str(name, "min_value")) { |
| 1722 | 1717 | return analyze_min_max_value(g, node, type_entry, "no min value available for type '%s'"); |
| 1723 | 1718 | } else if (buf_eql_str(name, "max_value")) { |
| ... | ... | @@ -1744,6 +1739,10 @@ static TypeTableEntry *analyze_fn_call_expr(CodeGen *g, ImportTableEntry *import |
| 1744 | 1739 | name = &fn_ref_expr->data.field_access_expr.field_name; |
| 1745 | 1740 | if (struct_type->id == TypeTableEntryIdStruct) { |
| 1746 | 1741 | fn_table = &struct_type->data.structure.fn_table; |
| 1742 | } else if (struct_type->id == TypeTableEntryIdPointer && |
| 1743 | struct_type->data.pointer.child_type->id == TypeTableEntryIdStruct) |
| 1744 | { |
| 1745 | fn_table = &struct_type->data.pointer.child_type->data.structure.fn_table; |
| 1747 | 1746 | } else if (struct_type->id == TypeTableEntryIdInvalid) { |
| 1748 | 1747 | return struct_type; |
| 1749 | 1748 | } else { |