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
I'm getting errors when trying to display the API of an Array, because of Array#swap. It's listed as part of getMembers and can be invoked. But it does not seem to be a readable member. I'm not too familiar with the API of Array, but I couldn't find #swap in the class documentation, so it may be TruffleRuby-specific.
Repro session
$ polyglot --shell --jvm
GraalVM MultiLanguage Shell 19.3.0
Copyright (c) 2013-2019, Oracle and/or its affiliates
Python version 3.7.4
Ruby version 2.6.2
python> import polyglot
python> x = polyglot.eval(language='ruby', string='[1, 2]')
python> [key for key in dir(x) if not hasattr(x, key)]
['swap'] # EMPTY LIST EXPECTED
python> x.swap(0,1)
1
python> x
[2, 1] # WORKED AS EXPECTED
The text was updated successfully, but these errors were encountered:
Thank you for the bug report, I can reproduce. Array#swap is indeed an internal method, marked as protected. protected is between public and private and that's probably why it appears in one case but not the other.
I'm getting errors when trying to display the API of an
Array
, because of Array#swap. It's listed as part ofgetMembers
and can be invoked. But it does not seem to be a readable member. I'm not too familiar with the API ofArray
, but I couldn't find#swap
in the class documentation, so it may be TruffleRuby-specific.Repro session
The text was updated successfully, but these errors were encountered: