Make it harder for typechecking exceptions themselves to throw #3531
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Typechecking exceptions were using
$.
syntax to get their$!expected
and$!got
attributes' values. This expects them to have anitem
method, which is not always the case. On top of that, in some places it expected methods likeraku
to exist on them orname
to exist on their HOW, which isn't always the case either, and would containerize values withScalar
.This makes it so typechecking exceptions don't containerize values, nqp calls are instead of method calls wherever possible, and whether or not a method exists on a value is confirmed before calling it wherever that isn't possible. Now, the only times they should throw are when
.raku
or.^name
throw, which are errors the user should know about anyway.Typechecking errors aren't the only cases where you can wind up with
Exception handler not loaded for catch
being thrown, but are by far the most annoying ones.Passes
make spectest
. Not sure if it passesmake test
or not sincet/06-telemetry/02-usage.t
fails on master as well as this, but all other tests pass.