forked from sorbet/sorbet
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
case 1
in {"a:#{1}": a} => i
puts "a: #{a} and i: #{i}"
endThe symbol literal with interpolation is not allowed when pattern matching here. Prism raises an error but still parses the tree like so:
@ AssocNode (location: (2,4)-(2,13))
├── flags: ∅
├── key:
│ @ InterpolatedSymbolNode (location: (2,4)-(2,13))
│ ├── flags: ∅
│ ├── opening_loc: (2,4)-(2,5) = "\""
│ ├── parts: (length: 2)
│ │ ├── @ StringNode (location: (2,5)-(2,7))
│ │ │ ├── flags: static_literal, frozen
│ │ │ ├── opening_loc: ∅
│ │ │ ├── content_loc: (2,5)-(2,7) = "a:"
│ │ │ ├── closing_loc: ∅
│ │ │ └── unescaped: "a:"
│ │ └── @ EmbeddedStatementsNode (location: (2,7)-(2,11))
│ │ ├── flags: ∅
│ │ ├── opening_loc: (2,7)-(2,9) = "\#{"
│ │ ├── statements:
│ │ │ @ StatementsNode (location: (2,9)-(2,10))
│ │ │ ├── flags: ∅
│ │ │ └── body: (length: 1)
│ │ │ └── @ IntegerNode (location: (2,9)-(2,10))
│ │ │ ├── flags: static_literal, decimal
│ │ │ └── value: 1
│ │ └── closing_loc: (2,10)-(2,11) = "}"
│ └── closing_loc: (2,11)-(2,13) = "\":"
├── value:
│ @ MissingNode (location: (2,4)-(2,13))
│ └── flags: ∅
└── operator_loc: ∅
Valid node types for the key are specified here.
Metadata
Metadata
Assignees
Labels
No labels