From: cardoso_tiago@... Date: 2021-06-12T15:36:54+00:00 Subject: [ruby-core:104246] [Ruby master Bug#17950] Unable to pattern-match against a String key Issue #17950 has been reported by chucke (Tiago Cardoso). ---------------------------------------- Bug #17950: Unable to pattern-match against a String key https://bugs.ruby-lang.org/issues/17950 * Author: chucke (Tiago Cardoso) * Status: Open * Priority: Normal * ruby -v: 3.0.1 * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- I'm unable to parse against an internal hash, when the internal hash contains strings as keys: ```ruby case {status: 200, headers: {"content-type" => "application/json"}, body: "bla"} in { status: , headers: {"content-type" => type}, body: } # syntax error, unexpected terminator, expecting literal content or tSTRING_DBEG or tSTRING_DVAR or tLABEL_END # ...tus: , headers: {"content-type" => type}, body: } ``` however, this works: ```ruby h = {"content-type" => "application/json"} case {status: 200, headers: {"content-type" => "application/json"}, body: "bla"} in { status: , headers: ^h, body: } ``` -- https://bugs.ruby-lang.org/ Unsubscribe: