Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

method_missing not supported, yet? #18

Open
baban opened this issue Apr 19, 2017 · 2 comments
Open

method_missing not supported, yet? #18

baban opened this issue Apr 19, 2017 · 2 comments
Assignees

Comments

@baban
Copy link

baban commented Apr 19, 2017

Hi.
I want to hear about method_missing.
Like a below source code, when I run it.
Ruby code dumped error message.

require 'rdl'
require 'types/core'

class Foo
  type '() -> String', typecheck: :later
  def foo()
    bar() # call method_missing
  end

  type '(Symbol, *%any) -> String'
  def method_missing(name, *_)
    name.to_s
  end
end

Foo.new.foo

rdl_do_typecheck :later
/Users/matsubaramasanao/.rvm/gems/ruby-2.2.3/gems/rdl-2.0.1/lib/rdl/typecheck.rb:158:in `error':  (RDL::Typecheck::StaticTypeError)
rdl2.rb:7:5: error: no type information for instance method `Foo#bar'
rdl2.rb:7:     bar(10) # call method_mising

RDL is not support method missing?
And, you will support it future?

@jeffrey-s-foster
Copy link
Contributor

Thanks for the bug report. Right now, rdl doesn't know about method_missing, but I will work on a fix.

@jeffrey-s-foster jeffrey-s-foster self-assigned this May 31, 2017
@baban
Copy link
Author

baban commented Jul 5, 2017

Thanks reply♪

method_missing is completely dynamic method.
I guess that some case must use type_cast, finally.
But many case can resolve completely statically type check.
I hope you find graceful way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants