class RakuAST::Type::Setting { }

The RakuAST::Type::Setting class represents a Raku core-type.

Object introspection§

RakuAST::Type::Setting object is typically created when parsing Raku Programming Language code. So most developers will only need to know how to introspect the objects created.

is-native§

say $type.is-native;  # True or False

The is-native method returns True if the canonical name of the type consists of only lowercase letters. Else it returns False.

is-coercive§

say $type.is-coercive;  # True or False

The is-coercive method returns True if the resolved type is known to be coercive. Else it returns False.

name§

say $type.name;  # RakuAST::Name.from-identifier("foo")

Returns the RakuAST::Name object of this RakuAST::Type::Setting object.

Object creation§

my $type = RakuAST::Type::Setting.new($name);

A RakuAST::Type::Setting object is instantiated with the .new method. It takes a single argument: the RakuAST::Name object.

Object creation§

The RakuAST::Type::Setting object is essentially a RakuAST::Type::Simple object but one that will always resolve to the Raku core setting.

There are several ways to create a RakuAST::Type::Setting object. For simple identifiers it is recommended to use the alternate .from-identifier and .from-identifier-parts methods to create a RakuAST::Type::Setting object. Otherwise one can use the standard .new method.

new§

my $type = RakuAST::Type::Setting.new(
  RakuAST::Name.from-identifier("Int")
);

Creates a RakuAST::Type::Setting object from the given RakuAST::Name object.

from-identifier§

my $type = RakuAST::Type::Setting.from-identifier('Str');

Creates a RakuAST::Type::Setting object from the given simple identifier string (which may not contain any :: separators).

from-identifier-parts§

my $type = RakuAST::Type::Setting.from-identifier-parts('IO','Path');

Creates a RakuAST::Type::Setting object from the given simple identifier string parts (which may not contain any :: separators).