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
Calling undefine twice in sequence causes "Null PMC in copy" #1299
Comments
From @carbinAlso occurs with methods etc.
-- |
From @carbinOn a side note, it looks like there are inconsistencies in the Null 23:22 < carlin> rakudo: sub foo {}; undefine undefine foo; -- |
From @carbinMore undefined silliness :-) 04:31 < carlin> rakudo: sub foo($bar) { say $bar }; my $x = 'x'; -- |
From jswitzer@gmail.comThis patch should move undefine to the setting, providing both the multi -Jason "s1n" Switzer |
From jswitzer@gmail.comundefine.patchdiff --git a/src/builtins/named-unary.pir b/src/builtins/named-unary.pir
index 6d67a70..ca82b6d 100644
--- a/src/builtins/named-unary.pir
+++ b/src/builtins/named-unary.pir
@@ -45,19 +45,6 @@ Returns a true value if $x is defined, and a false value otherwise.
.end
-=item undefine $x
-
-Sets $x to an undefined value
-
-=cut
-
-.sub 'undefine'
- .param pmc x
- $P0 = root_new ['parrot';'Perl6Scalar']
- copy x, $P0
-.end
-
-
=back
=cut
diff --git a/src/setting/Object.pm b/src/setting/Object.pm
index b406657..7e3b54a 100644
--- a/src/setting/Object.pm
+++ b/src/setting/Object.pm
@@ -73,6 +73,14 @@ class Object is also {
return @methods;
}
+
+ multi method undefine() {
+ self = undef;
+ }
+}
+
+multi sub undefine($x) {
+ $x.undefine;
}
# vim: ft=perl6
|
jswitzer@gmail.com - Status changed from 'new' to 'open' |
From @moritzI'm not sure if the patch attached to this ticket ever got applied, but |
@moritz - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#69238 (status was 'resolved')
Searchable as RT69238$
The text was updated successfully, but these errors were encountered: