File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ role Controller {
2
+ }
3
+
4
+ my package EXPORTHOW {
5
+ class DECLARE::controller is Metamodel ::ClassHOW {
6
+ method compose (Mu $ type ) {
7
+ self . add_role($ type , Controller);
8
+ callsame ;
9
+ }
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ my package EXPORTHOW {
2
+ class DECLARE::class is Metamodel ::ClassHOW {
3
+ }
4
+ }
Original file line number Diff line number Diff line change 1
1
use v6 ;
2
2
3
3
use Test ;
4
- plan 5 ;
4
+ plan 8 ;
5
5
6
6
use lib ' .' ;
7
7
@@ -24,3 +24,13 @@ throws_like { EVAL 'use t::spec::S12-meta::Supersede1;
24
24
use t::spec::S12-meta::Supersede2;' },
25
25
X::EXPORTHOW::Conflict , directive => ' SUPERSEDE' , declarator => ' class' ;
26
26
27
+ {
28
+ use t::spec::S12-meta::Declare;
29
+ controller Home { }
30
+ ok Home ~~ Controller, ' Type declared with new controller declarator got Controller role added' ;
31
+ }
32
+
33
+ dies_ok { EVAL ' controller Fat { }' }, ' Imported declarators do not leak out of lexical scope' ;
34
+
35
+ throws_like { EVAL ' use t::spec::S12-meta::DeclareBad;' },
36
+ X::EXPORTHOW::Conflict , directive => ' DECLARE' , declarator => ' class' ;
You can’t perform that action at this time.
0 commit comments