int? ? was not correctly handled. #2786

This commit is contained in:
Christoffer Lerno
2026-01-21 00:52:18 +01:00
parent 5fa820a462
commit 61c939059d
3 changed files with 4 additions and 6 deletions

View File

@@ -29,6 +29,7 @@
- Inferring the size of a slice with an inner inferred array using {} isn't detected as error #2783
- Bug in sysv abi when passing union in with floats #2784
- When a global const has invalid attributes, handling is incorrect, leading to a crash #2785.
- `int? ?` was not correctly handled. #2786
### Fixes
- Regression with npot vector in struct triggering an assert #2219.

View File

@@ -1015,12 +1015,6 @@ static inline Ast *parse_decl_or_expr_stmt(ParseContext *c)
return parse_ct_type_assign_stmt(c);
}
ASSIGN_EXPR_OR_RET(Expr *expr, parse_expr(c), poisoned_ast);
// We might be parsing "int!"
// If so we need to unwrap this.
if (expr->expr_kind == EXPR_OPTIONAL && expr->inner_expr->expr_kind == EXPR_TYPEINFO)
{
UNREACHABLE
}
if (expr->expr_kind == EXPR_TYPEINFO)
{
ASSIGN_AST_OR_RET(Ast *ast, parse_decl_stmt_after_type(c, expr->type_expr), poisoned_ast);

View File

@@ -0,0 +1,3 @@
fn void main()
{
char? ~ // #error: Expected a fault before '~'