class X::Bind::NativeType does X::Comp { }

Compile-time error thrown when trying to bind to a natively typed variable.

Since native variables explicitly don't have the concept of a container at runtime, it does not make sense to support both binding and assignment; Raku supports only assignment (which makes more sense, because native types are value types).

For example the code

my int $x := 3;

dies with

Cannot bind to natively typed variable '$x'use assignment instead

and can be fixed by writing it as

my int $x = 3;

Methods§

method name§

method name(--> Str:D)

Returns the name of the variable.

Typegraph§

Type relations for X::Bind::NativeType
raku-type-graph X::Bind::NativeType X::Bind::NativeType Exception Exception X::Bind::NativeType->Exception X::Comp X::Comp X::Bind::NativeType->X::Comp Mu Mu Any Any Any->Mu Exception->Any X::Comp->Exception

Expand chart above