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

Match objects are mutable in Rakudo, and after they're changed .perl breaks #991

Closed
p6rt opened this issue May 12, 2009 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented May 12, 2009

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

Searchable as RT65610$

@p6rt
Copy link
Author

p6rt commented May 12, 2009

From @masak

<masak> rakudo​: my $m = "foo" ~~ /foo/; $m<greeting> = "OH HAI"; say $m.perl
<p6eval> rakudo 62773e​: OUTPUT«Method '!_perl' not found for invocant
of class 'Str' [...]
* masak submits rakudobug
<jnthn> !_perl ?
<masak> it's an internal method, IIRC.
<masak> in the setting.
<moritz_> masak​: assigning to a Match object is evil, and should be an error
<masak> moritz_​: well, it isn't. :)

@p6rt
Copy link
Author

p6rt commented Aug 4, 2009

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S05-match/perl.t

commit d8c325d9592aca0455d8d0ecd54e9ee51a3a08dd
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Tue Aug 4 19​:20​:26 2009 +0000

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

Inline Patch
diff --git a/t/spec/S05-match/perl.t b/t/spec/S05-match/perl.t
index 6f96d0d..0d1af92 100644
--- a/t/spec/S05-match/perl.t
+++ b/t/spec/S05-match/perl.t
@@ -1,6 +1,6 @@
 use v6;
 use Test;
-plan 11;
+plan 13;
 
 # tests for Match.perl
 
@@ -39,4 +39,14 @@ lives_ok { $/.perl }, 'lives on quantified named captures';
     is_deeply eval($/.perl), $/, 'eval of Match.perl recreates Match';
 }
 
+# RT #65610
+{
+    my $m = 'foo' ~~ /foo/;
+    eval '$m<greeting> = "OH HAI"';
+
+    #?rakudo 2 todo 'RT #65610'
+    ok  $!  ~~ Exception, 'die before modifying a Match';
+    lives_ok { $m.perl }, 'can .perl a Match after attempt to modify';
+}
+
 # vim: ft=perl6

@p6rt
Copy link
Author

p6rt commented Aug 4, 2009

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

@p6rt
Copy link
Author

p6rt commented May 29, 2010

From @moritz

The first test now passes, the second still blocks on the output not
being evalable. But I think it's enough to close this ticket.

@p6rt
Copy link
Author

p6rt commented May 29, 2010

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

@p6rt p6rt closed this as completed May 29, 2010
@p6rt
Copy link
Author

p6rt commented Jun 27, 2010

From @pmichaud

S02 shows Match objects as being mutable, so I've removed the test(s)
dealing with immutability in r31478.

Pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant