···748748- Fixed a bug where running `gleam update` would not properly update git
749749 dependencies unless `gleam clean` was run first.
750750 ([Surya Rose](https://github.com/GearsDatapacks))
751751+752752+- Fixed a bug where the compiler would produce wrong JavaScript code for binary
753753+ pattern matching expressions using literal strings and byte segments.
754754+ ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
···14431443 from_byte += 1;
14441444 }
14451445 } else {
14461446+ let mut start = start.clone();
14471447+14461448 // If the string doesn't start at a byte aligned offset then we'll
14471449 // have to take slices out of it to check that each byte matches.
14481450 for byte in bytes {
14491449- let end = self.offset_to_doc(&start.add_constant(8), false);
14501450- let from = self.offset_to_doc(start, false);
14511451- let byte_access =
14521452- self.bit_array_slice_to_int(&bit_array, from, end, endianness, *signed);
14511451+ let start_doc = self.offset_to_doc(&start, false);
14521452+ let end = start.add_constant(8);
14531453+ let end_doc = self.offset_to_doc(&end, false);
14541454+ let byte_access = self
14551455+ .bit_array_slice_to_int(&bit_array, start_doc, end_doc, endianness, *signed);
14531456 checks.push(docvec![byte_access, equality, byte]);
14571457+ start = end;
14541458 }
14551459 }
14561460