class X::TypeCheck::Binding
Error ReportCollection examples

Error due to a failed type check during binding

class X::TypeCheck::Binding is X::TypeCheck { }

Thrown when the type check of a binding operation fails.

For example:

my Int $x := "foo";
CATCH { default { put .^name''.Str } };
# OUTPUT: «X::TypeCheck::Binding: Type check failed in binding; expected Int but got Str ("foo")␤»

Note that the compiler is free to detect obvious errors at compile time, and complain with a different error at compile time.