Stream: beginners

Topic: Trying nightly - 'does not implement' error


view this post on Zulip Jonathan (Feb 12 2026 at 20:28):

Hi there! I was just dipping my toes back in for the first time in a while, trying out a combo of the roc mini tutorial and the roc syntax in one file. However, I seem to get a 'Secret does not implement unlock'. I've stripped it down to just the MRE:

app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.6/2BfGn4M9uWJNhDVeMghGeXNVDFijMfPsmmVeo6M4QjKX.tar.zst" }

import pf.Stdout

print! = |something| {
    Stdout.line!(Str.inspect(something))
}

Secret :: {
    key : Str
}.{
    new : Str -> Secret
    new = |k| { key: k }

    say_hi = |_| {
        "Hi!"
    }

    unlock : Secret, Str -> Str
    unlock = |_secret, _password| {
        "Whatever!"
    }
}

main! = |_args| {
    secret = Secret.new("my_secret_key")
    print!(secret.say_hi())
    # >> Roc crashed: Secret does not implement say_hi
    print!(secret.unlock("open sesame"))
    # >> Roc crashed: Secret does not implement unlock
    Ok({})
}

I'm on an m2 mac, roc_nightly-macos_apple_silicon-2026-02-12-3bcd92c, roc version debug-3bcd92c5. Not sure if I'm missing something obvious with syntax :sweat_smile: but this was straight from the syntax file.

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:31):

Ah I think I know what this is. It's a bug :ladybug:

If you move Secret into a type module Secret.roc I bet it would work properly... :sweat_smile:

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:31):

Just a hunch

view this post on Zulip Jonathan (Feb 12 2026 at 20:32):

Yep, all good now

view this post on Zulip Jonathan (Feb 12 2026 at 20:34):

Just checking, is there any syntax/functionality etc for declaring modules or does roc just recursively discover and you can import at will?

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:35):

This may help https://github.com/roc-lang/roc/blob/main/docs/langref/modules.md

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:37):

A module == .roc file

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:37):

You can group modules (files) using packages

view this post on Zulip Jonathan (Feb 12 2026 at 20:37):

So is it invalid to have types defined outside of a corresponding module?

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:38):

I'm not sure about the question sorry... you define a type using := or :: syntax

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:38):

Then you can use it anywhere in that same module, or in another module by import it

view this post on Zulip Jonathan (Feb 12 2026 at 20:40):

Ah I think I know what this is. It's a bug :ladybug:

I mean, is it the case that you can only define type X in a module/file called X.roc, and therefore the bug is that the error message should be more precise in telling me the cause of the error (there is no module with that type)?

view this post on Zulip Jonathan (Feb 12 2026 at 20:42):

Rather than I should be able to define that type in main.roc, and the bug you refer to that I can't :sweat_smile:

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:43):

Oh, I think you should be able to do what you are, but the bug is that it's broken and doesn't let you

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:43):

I suspect if you define a nominal type := or :: in the same module the static dispatch is broken

view this post on Zulip Jonathan (Feb 12 2026 at 20:44):

Ahh ok, got it, thanks

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:45):

I can have a look soon and hopefully fix it. Just poking at another bug over my morning coffee :smiley:

view this post on Zulip Jonathan (Feb 12 2026 at 20:49):

I'm just trying to understand the implications of the module file naming - given that there are 4 types of module (type, platform, application, package) how would I go about defining some functions not necessarily associated with a type, e.g., some utils?

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:49):

I'm having trouble reproducing the bug...

view this post on Zulip Jonathan (Feb 12 2026 at 20:50):

I had this same error earlier on x86 linux but I don't have access to that now

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:50):

I go about defining some functions not necessarily associated with a type, e.g., some utils?

You could make a Utilities.roc like

Utilities :: {}.{

    SomeType :: ...

    some_func = ...
    some_other_func = ...
}

view this post on Zulip Jonathan (Feb 12 2026 at 20:52):

Does that also define a unit type Utilities?

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:52):

I'm on an m2 mac, roc_nightly-macos_apple_silicon-2026-02-12-3bcd92c, roc version debug-3bcd92c5.

I'm also on an M2 mac... not sure how to reproduce

7:51:16 ~/Documents/GitHub/roc heads/main $ roc version
Roc compiler version debug-3bcd92c5
7:51:50 ~/Documents/GitHub/roc heads/main $ roc broken.roc
"Hi!"
"Whatever!"

view this post on Zulip Jonathan (Feb 12 2026 at 20:53):

This is the single file version? :thinking:

view this post on Zulip Jonathan (Feb 12 2026 at 20:57):

Ok, rather odd: if I run the whole syntax file (just copied from github with the platform set to yours) I get no error at all. But just running the MRE (removes everything not related to Secret) gives me the error

