[ruby-core:121354] [Ruby master Bug#21184] SyntaxError when combining `in` with inline hash-rocket (`=>`)
From:
"jtannas (Joel Tannas) via ruby-core" <ruby-core@...>
Date:
2025-03-13 22:38:31 UTC
List:
ruby-core #121354
Issue #21184 has been reported by jtannas (Joel Tannas).
----------------------------------------
Bug #21184: SyntaxError when combining `in` with inline hash-rocket (`=>`)
https://bugs.ruby-lang.org/issues/21184
* Author: jtannas (Joel Tannas)
* Status: Open
* ruby -v: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
* Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
I believe the following should be valid syntax but it's throwing a `SyntaxError`:
``` ruby
{ 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
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/