The record accesor example snippet from the readme is crashing the repl for me at the moment.
» returnFoo = \x -> x.foo
…
… returnFoo { foo: "hi!", bar: "blah" }
"hi!" : Str
»
… returnFoo = .foo
…
… returnFoo { foo: "hi!", bar: "blah" }
thread '<unnamed>' panicked at 'TODO turn fn_var into a RuntimeError UnresolvedTypeVar(118)', compiler/mono/src/ir.rs:821:35
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It looks like they're both getting the same type signature, but for some reason it's not solving for the Str type
» returnFoo = .foo
… returnFoo
<function> : { foo : a }* -> a
» returnFoo = \x -> x.foo
… returnFoo
<function> : { foo : a }* -> a
Thanks for the find! Can you file a bug for this please?
Submitted! https://github.com/rtfeldman/roc/issues/2567
Thank you!! :thank_you:
Last updated: Jul 05 2025 at 12:14 UTC