view this post on Zulip Jonathan (Feb 12 2026 at 20:58):

What's more is I was getting this error before but on the full file, and now only on the MRE. Is there some kind of cache I can clear?

view this post on Zulip Luke Boswell (Feb 12 2026 at 20:59):

You can use --no-cache flag with the cli

view this post on Zulip Jonathan (Feb 12 2026 at 21:01):

Still getting the error on MRE with --no-cache, and still _not_ getting the error on the full file :sweat_smile:

view this post on Zulip Jonathan (Feb 12 2026 at 21:01):

I don't particularly have the skills to debug this, sorry :sweat_smile:

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:02):

So you're still getting the error with this #beginners > Trying nightly - 'does not implement' error @ 💬 code snippet?

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:02):

I'm not sure what you mean by MRE and full file -- are there two different things you are running?

view this post on Zulip Jonathan (Feb 12 2026 at 21:03):

Sorry I was trying to make it clearer but it isn't. By MRE I meant my Minimum Reproducible Example (or not!) and the 'full' file is this and just changing the platform url

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:04):

Thank you for clarifying

view this post on Zulip Jonathan (Feb 12 2026 at 21:04):

The process I went through was

But now I've just tested the full file again on my mac and the error is gone :thinking:

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:05):

oh wait... so the bug is happening on linux not mac?

I'm on an m2 mac, roc_nightly-macos_apple_silicon-2026-02-12-3bcd92c, roc version debug-3bcd92c5.

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:05):

I've only tried on my mac

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:06):

That might be the issue... maybe we are doing something different on linux.

view this post on Zulip Jonathan (Feb 12 2026 at 21:08):

Jonathan said:

I had this same error earlier on x86 linux but I don't have access to that now

Sorry it's all a bit mixed up

view this post on Zulip Jonathan (Feb 12 2026 at 21:08):

Jonathan said:

The process I went through was

But now I've just tested the full file again on my mac and the error is gone :thinking:

But this was the process

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:08):

It may have been a stale cache from an older build of Roc

view this post on Zulip Jonathan (Feb 12 2026 at 21:09):

Looks like it - I just renamed the files and now I don't get any errors. (--no-cache wasn't helping however)

view this post on Zulip Jonathan (Feb 12 2026 at 21:11):

The last time I was trying roc was the rust compiler anyhow - would they overlap in the cache enough to cause this?

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:12):

Yeah its a bit puzzling tbh -- there is no relation to the old rust compiler

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:14):

I think we can lock this one in the memory bank and if it happens again we'll have another data point. Not sure how much more we can really get out of investigating this further now

view this post on Zulip Luke Boswell (Feb 12 2026 at 21:14):

I appreciate you taking the time to report it. It's the only way we will iron out all the issues

view this post on Zulip Jonathan (Feb 12 2026 at 21:15):

Yeh, not much can be done... :laughing: Thank you! Enjoy your coffee

view this post on Zulip Hubert Małkowski (Feb 13 2026 at 09:31):

https://github.com/roc-lang/roc/issues/9123

This is related issue. What's funny - I could reproduce that only if the file is main.roc xddd

view this post on Zulip Luke Boswell (Feb 13 2026 at 09:59):

Would you look at that... main.roc gives

20:58:38 ~/Documents/GitHub/roc heads/main $ roc version
Roc compiler version release-safe-3bcd92c5
20:59:01 ~/Documents/GitHub/roc heads/main $ roc main.roc

Roc crashed: Secret does not implement say_hi

view this post on Zulip Luke Boswell (Feb 13 2026 at 10:05):

Found the bug :tada:

view this post on Zulip Jonathan (Feb 13 2026 at 10:24):

What was the issue Luke?

view this post on Zulip Luke Boswell (Feb 13 2026 at 10:28):

The app and platform both have a module named main.roc

view this post on Zulip Luke Boswell (Feb 13 2026 at 10:28):

That's an overly simplified explanation... :sweat_smile:

view this post on Zulip Luke Boswell (Feb 13 2026 at 10:29):

I'm just putting a PR together, I'll link it here

view this post on Zulip Jonathan (Feb 13 2026 at 10:32):

Luke Boswell said:

That's an overly simplified explanation... :sweat_smile:

Sufficiently simple for me :laughing:

view this post on Zulip Luke Boswell (Feb 14 2026 at 00:06):

The simple "fix" for just main.roc was easy... but I'm taking my time to think about the right fix for the broader issue this uncovers.

We aren't properly handling module identifiers in a cross-package context.

Currently if you had two Color.roc modules in two different packages the module identifiers would collide and cause issues.

view this post on Zulip Luke Boswell (Feb 14 2026 at 01:26):

PR https://github.com/roc-lang/roc/pull/9178


Last updated: Feb 20 2026 at 12:27 UTC