type
ErrorsCollection

type

Synthesised documentation from type/Pod/FormattingCode type/X/Does/TypeObject type/X/Bind/Slice type/Parameter type/Attribute

From type/Pod/FormattingCode

See Original text in context

method type(--> Mu)

From type/X/Does/TypeObject

See Original text in context

method type(X::Does::TypeObject:D: --> Mu:U)

Returns the type object into which the code tried to mix in a role.

From type/X/Bind/Slice

See Original text in context

method type(X::Bind::Slice:D:)

returns the type object of the thing that you tried to slice-bind, for example Array, List or Hash.

From type/Parameter

See Original text in context

Returns the nominal type constraint of the parameter.

From type/Attribute

See Original text in context

method type(Attribute:D: --> Mu)

Returns the type constraint of the attribute.

class TypeHouse {
    has Int @.array;
    has $!scalar;
    has @.mystery;
}
my @types = TypeHouse.^attributes(:local)[0..2];
for 0..2 { say @types[$_].type }
# OUTPUT: «(Positional[Int]) 
# (Mu) 
# (Positional)␤»