Something I ran into making a minimal example for another potential bug. The following compiles:
Foo := { attr : U8 }.{
bar : Foo
bar = { attr: 12 }
}
But if I take out the attribute the simpler version no longer compiles:
Foo := {}.{
bar : Foo
bar = {}
}
I get the following error:
-- TYPE MISMATCH ---------------------------------
This expression is used in an unexpected way:
┌─ /home/jasper/dev/jay/Foo.roc:3:8
│
3 │ bar = {}
│ ^^
It has the type:
{}
But the annotation says it should be:
Foo
Can you make a github issue for that @Jasper Woudenberg?
Sure thing!
https://github.com/roc-lang/roc/issues/9772
I'll mark it as resolved here.
Jasper Woudenberg has marked this topic as resolved.
Last updated: Jul 23 2026 at 13:15 UTC