BrowserREPL-button-tip-on BrowserREPL-button-tip-off

EditButtonTip 2023-03-07

class X::Method::InvalidQualifier

Error due to calling a qualified method from an ineligible class

class X::Method::InvalidQualifier is Exception { }
Code

Thrown when a method is call in the form $invocant.TheClass::method if $invocant does not conform to TheClass.

For example

1.Str::split(/a/);
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Method::InvalidQualifier: Cannot dispatch to method split on Str because it is not inherited or done by Int␤»
Code

Methods§

method method§

method method(--> Str:D)
Code

Returns the name of the (unqualified) method.

method invocant§

Returns the invocant of the failed, qualified method call

method qualifier-type§

Returns the type by which the method call was qualified.