@Specialization(guards = "isRubyBignum(b)") public DynamicObject coerce(DynamicObject a, DynamicObject b) { CompilerDirectives.transferToInterpreter(); Object[] store = new Object[] {b, a}; return Layouts.ARRAY.createArray( getContext().getCoreLibrary().getArrayFactory(), store, store.length); }
@Specialization public DynamicObject coerce(DynamicObject a, long b) { CompilerDirectives.transferToInterpreter(); // TODO (eregon, 16 Feb. 2015): This is NOT spec, but let's try to see if we can make it work. // b is converted to a Bignum here in other implementations. Object[] store = new Object[] {b, a}; return Layouts.ARRAY.createArray( getContext().getCoreLibrary().getArrayFactory(), store, store.length); }