Add ReprKind method to Type interface.
Having a Name() interface method might also have been useful, but at
the moment, it's too annoying. Maybe I'll come back to this and add a
ton of constructors for each kind of type and make all their fields
private scope, which would solve the name collision... maybe. Later.
(This is all expected to be implementation-internal stuff in the long
run rather than anything user-facing API, so it's up for debate how
much polishing it's actually worth. Unless that changes!)
The ReprKind method is *usually* pretty predestined based on the kind
of type in the first place, but a few cases are interesting.
... *Especially* kinded unions. I'm a little alarmed at the break of
pattern, there. Hopefully that doesn't manifest too much complexity
down the road. But if it does... eh, well... nature of the beast.
Kinded unions are definitely a useful feature.
Signed-off-by: Eric Myhre <hash@exultant.us>
Showing
typed/typeMethods.go
0 → 100644
Please register or sign in to comment