Skip to content

Commit

Permalink
[Truffle] Adding redo_coerced fallback for Fixnum#/.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Apr 5, 2015
1 parent 71633ac commit dce0852
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -592,6 +592,17 @@ public Object divComplex(VirtualFrame frame, long a, RubyBasicObject b) {
return ruby(frame, "Complex(a) / b", "a", a, "b", b);
}


@Specialization(guards = {"!isComplex(arguments[1])", "!isRational(arguments[1])", "!isRubyBignum(arguments[1])"})
public Object divFallback(VirtualFrame frame, long a, RubyBasicObject b) {
return ruby(frame, "redo_coerced :/, o", "o", b);
}

@Specialization(guards = {"!isComplex(arguments[1])", "!isRational(arguments[1])", "!isRubyBignum(arguments[1])"})
public Object divFallback(VirtualFrame frame, int a, RubyBasicObject b) {
return ruby(frame, "redo_coerced :/, o", "o", b);
}

}

@CoreMethod(names = "%", required = 1)
Expand Down

0 comments on commit dce0852

Please sign in to comment.