The array literal given a slice type by the matches a read-only slice too

This commit is contained in:
Joseph Ferano 2026-09-25 13:41:49 +07:00
parent b2eb81f7bf
commit e6ea657263

View File

@ -6564,7 +6564,7 @@ and check_the ctx ~want loc (t : Ast.texpr) (v : Ast.expr) =
end;
let r =
match ty, v.Ast.e with
| Types.Slice elem, Ast.Arr items ->
| Types.Slice (_, elem), Ast.Arr items ->
check_arr ctx
~want:(Some (Types.Array (Int64.of_int (List.length items), elem)))
v.Ast.loc items