Skip to content

Commit 72f2c39

Browse files
committed
Cover serialization crashes with traits + roles
RT#127959: https://rt.perl.org/Ticket/Display.html?id=127959
1 parent 195227f commit 72f2c39

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

MISC/bug-coverage-stress.t

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use Test::Util;
77
# or ones that need to be only part of strestest and not spectest.
88
# Feel free to move the tests to more appropriate places.
99

10-
plan 5;
10+
plan 6;
1111

1212
# RT #132042
1313
doesn't-hang
@@ -103,4 +103,32 @@ is_run 「
103103
sleep 2;
104104
, {:out<pass>, :err(''), :0status}, 'supply inside sock does not hang';
105105

106+
# RT #127959
107+
given make-temp-dir() {
108+
.child('myclass.pm6').spurt:
109+
unit class myclass;
110+
use mytraitmodule;
111+
112+
has $!bar is mytrait;
113+
;
114+
115+
.child('mytraitmodule.pm6').spurt:
116+
unit module mytraitmodule;
117+
my role rrHOW {
118+
method compose(Mu \type) {
119+
type.^add_method('nn', method (Mu:D:) { return 'nn' ; } );
120+
callsame;
121+
}
122+
}
123+
124+
multi trait_mod:<is>(Attribute:D $attr, :$mytrait! ) is export {
125+
$attr.package.HOW does rrHOW;
126+
}
127+
;
128+
129+
is_run use myclass; print 'pass', :compiler-args['-I', .absolute],
130+
{:err(''), :out<pass>, :0status},
131+
'no serialization crashes with roles and traits';
132+
}
133+
106134
# vim: expandtab shiftwidth=4 ft=perl6

0 commit comments

Comments
 (0)