Open tmimura39 opened 1 year ago
It would make more sense to ignore mixins from non-module context. You may have to add mixins in RBS for the case of hooks like included
, but it's easier to add extra RBS files than deleting unnecessary mixins from existing module definition.
The following outputs results that
rbs prototype rb
does not expect.This is true not only for
include
but also forextend
andprepend
. This is a problem because ifrbs prototype
accidentally defines anObject
type, there is no way around it even if you manually override the type.The
rbs prototype
will not know the inner workings ofActiveSupport.on_load
and will have difficulty resolving the root cause.For example, what if the behavior of the
rbs prototype
command is to ignore includes in method blocks (and extend, prepend...) in a method block (and extend, prepend...) should be ignored. (Careful decision making is required as this would be an incompatible change.)Workaround
This problem can be avoided by specifying an
include
receiver. However, you need to manually define the type of include to ActiveRecord::Base.