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
Inconsistent behaviour when iterating over %*VM.kv #1081
Comments
From @moritzThe %*VM hash has the following structure %*VM = ( as can easily be seen by %*VM.perl, and $*VM.keys has one item. However $ perl6 -e 'my $keys = 0; for %*VM.kv -> $k, $v { $keys++}; say $keys' Somehow the inner hash is flattened. Using a normal hash I couldn't Cheers, |
From @pmichaudOn Sun Jun 21 10:44:43 2009, moritz wrote:
Now fixed in 6c6299f: $ ./perl6 -e 'my $keys = 0; for %*VM.kv -> $k, $v { $keys++}; say $keys' I'll pass this back to moritz++ to decide if this needs a spectest to Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @kylehaThis is an automatically generated mail to inform you that tests are now available in t/spec/integration/real-strings.t commit d975206783869d325cafb191330f961bc32019ac [t/spec] test for RT #66818, %*VM behaving weirdly Inline Patchdiff --git a/t/spec/integration/real-strings.t b/t/spec/integration/real-strings.t
index a89f237..5b14597 100644
--- a/t/spec/integration/real-strings.t
+++ b/t/spec/integration/real-strings.t
@@ -1,6 +1,6 @@
use v6;
use Test;
-plan 10;
+plan 11;
# Rakudo had a regression that
# string returned from regexes were Parrot strings, not Perl 6 strings.
@@ -48,4 +48,12 @@ is "helo".lc.trans(("aeiou" => "AEIOU")), 'hElO', '.flip.trans (RT 66300)';
is substtest("mop"), "map", '.subst works in a multi';
}
+# not a "real string', but a "real hash" bug found in Rakudo:
+
+{
+ my $x = 0;
+ for %*VM.kv -> $k, $v { $x++};
+ is $x, +%*VM.keys, '%*VM.kv is self-consistent';
+}
+
# vim: ft=perl6 |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#66818 (status was 'resolved')
Searchable as RT66818$
The text was updated successfully, but these errors were encountered: