component-model icon indicating copy to clipboard operation
component-model copied to clipboard

Cannot export a core module type

Open alexcrichton opened this issue 2 years ago • 2 comments

I believe that given the binary format today there's not actually any means by which a core module type could be exported. I think this is because type exports always look up in the component type index space.

That being said I also am not sure why one would need to do this, so I mostly wanted to open this up as a possible "hole" in the binary encoding so we could explicitly decide one way or another.

alexcrichton avatar Oct 30 '23 18:10 alexcrichton

Ah right, good point. I think this could be backwards-compatibly added by adding a third case to typebound, perhaps written (core eq <core:typeidx>). Does that sound right?

And just to confirm: this limitation applies to imports as well, yes?

Because core types are pure and thus don't break shared-nothing, it seems fine to add this. That being said, I'm having a hard time imagining a use case, so I'd be happy to wait for a while and file this under "things to fill in before 1.0", unless someone would like to do otherwise.

lukewagner avatar Oct 30 '23 19:10 lukewagner

That all sounds reasonable to me yeah, and would agree it's ok to defer

alexcrichton avatar Oct 30 '23 19:10 alexcrichton