gleam
gleam copied to clipboard
Type constructor `CustomType` breaks js codegen
Oops haha! That's quite a funny edge case. We'll have to fix that one.
One solution might be to import constructors under a different name if there is a clash. Or perhaps we always import under a different name to make the code simpler.
What might we rename them to?
Perhaps they should be imported with the Gleam prefix, for clarity. Although I think it would still require checking for a GleamCustomType export, and changing the alias if that creates a collision.
Perhaps we copy modules and use a $
prefix. Then it will never collide
import { CustomType as $CustomType } from "./gleam.js";
export Thingy extends $CustomType {
...
}
Yeah, that's better.