| ... | ... | @@ -3391,12 +3391,15 @@ static TypeTableEntry *analyze_null_literal_expr(CodeGen *g, ImportTableEntry *i |
| 3391 | 3391 | assert(node->type == NodeTypeNullLiteral); |
| 3392 | 3392 | |
| 3393 | 3393 | if (!expected_type) { |
| 3394 | | add_node_error(g, node, |
| 3395 | | buf_sprintf("unable to determine null type")); |
| 3394 | add_node_error(g, node, buf_sprintf("unable to determine null type")); |
| 3396 | 3395 | return g->builtin_types.entry_invalid; |
| 3397 | 3396 | } |
| 3398 | 3397 | |
| 3399 | | assert(expected_type->id == TypeTableEntryIdMaybe); |
| 3398 | if (expected_type->id != TypeTableEntryIdMaybe) { |
| 3399 | add_node_error(g, node, |
| 3400 | buf_sprintf("expected maybe type, got '%s'", buf_ptr(&expected_type->name))); |
| 3401 | return g->builtin_types.entry_invalid; |
| 3402 | } |
| 3400 | 3403 | |
| 3401 | 3404 | node->data.null_literal.resolved_struct_val_expr.type_entry = expected_type; |
| 3402 | 3405 | node->data.null_literal.resolved_struct_val_expr.source_node = node; |