diff options
| author | mattn <[email protected]> | 2014-10-29 19:27:20 +0900 |
|---|---|---|
| committer | mattn <[email protected]> | 2014-10-29 19:27:20 +0900 |
| commit | eaa0296fc57ba5288b4d72338d008d225bb1d5ae (patch) | |
| tree | 2b8750d56dc8cd194d272435556ace3524229070 /src/array.c | |
| parent | cbbf84044000878a219fad47ea16dae0cc1699a3 (diff) | |
| download | mruby-eaa0296fc57ba5288b4d72338d008d225bb1d5ae.tar.gz mruby-eaa0296fc57ba5288b4d72338d008d225bb1d5ae.zip | |
Handle Array#[float, int] Close #2626
Diffstat (limited to 'src/array.c')
| -rw-r--r-- | src/array.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/array.c b/src/array.c index 21c7e5d86..6f04efe84 100644 --- a/src/array.c +++ b/src/array.c @@ -658,6 +658,9 @@ aget_index(mrb_state *mrb, mrb_value index) if (mrb_fixnum_p(index)) { return mrb_fixnum(index); } + else if (mrb_float_p(index)) { + return mrb_float(index); + } else { mrb_int i; |
