Not sure if this has already been addressed in another thread, but there is currently a bug which causes a roc program who's main function is type annotated, and ends in a !
operator to fail to compile:
So this does not compile:
main : Task {} _
main = Stdout.line! "Hello, world!"
But both of these do:
main : Task {} _
main = Stdout.line "Hello, world!"
main = Stdout.line! "Hello, world!"
The error message produced is the following:
Error message:
I think there was already a thread somewhere about it. Not sure though. If I recall correctly, it is not only with main, but any function with a single statement which ends in a '!'.
I think I know where the issue is roughly... though got distracted and havent looked at it since I made the comment.
https://github.com/roc-lang/roc/issues/7103
Last updated: Jul 06 2025 at 12:14 UTC