class RakuAST::Type::Definedness { }

The RakuAST::Type::Definedness class represents a Raku type that constrains on (un)defined.

Object introspection§

RakuAST::Type::Definedness 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-coercive§

say $type.is-coercive;  # True

The is-coercive method returns True if the base-type is coercive.

name§

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

Returns the L<RakuAST::Name>|/type/RakuAST/Name object of this RakuAST::Type::Definedness object.

Object creation§

There is only one way to create a RakuAST::Type::Definedness object.

new§

my $type = RakuAST::Type::Definedness.new(
  base-type => RakuAST::Type::Simple.from-identifier("Int"),
  definite  => True
);
dd $type;  # Int:D

The .new method creates a RakuAST::Type::Definedness object. It expects the following named arguments:

  • :base-type - RakuAST::Type object for the base type (required)

  • :definite - True/False (required)