New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Junctions in subsignatures can cause infinite recursion #2583
Comments
From @sorear21:09 < sorear> rakudo: sub foo(Mu $x [ $y ]) { }; foo([ any(1,2,3) ]) There's no direct junction, so AUTOTHREAD makes no progress when called. |
From @cokeVerified behavior, unchanged in e8cea1. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @cokeOn Fri Dec 23 21:12:40 2011, sorear wrote:
Exciting new failure mode: ./perl6 -e 'sub foo(Mu $x [ $y ]) { }; foo([ any(1,2,3) ])' -- |
From @moritzOn Thu Jul 09 16:48:03 2015, coke wrote:
The error is coming from the signature binder: # Recurse into signature binder. $error[0] is of type BOOTCode here, and cannot be stringified. |
From @moritzOn Fri Mar 25 13:28:16 2016, moritz wrote:
I've tried this patch: Inline Patchdiff --git a/src/Perl6/Metamodel/BOOTSTRAP.nqp b/src/Perl6/Metamodel/BOOTSTRAP.nqp
index cb0cc76..c76ed8a 100644
--- a/src/Perl6/Metamodel/BOOTSTRAP.nqp
+++ b/src/Perl6/Metamodel/BOOTSTRAP.nqp
@@ -569,8 +569,11 @@ my class Binder {
my $result := bind(make_vm_capture($capture), $subsig, $lexpad,
$no_nom_type_check, $error);
unless $result == $BIND_RESULT_OK {
- if $error {
+ # $error[0] can be a callable when it's throwing a HLL exception.
+ # In this case we can't augment it with extra information.
+ if $error && !nqp::isinvokable($error[0]) {
# Note in the error message that we're in a sub-signature.
+ say($error[0].HOW.name($error[0]));
$error[0] := $error[0] ~ " in sub-signature";
if $has_varname {
$error[0] := $error[0] ~ " of parameter " ~ $varname;
But with that, the bind failure produces an infinite loop rather than reporting an error. |
Migrated from rt.perl.org#106932 (status was 'open')
Searchable as RT106932$
The text was updated successfully, but these errors were encountered: