avram
avram copied to clipboard
Avram::NeedyInitializer#inherit_needs error message is less than helpful.
This error message is less than helpful. The real error is "that class should be abstract".
crystal spec
Showing last frame. Use --error-trace for full trace.
There was a problem expanding macro 'inherit_needs'
Code in macro 'inherited'
Called macro defined in lib/avram/src/avram/needy_initializer_and_delete_methods.cr:15:3
15 | macro inherit_needs
Which expanded to:
> 4 |
> 5 | {% if [email protected]? %}
> 6 | {% for type_declaration in @type.ancestors.first.constant :OPERATION_NEEDS %}
^-------
Error: BUG: DeleteHierarchical(Forum) has no types
Can you paste a code snippet of how to re-create this error?
It's something like this:
class HierarchicalDeleteOperation(T) < Avram::DeleteOperation(T)
end
class DeleteCompany < HierarchicalDeleteOperation(Company)
end
DeleteCompany.new(Company.new).delete!
If you change HierarchicalDeleteOperation(T) to be abstract, there is no message.