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
Anonymous classes are not quite as anonymous as one would wish in Rakudo #924
Comments
From @masak<masak> rakudo: sub foo() { return class { method Str() { return "OH |
From @pmichaudOn Mon, Apr 20, 2009 at 07:58:42AM -0700, Carl Mäsak wrote:
That code looks to me as though it was attempting to define the class 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/S12-class/anonymous.t commit 003f3f51c26dd19f6f7d4969f992d2727f9b034e [t/spec] Test for RT #64888 Inline Patchdiff --git a/t/spec/S12-class/anonymous.t b/t/spec/S12-class/anonymous.t
index 5f87f25..9f3c1d1 100644
--- a/t/spec/S12-class/anonymous.t
+++ b/t/spec/S12-class/anonymous.t
@@ -3,7 +3,7 @@ use v6;
use Test;
# L<S12/Classes/"Perl 6 supports multiple inheritance, anonymous classes">
-plan 12;
+plan 16;
# Create and instantiate empty class; check .WHAT works and stringifies to
# empty string.
@@ -46,3 +46,24 @@ is($t3.x, 42, 'anonymous classes can have attributes');
ok($x ~~ TestParent, 'anonymous class isa TestParent');
is($x.foo, 42, 'inherited method from TestParent');
}
+
+# RT #64888
+{
+ sub rt64888 {
+ (
+ class {
+ method Str() { 'RT #64888' }
+ method Num() { 64888 }
+ }
+ ).new
+ }
+ my $i1;
+ my $i2;
+
+ lives_ok { $i1 = rt64888() }, 'can get anonymous class instance once';
+ #?rakudo todo 'RT #64888'
+ lives_ok { $i2 = rt64888() }, 'can get anonymous class instance twice';
+
+ is ~$i1, 'RT #64888', 'anonymous class stringified works';
+ is +$i1, 64888, 'anonymous class numified works';
+} |
From @jnthnOn Mon Apr 20 07:58:42 2009, masak wrote:
Just fixed anonymous classes up in master and this issue is now happily
Unfudged the spectest; closing ticket. Thanks, Jonathan |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#64888 (status was 'resolved')
Searchable as RT64888$
The text was updated successfully, but these errors were encountered: