File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -490,9 +490,8 @@ L<re-dispatching|/language/functions#Re-dispatching>.
490
490
method n { self.A::m }
491
491
};
492
492
493
- B.new.m;
494
- B.new.n;
495
- # OUTPUT: «i am hidden»
493
+ B.new.m; # No output
494
+ B.new.n; # OUTPUT: «i am hidden»
496
495
497
496
The trait C < is hidden > allows a class to hide itself from
498
497
L < re-dispatching|/language/functions#Re-dispatching > .
@@ -505,9 +504,15 @@ L<re-dispatching|/language/functions#Re-dispatching>.
505
504
method n { self.A::m }
506
505
}
507
506
508
- B.new.m;
509
- B.new.n;
510
- # OUTPUT: «i am hidden»
507
+ B.new.m; # No output
508
+ B.new.n; # OUTPUT: «i am hidden»
509
+
510
+ Classes declared with C < is hidden > also generate slightly different method
511
+ signatures. To facilitate re-dispatch, typical methods are automatically
512
+ provided with an extra C < *%_ > parameter that L < captures extra named
513
+ arguments|/type/Method#index-entry-extra_named_arguments > . Because classes
514
+ declared with C < is hidden > don't participate in re-dispatch, their methods don't
515
+ receive this extra parameter.
511
516
512
517
= head3 trait C < trusts >
513
518
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ without a class is the need to use `&` to invoke them in the latter case. In
39
39
case any other sigil is used in the definition, as in the first example, that
40
40
sigil can also be used.
41
41
42
- X < |extra named arguments >
42
+ X < |extra named arguments > X < |*%_ (extra named arguments) >
43
43
Methods automatically capture extra named arguments into the special variable C < %_ > ,
44
44
where other types of C < Routine > will throw at runtime. So
45
45
You can’t perform that action at this time.
0 commit comments