Is type inference working as expected here, or is this a bug?

# type record_type = { array_field : int array };;
type record_type = { array_field : int array; }
# let test_function_1 x = Array.set x.array_field 1 3;;
val test_function_1 : record_type -> unit = <fun>
# let test_function_2 x = x.array_field.[1] <- 3;;
Characters 24-46:
  let test_function_2 x = x.array_field.[1] <- 3;;
                          ^^^^^^^^^^^^^^^^^^^^^^
Warning 3: deprecated: String.set
Use Bytes.set instead.
Characters 24-37:
  let test_function_2 x = x.array_field.[1] <- 3;;
                          ^^^^^^^^^^^^^
Error: This expression has type int array
       but an expression was expected of type bytes = string