Stream: beginners

Topic: Importing abilities


view this post on Zulip Kiryl Dziamura (Feb 02 2024 at 23:04):

Is it possible to import a custom ability? When I try to do this, I get the following

An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread '<unnamed>' panicked at 'Import ability member `18.IdentId(6)` not available', crates/compiler/load_internal/src/file.rs:4871:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

view this post on Zulip Brendan Hansknecht (Feb 02 2024 at 23:05):

Did you expose each of the member functions?

view this post on Zulip Brendan Hansknecht (Feb 02 2024 at 23:06):

You have to expose the ability itself and each function in the ability to be able to import and use them in another module.

view this post on Zulip Kiryl Dziamura (Feb 02 2024 at 23:11):

Is there an example? Because it seems I exposed everything

view this post on Zulip Brendan Hansknecht (Feb 02 2024 at 23:14):

Should be the same as what is done in the standard library for hash, for example. Or I did it here with Arbitrary.

view this post on Zulip Kiryl Dziamura (Feb 02 2024 at 23:14):

ah, wait a sec. It seems I understood. ok, I'll create a ticket for better logging then

view this post on Zulip Luke Boswell (Feb 02 2024 at 23:21):

Sounds similar to https://github.com/roc-lang/roc/issues/6094

view this post on Zulip Kiryl Dziamura (Feb 02 2024 at 23:25):

Made a comment there in case anyone encountered the same problem. Thank you

view this post on Zulip Luke Boswell (Feb 02 2024 at 23:32):

Oh nice, didn't know about that workaround

view this post on Zulip Luke Boswell (Feb 02 2024 at 23:32):

Or maybe that is the desired behaviour


Last updated: Jul 05 2025 at 12:14 UTC