tupl-tufts / rdl

Types, type checking, and contracts for Ruby
BSD 3-Clause "New" or "Revised" License
602 stars 38 forks source link

Fix a typo of "No type parameters defined.." error #75

Open mame opened 6 years ago

mame commented 6 years ago
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)