Strange compiler error with json serializable type family

Okay, so it seems to make sense that Issue should be abstract? This should be enough to resolve your issue. Otherwise if the JSON itself has a unique key when deserializing it you could look into JSON::Serializable - Crystal 1.13.1 as well.

And this hash is stored as a class var or something? How is it used? If it’s only used as part of the .load method to know all the issue types that need to be loaded, you could probably replace that with an annotation and {% for issue in Issue.subclasses %} macro to iterate over all the issues types, then access the table name off the annotation or give a compile time error if it’s missing.

1 Like