crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Classes using 'extend Module' appearing in Module.includers list

Open docelic opened this issue 4 years ago • 3 comments

Hello, is this a bug?

module M
end
 
class X
  extend M
end
 
{% for e in M.includers %}
  {% puts e %}     #  ==>  prints "X.class"
{% end %}

https://carc.in/#/r/a69r

(If so, the fix should probably include adding a new directive to macros which would purposely list the ones using extend.)

docelic avatar Dec 27 '20 01:12 docelic

(Just a note that the issue is still present in 1.2.0)

docelic avatar Nov 05 '21 11:11 docelic

(If so, the fix should probably include adding a new directive to macros which would purposely list the ones using extend.)

M.extenders is what we need it seems :)

Sija avatar Nov 05 '21 11:11 Sija

For reference, the issue is still present on 1.13.1.

crystal  test3.cr 
X.class

docelic avatar Jul 28 '24 07:07 docelic