Skip to content

[interop] invokeMember should throw ArityException, not ArgumentError #1864

Open
@fniephaus

Description

@fniephaus

invokeMember should throw an ArityException in case the number of arguments is incorrect. At the moment, it throws a TruffleRuby-internal ArgumentError instead.

$ polyglot --jvm --shell
rGraalVM MultiLanguage Shell 19.3.0
Copyright (c) 2013-2019, Oracle and/or its affiliates
  Ruby version 2.6.2
ruby> Truffle::Interop.invoke([], :+)
wrong number of arguments (given 0, expected 1) (ArgumentError)
        at <ruby> <top (required)>(resource:/truffleruby/core/truffle/boot.rb:16:15-45)
        at <ruby> parsing-request(Unknown)

js> Polyglot.eval('python', '[]').append()
TypeError: append() missing 1 required positional argument: a
js> Polyglot.eval('ruby', '[]').delete()
wrong number of arguments (given 0, expected 1) (ArgumentError)

Metadata

Metadata

Assignees

No one assigned

    Labels

    polyglotUses multiple Truffle languages or host interop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions