feat: support checked explicit sentinel slices
This commit is contained in:
@@ -306,9 +306,13 @@ lower_compound_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instructi
|
||||
args[index] = lower_nested_expr(state, arg)
|
||||
}
|
||||
}
|
||||
checked_sentinel := ir.INVALID_INSTRUCTION
|
||||
if expr.right != hir.INVALID_EXPR {
|
||||
checked_sentinel = lower_nested_expr(state, expr.right)
|
||||
}
|
||||
return append_instruction(state, ir.Instruction{
|
||||
op=.Slice, span=expr.span, type=expr.type, args=args,
|
||||
target=ir.INVALID_REF, a=container, b=ir.INVALID_INSTRUCTION,
|
||||
target=ir.INVALID_REF, a=container, b=checked_sentinel,
|
||||
diagnostic=source.INVALID_DIAGNOSTIC,
|
||||
})
|
||||
case .Unwrap:
|
||||
|
||||
Reference in New Issue
Block a user