Open
Description
Bug Report
Crystal::Macros::Arg#restriction
always returns Nop even if there is an ASTNode. I have tested this on Crystal version 1.12.2 on MacOS Sonoma. It was also tested by @Blacksmoke16 with Crystal master branch and the issue still exists.
The issue also exists for Crystal::Macros::FunDef#return_type
.
lib MyLib
type Int = LibC::Int
fun foo(foo : LibC::Int) : Void
end
{% MyLib.methods.first.args.each { |t| pp t; pp t.restriction.class_name } %}
{% pp MyLib.methods.first.return_type.class_name %}
# => "foo"
# => "Nop"
# => "Nop"