require "rdl"
extend RDL::Annotate
type "(Array<Integer>) -> Float"
def foo(x)
end
type "() -> %any", typecheck: :now
def bar
foo([1, 2, 3])
end
Produces:
Traceback (most recent call last):
21: from t.rb:9:in `<main>'
*snip*
1: from /home/mame/work/rdl/lib/rdl/types/type.rb:172:in `leq'
/home/mame/work/rdl/lib/rdl/types/type.rb:101:in `leq': undefined local variable or method `base' for RDL::Type::Type:Class (NameError)
Produces: