You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ruby rdl_test.rb
1
/Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/types/method.rb:245:in `block in check_arg_types': Object#m2: Argument type error. (RDL::Type::TypeError)
Method type:
([ m: () -> Integer ]) -> Integer
Actual argument type:
(Class)
Actual argument values (one per line):
T
from /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/switch.rb:13:in `off'
from /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/types/method.rb:237:in `check_arg_types'
from /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/wrap.rb:62:in `block in m2'
from /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/switch.rb:13:in `off'
from /Users/rmosolgo/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/wrap.rb:48:in `m2'
from _rdl_test.rb:20:in `<main>'
So, the instance (T.new) with its instance method passed (seen by the 1 in the output), but the class T with its class method did not pass.
If it should pass, I'm happy to take a look somewhere :)
The text was updated successfully, but these errors were encountered:
Hi! I tried out structural typing, but I found that a class with a class method did not pass the structural type check.
Should it pass that check? Here's an example:
Outputs:
So, the instance (
T.new
) with its instance method passed (seen by the1
in the output), but the classT
with its class method did not pass.If it should pass, I'm happy to take a look somewhere :)
The text was updated successfully, but these errors were encountered: