crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Macro lookup on `.class` fails with 'undefined method' when generic args are passed explicitly

Open homonoidian opened this issue 5 months ago • 0 comments
trafficstars

Bug Report

# or class or struct
module M(T)
  macro foo
    {% p @type %}
  end
end

M.foo
# => M(T), expected

alias Mx = M(Int32)

Mx.foo
# => M(Int32), expected

M(Int32).foo
# => fails, undefined method 'foo' for M(Int32).class.
# Expected: M(Int32)

Crystal 1.16.3

homonoidian avatar Jun 17 '25 19:06 homonoidian