Hey @brandonbloom, I ran into an issue which could benefit from this change. The new code in Puget adds a CanonicalPrinter which implements IVisitor. This printer should throw an exception if it encounters any type without an explicitly-defined print handler. It does this by throwing an error if visit-unknown is called. You can probably see where this is going - record types are automatically rendered by the current code as a tagged-literal, even though no such extension has been added by the printer.
This change preserves the existing behaviour, but allows implementing printers to choose what they want to do with records in visit-record instead of creating tagged literals automatically.
Not a blocker, since I can get around this in my code by wrapping visit*, checking for record?, explicitly dispatching to visit-unknown instead, and then in visit-unknown checking again for record? to generate the standard tagged-literal representation if desired. It would be nicer not to need this workaround, though. :)
Hey @brandonbloom, I ran into an issue which could benefit from this change. The new code in Puget adds a
CanonicalPrinter
which implementsIVisitor
. This printer should throw an exception if it encounters any type without an explicitly-defined print handler. It does this by throwing an error ifvisit-unknown
is called. You can probably see where this is going - record types are automatically rendered by the current code as a tagged-literal, even though no such extension has been added by the printer.This change preserves the existing behaviour, but allows implementing printers to choose what they want to do with records in
visit-record
instead of creating tagged literals automatically.Not a blocker, since I can get around this in my code by wrapping
visit*
, checking forrecord?
, explicitly dispatching tovisit-unknown
instead, and then invisit-unknown
checking again forrecord?
to generate the standard tagged-literal representation if desired. It would be nicer not to need this workaround, though. :)