Just tested this in the latest repl. I was surprised to find that you could create a record with a field name prefixed by a dollar:
my_record = {$field : 1}
But of course if you try to access that, it's a syntax error
my_record.$field
┌─────────────┐
│ PARSE ERROR ├─ A parsing error occurred: statement_unexpected_token ────────┐
└┬────────────┘ │
│ │
│ main = my_record.$field │
│ ‾‾ │
└───────────────────────────────────────────────────────────────── repl:3:18 ┘
This is an unexpected parsing error. Please check your syntax.
You can access the value if you pattern match into a variable of the same name, however
… var $a = 0
… {$a} = {$a : 1}
… $a
# Returns 1.0
but I'm not sure if this is intentional. I would have thought that you can destructure into {$a} but from a record of type { a : value}
yeah that's not intentional - $ should be disallowed in record field names! :smile:
@Jonathan would you mind opening a GitHub issue for this with type=Bug ?
No prob #9936. Don't believe I have permissions to add a label though.
I added the label
Last updated: Jul 23 2026 at 13:15 UTC