Skip to content

Commit

Permalink
[Truffle] Adding coerced specialization for Float#-.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed Apr 8, 2015
1 parent 1d4f0f7 commit 9befcdf
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -110,6 +110,11 @@ public double sub(double a, RubyBignum b) {
return a - b.bigIntegerValue().doubleValue();
}

@Specialization(guards = "!isRubyBignum(arguments[1])")
public Object subCoerced(VirtualFrame frame, double a, RubyBasicObject b) {
return ruby(frame, "redo_coerced :-, b", "b", b);
}

}

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

0 comments on commit 9befcdf

Please sign in to comment.