File tree Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Expand file tree Collapse file tree 1 file changed +33
-1
lines changed Original file line number Diff line number Diff line change 1
1
use v6 ;
2
2
use Test ;
3
- plan 26 ;
3
+ plan 31 ;
4
4
5
5
# L<S14/Roles/"Roles may be composed into a class at compile time">
6
6
@@ -131,4 +131,36 @@ ok rB !~~ RT64002, 'role not matched by second role it does';
131
131
' can use a sub from the setting in a method composed from a role' ;
132
132
}
133
133
134
+ # RT #64766
135
+ {
136
+ my class A {
137
+ method foo { " OH HAI" }
138
+ method aie { " AIE!" }
139
+ }
140
+
141
+ {
142
+ my role B { has A $ . bar handles ' aie' }
143
+ my class C does B { }
144
+ is C. new . aie, ' AIE!' , ' literal handles from role is composed (1)' ;
145
+ throws-like { C. new . foo }, X::Method::NotFound ,
146
+ ' literal handles from role is composed (2)' ;
147
+ }
148
+
149
+ {
150
+ my role B { has A $ . bar handles * }
151
+ my class C does B { }
152
+ is C. new . foo, ' OH HAI' , ' wildcard handles from role is composed (1)' ;
153
+ is C. new . aie, ' AIE!' , ' wildcard handles from role is composed (2)' ;
154
+ }
155
+
156
+ eval-dies-ok q :to /END /, ' attributes conflict in role composition' ;
157
+ my role B {
158
+ has A $.bar handles "aie"
159
+ }
160
+ my class C does B {
161
+ has A $.bar handles "foo"
162
+ }
163
+ END
164
+ }
165
+
134
166
# vim: syn=perl6
You can’t perform that action at this time.
0 commit comments