···283283- Fixed the formatting of some errors' hints to properly wrap.
284284 ([Giacomo Cavalieri](https://github.com/giacomocavalieri))
285285286286+- Fixed a bug where the JavaScript code generator could produce duplicate `let`
287287+ declarations for internal variables after a `case` expression whose subject
288288+ directly matches one of the branches.
289289+ ([Eyup Can Akman](https://github.com/eyupcanakman))
290290+286291## v1.15.1 - 2026-03-17
287292288293### Bug fixes
···11---
22source: compiler-core/src/javascript/tests/assignments.rs
33+assertion_line: 37
34expression: "\n\npub fn go(x, wibble) {\n let a = 1\n wibble(a)\n let a = 2\n wibble(a)\n let assert #(a, 3) = x\n let b = a\n wibble(b)\n let c = {\n let a = a\n #(a, b)\n }\n wibble(a)\n // make sure arguments are counted in initial state\n let x = c\n x\n}\n"
55+snapshot_kind: text
46---
57----- SOURCE CODE
68
···11+---
22+source: compiler-core/src/javascript/tests/case.rs
33+assertion_line: 950
44+expression: "\npub fn go() {\n let x =\n case #(1, 2) {\n #(1, b) -> b\n #(_, b) -> b\n }\n\n let #(a, _b) = #(x, 3)\n\n a\n}"
55+snapshot_kind: text
66+---
77+----- SOURCE CODE
88+99+pub fn go() {
1010+ let x =
1111+ case #(1, 2) {
1212+ #(1, b) -> b
1313+ #(_, b) -> b
1414+ }
1515+1616+ let #(a, _b) = #(x, 3)
1717+1818+ a
1919+}
2020+2121+----- COMPILED JAVASCRIPT
2222+export function go() {
2323+ let _block;
2424+ let $ = [1, 2];
2525+ let $1 = $[0];
2626+ if ($1 === 1) {
2727+ let b = $[1];
2828+ _block = b;
2929+ } else {
3030+ let b = $[1];
3131+ _block = b;
3232+ }
3333+ let x = _block;
3434+ let $2 = [x, 3];
3535+ let a;
3636+ a = $2[0];
3737+ return a;
3838+}
···17171818 assert result == "ABC"
1919}
2020+2121+// github.com/gleam-lang/gleam/issues/5467
2222+pub fn no_duplicate_let_after_directly_matching_case_test() {
2323+ let x =
2424+ case #(1, 2) {
2525+ #(1, b) -> b
2626+ #(_, b) -> b
2727+ }
2828+ let #(a, _b) = #(x, 3)
2929+ assert a == 2
3030+}