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

Array#pack does not support java numbers #942

Closed
byteit101 opened this issue Aug 2, 2013 · 4 comments
Closed

Array#pack does not support java numbers #942

byteit101 opened this issue Aug 2, 2013 · 4 comments

Comments

@byteit101
Copy link
Member

I would have expected the following code to work as it is given a double, but in java form instead of ruby form

> [java.lang.Double.new(0.1)].pack("D")
TypeError: wrong argument type Java::JavaLang::Double (expected Float)
@BanzaiMan
Copy link
Member

I'm not sure if Array#pack and String#unpack should be expected to handle Java data types.

@byteit101
Copy link
Member Author

I asked @enebo on irc if it should and he said to put it here. Should probably be filled under enhancement.

@enebo
Copy link
Member

enebo commented Aug 5, 2013

All our other Ruby methods handle coercion from basic numeric data types to their Ruby equivalent. So I am suggesting this gets converted like other method parameters to its appropriate Ruby type versus having pack directly understand Java types.

@kares
Copy link
Member

kares commented Aug 8, 2017

it will since 9.2 due #4718

@kares kares closed this as completed Aug 8, 2017
@kares kares added this to the JRuby 9.2.0.0 milestone Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants