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

[Truffle] Issue with dispatching to protected method #4125

Closed
bjfish opened this issue Sep 1, 2016 · 2 comments
Closed

[Truffle] Issue with dispatching to protected method #4125

bjfish opened this issue Sep 1, 2016 · 2 comments
Assignees
Milestone

Comments

@bjfish
Copy link
Contributor

bjfish commented Sep 1, 2016

This is small example of an issue I've seen once before (in a different spec) in dispatch. I think the issue may be in the UnresolvedDispatchNode which I've tried to fix without success.

This is found while trying to untag public_send_spec.rb tags.

Example

class Foo
      protected
      def bar
        'done'
      end
end
puts Foo.new.public_send(:bar)

Expected Behavior

../pubsend.rb:10:in `public_send': protected method `bar' called for #<Foo:0x007fd13095a4a8> (NoMethodError)
    from ../pubsend.rb:10:in `<main>'

Actual Behavior

done
@bjfish bjfish added the truffle label Sep 1, 2016
@eregon eregon self-assigned this Sep 6, 2016
@eregon
Copy link
Member

eregon commented Sep 6, 2016

It's because public_send is not ignored when looking the caller frame.

@eregon eregon closed this as completed Sep 6, 2016
eregon added a commit that referenced this issue Sep 7, 2016
* It simply only allows calls to public methods.
* See #4125.
* public_send does not seems omitted from backtrace like send is.
@eregon
Copy link
Member

eregon commented Sep 7, 2016

Turns out the semantics are simpler than I thought, see 1dc8c8e.

@enebo enebo modified the milestone: truffle-dev Nov 9, 2016
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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

3 participants