Actions
Feature #17950
openUnable to pattern-match against a String key
Status:
Open
Assignee:
-
Target version:
-
Description
I'm unable to parse against an internal hash, when the internal hash contains strings as keys:
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:
h = {"content-type" => "application/json"}
case {status: 200, headers: {"content-type" => "application/json"}, body: "bla"}
in { status: , headers: ^h, body: }
Actions
Like0
Like0Like0