role X::Comp
ErrorsCollection

role X::Comp

Common role for compile-time errors

role X::Comp is Exception { }

Common role for compile-time errors.

Note that since the backtrace of a compile time error generally shows routines from the compiler, not from user-space programs, the Backtrace returned from the backtrace method is not very informative. Instead the exception carries its own filename, line and column attributes and public accessors.

If an error occurs while creating an object (like a class or routine) at compile time, generally the exception associated with it does not hold a reference to the object (for example a class would not be fully composed, and thus not usable). In those cases the name of the would-be-created object is included in the error message instead.

Methods

method filename

The filename in which the compilation error occurred

method line

The line number in which the compilation error occurred.

method column

The column number of location where the compilation error occurred. (Rakudo does not implement that yet).