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

*.defined gives a strange internal error in Rakudo #1241

Closed
p6rt opened this issue Aug 21, 2009 · 5 comments
Closed

*.defined gives a strange internal error in Rakudo #1241

p6rt opened this issue Aug 21, 2009 · 5 comments
Labels
Bug LHF Low-hanging fruit, easy to resolve

Comments

@p6rt
Copy link

p6rt commented Aug 21, 2009

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

Searchable as RT68714$

@p6rt
Copy link
Author

p6rt commented Aug 21, 2009

From @masak

<jnthn> rakudo​: say (1, undef, 2, 3).grep(*.defined).perl
<p6eval> rakudo 0d4fe0​: OUTPUT«set_integer_keyed() not implemented in
class 'Sub' [...]
<jnthn> masak​: I think above in that grep example is a Rakudo bug?
<masak> jnthn​: looks like.
<masak> somebody should ticket that.
* masak submits rakudobug
<jnthn> rakudo​: *.defined
<p6eval> rakudo 0d4fe0​: OUTPUT«set_integer_keyed() not implemented in
class 'Sub' [...]
<jnthn> ...epic wtf...
<jnthn> Well, minimized. :-)

@p6rt
Copy link
Author

p6rt commented Oct 26, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-builtin_data_types/whatever.t

commit dada8eb50be9e008fac26b67e35f3e1676ff5822
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Mon Oct 26 03​:42​:12 2009 +0000

  [t/spec] Test for RT 68714
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;28895 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S02-builtin_data_types/whatever.t b/t/spec/S02-builtin_data_types/whatever.t
index 256cb3b..40fc7e6 100644
--- a/t/spec/S02-builtin_data_types/whatever.t
+++ b/t/spec/S02-builtin_data_types/whatever.t
@@ -92,6 +92,16 @@ is @a, [1,2,3,4], '*.meth created closure works';
 #?rakudo todo 'RT 65482'
 is (0,0,0,0,0,0) >>+>> ((1,2) xx *), <1 2 1 2 1 2>, 'xx * works';
 
+#?rakudo skip 'RT 68714'
+{
+    is (1, undef, 2, 3).grep(*.defined), <1 2 3>, '*.defined works in grep';
+
+    my $rt68714 = *.defined;
+    ok $rt68714 ~~ Code, '*.defined generates a closure';
+    ok $rt68714(68714), '*.defined works (true)';
+    ok $rt68714(undef), '*.defined works (false)';
+}
+
 done_testing;
 
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Oct 26, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

From @ShimmerFairy

<lue> rakudo​: *.defined
<p6eval> rakudo 53da4c​: ( no output )
<lue> rakudo​: say (1, undef, 2, 3).grep(*.defined).perl
<p6eval> rakudo 53da4c​: OUTPUT«===SORRY!===␤Unsupported use of undef as
a value; in Perl 6 please use something more specific​: [etc etc etc]

*.defined produces a simple (no output) and the grepping example
produces an unrelated error about undef not being usable.

There are tests and now, it's also fixed. I'm closing this ticket.
--
Don't Panic!

@p6rt
Copy link
Author

p6rt commented Jun 6, 2010

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

@p6rt p6rt closed this as completed Jun 6, 2010
@p6rt p6rt added Bug LHF Low-hanging fruit, easy to resolve labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug LHF Low-hanging fruit, easy to resolve
Projects
None yet
Development

No branches or pull requests

1 participant