So I know Abilities are going away, but in the meantime I have a question about them.
I was trying to refer to an Ability that was defined in a different module, but I cannot figure out how to do that. Right now, I get a compiler crash when I try to "expose" an Ability. It simply cannot be included in the module
list of exposed items.
Is this intended behavior? Or is this simply a compiler bug (seems likely given the compiler crash)? If it's not a bug, then how can I access an Ability defined in a separate module?
Did you expose all the fields of the ability as well?
I don't think we have a good error message for this, but for example with Decoding:
Decoding implements
decoder : Decoder val fmt where val implements Decoding, fmt implements DecoderFormatting
Both Decoding
and decoder
need to be exposed
No, I didn't realize that was possible/necessary. That makes a lot of sense, though. Thanks for the tip!
I suppose it would be nice to have the compiler handle that error gracefully with an error message, but since Abilities are being removed, that's probably too much to ask.
Yeah, the compiler should handle it with grace, but no plans to fix at this point.
Last updated: Jul 05 2025 at 12:14 UTC