oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.02k stars 185 forks source link

No exception raised them running `Complex('a+5i')` #2765

Closed ShockwaveNN closed 1 year ago

ShockwaveNN commented 2 years ago

Hi, trying to migrate some of my libraries to truffleruby and found this difference between truffleruby and MRI

The code is quite simple:

Complex('a+5i')

Running this (in irb for example) on MRI 3.1 raise an exception:

(irb):3:in `Complex': invalid value for convert(): "a+5i" (ArgumentError)

Running this in truffleruby 22.2.0returns (0+0i) without any exception

andrykonchin commented 1 year ago

Thank you for reporting the issue. Fixed in fb8887c8f85c9f3a57d66d38d2625022d4191556.

ShockwaveNN commented 1 year ago

Thanks