I have an union declared as such:
Elem msg : [
Text ({txt : Str}),
Button ({ children: (List (Elem msg)), onPress: msg}),
]
And a function:
view : Model -> Elem Message
view = \_ -> Text { text: "Hello From Roc!\n" }
But i get this error:
Something is off with the body of the view definition:
14│ view : Model -> Elem Message
15│ view = \_ -> Text { text: "Hello From Roc!\n" }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This Text tag application has the type:
[Button {
children : List [Button ∞, Text { txt : Str }]b as ∞,
onPress : Message,
}, Text { text : Str }]b
But the type annotation on view says it should be:
[Button {
children : List a,
onPress : Message,
}, Text { txt : Str }] as a
Am i doing something wrong ?
Ok nevermind i had a typo in the text field :P
AdrienDML [he/him] has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC