Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use a Rat to index an array in Rakudo #1358

Closed
p6rt opened this issue Oct 13, 2009 · 5 comments
Closed

Can't use a Rat to index an array in Rakudo #1358

p6rt opened this issue Oct 13, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 13, 2009

Migrated from rt.perl.org#69738 (status was 'resolved')

Searchable as RT69738$

@p6rt
Copy link
Author

p6rt commented Oct 13, 2009

From @masak

<masak> rakudo​: my @​a = <a b c>; say @​a[4/3]
<p6eval> rakudo d749d9​: OUTPUT«get_integer() not implemented in class
'Rat' [...]
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Oct 13, 2009

From @moritz

On Mon Oct 12 18​:29​:49 2009, masak wrote​:

<masak> rakudo​: my @​a = <a b c>; say @​a[4/3]
<p6eval> rakudo d749d9​: OUTPUT«get_integer() not implemented in class
'Rat' [...]
* masak submits rakudobug

Fixed in 609cc25ae44e9b19a9e505796444fb42e645b703, now just needs a test.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Oct 13, 2009

@moritz - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 13, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S32-num/rat.t

commit 44b611429edf1c19d0bcdafa4abe28ffc16a9afc
Author​: moritz <moritz@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Oct 13 12​:08​:26 2009 +0000

  [t/spec] test for RT #​69738​: array indexing with Rats
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28778 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S32-num/rat.t b/t/spec/S32-num/rat.t
index b67ac25..e92d95f 100644
--- a/t/spec/S32-num/rat.t
+++ b/t/spec/S32-num/rat.t
@@ -156,6 +156,9 @@ is( exp(1).Rat(1e-4), Rat.new(193, 71), "Num to Rat with epsilon 1e-4");
 is( exp(1).Rat(Rat.new(1,1e4.Int)), Rat.new(193, 71),
     "Num to Rat with epsilon of Rat");
 
+is (5/4).Int,       1, 'Rat.Int';
+is <a b c>.[4/3],  'b', 'Indexing an array with a Rat (RT #69738)';
+
 done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 13, 2009

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 13, 2009
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant