hides
ErrorsCollection

hides

Synthesised documentation from type/Metamodel/MultipleInheritance language/typesystem

From type/Metamodel/MultipleInheritance

See Original text in context

method hides($obj)

Returns a list of all hidden parent classes.

From language/typesystem

See Original text in context

The trait hides provides inheritance without being subject to re-dispatching.

class A {
    method m { say 'i am hidden' }
}
class B hides A {
    method m { nextsame }
    method n { self.A::m }
};
 
B.new.m;  # No output 
B.new.n;  # OUTPUT: «i am hidden␤»

The trait is hidden allows a class to hide itself from re-dispatching.

class A is hidden {
    method m { say 'i am hidden' }
}
class B is A {
    method m { nextsame }
    method n { self.A::m }
}
 
B.new.m# No output 
B.new.n# OUTPUT: «i am hidden␤»

Classes declared with is hidden also generate slightly different method signatures. To facilitate re-dispatch, typical methods are automatically provided with an extra *%_ parameter that captures extra named arguments. Because classes declared with is hidden don't participate in re-dispatch, their methods don't receive this extra parameter.