Project

General

Profile

Actions

Bug #21184

closed

SyntaxError when combining `in` with inline hash-rocket (`=>`)

Added by jtannas (Joel Tannas) 18 days ago. Updated 18 days ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
[ruby-core:121354]

Description

I believe the following should be valid syntax but it's throwing a SyntaxError:

{ a: 1 } in { a: 1 } # => true
{ a: 1 } in { a: Integer } # => true
pattern = { "a" => 1 }; { "a" => 1 } in pattern # => true
{ "a" => 1 } in { "a" => 1 } # => SYNTAX ERROR
Actions

Also available in: Atom PDF

Like0
Like0Like0