-
-
Notifications
You must be signed in to change notification settings - Fork 370
Open
Description
app [main!] {pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.6/2BfGn4M9uWJNhDVeMghGeXNVDFijMfPsmmVeo6M4QjKX.tar.zst"}
import pf.Stdout
Color := [Red, Green, Blue].{
as_str : Color -> Str
as_str = |color| match color {
Red => "Red"
Green => "Green"
Blue => "Blue"
}
}
main! = |_args| {
red : Color
red = Red
Stdout.line!("My favourite color is ${red.as_str()}")
Ok({})
}This program fails with
Roc crashed: Color does not implement as_str
When I move the Color type to seperate module (Color.roc) then it works fine.
Roc version
Roc compiler version debug-57f4ac5e
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels