Suppose I have this code:
# Html.roc
Html := { foo : U8 }.{
href : Html, Str -> Html
href = |html, _val| html
a : Html
a = { foo: 4 }
}
# main.roc
import Html
main! = |_args| {
dbg Html.a.href("./other-page.html")
Ok({})
}
This fails to compile:
-- DOES NOT EXIST --------------------------------
Html.href does not exist.
Html is in scope, but it has no associated href.
It's referenced here:
┌─ /tmp/nix-shell.aIXthY/roc/debug-no-git/SV2kioxYq85ztsnSm3L2FixYVOv0Bllr/main.roc:10:6
│
10 │ dbg Html.a.href("./other-page.html")
│ ^^^^^^^^^^^
Is this a bug? It works if I turn Html.a into a function that doesn't take any arguments so I can call Html.a().href(...).
I think it should work but I'm not 100% sure, what's your call @Richard Feldman
yeah that's a bug! Can you open a GH issue @Jasper Woudenberg?
Done!
https://github.com/roc-lang/roc/issues/9773
Jasper Woudenberg has marked this topic as resolved.
Last updated: Jul 23 2026 at 13:15 UTC