Skip to content
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

cannot die or fail without parameters #1129

Closed
p6rt opened this issue Jul 9, 2009 · 7 comments
Closed

cannot die or fail without parameters #1129

p6rt opened this issue Jul 9, 2009 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 9, 2009

Migrated from rt.perl.org#67374 (status was 'resolved')

Searchable as RT67374$

@p6rt
Copy link
Author

p6rt commented Jul 9, 2009

From jswitzer@gmail.com

(21​:38​:19) s1n​: rakudo​: die
(21​:38​:24) p6eval​: rakudo 70bfd5​: OUTPUT«No applicable methods.␤in Main
(/tmp/VO5JK3sPoh​:2)␤»
(21​:38​:35) s1n​: hmm, bug?
(21​:38​:37) TimToady​: you didn't give it an argument
(21​:39​:06) TimToady​: so it didn't match any signatures
(21​:39​:18) s1n​: it won't just die like p5?
(21​:40​:19) TimToady​: rakudo​: ...
(21​:40​:21) p6eval​: rakudo 70bfd5​: OUTPUT«Can't return outside a routine␤in
Main (/tmp/hl05fbXGmv​:2)␤»
(21​:40​:29) TimToady​: O_O
(21​:40​:53) TimToady​: rakudo​: fail
(21​:40​:58) p6eval​: rakudo 70bfd5​: OUTPUT«Can't return outside a routine␤in
Main (/tmp/tzqz3NQArU​:2)␤»
(21​:41​:18) s1n​: rakudo​: exit
(21​:41​:21) p6eval​: rakudo 70bfd5​: ( no output )
(21​:41​:42) TimToady​: rakudo​: .die
(21​:41​:45) p6eval​: rakudo 70bfd5​: OUTPUT«Method 'die' not found for invocant
of class 'Failure'␤»
(21​:41​:58) TimToady​: now that's funny
(21​:43​:04) TimToady​: rakudo​: $!.die
(21​:43​:07) p6eval​: rakudo 70bfd5​: OUTPUT«Method 'die' not found for invocant
of class 'Failure'␤»
(21​:45​:55) TimToady​: s1n​: so yes, die without arg is supposed to work, and
there's a rakudo bug
(21​:46​:02) TimToady​: specced to default to $!
(21​:46​:33) ***s1n files rakudobug
(21​:46​:46) TimToady​: S04​:1062

Seems that die and fail methods called without parameters are not properly
dispatching with $! as the parameter. Interestingly enough '...' causes the
same problem, which might not be the proper action/error.

Note​: this was mildly edited to remove unrelated IRC chatter.

-Jason "s1n" Switzer

@p6rt
Copy link
Author

p6rt commented Jul 9, 2009

From @kyleha

In r27491, I put a test in S29-context/die.t for the "die with no
argument" bug. There are some other things mentioned in the
conversation that perhaps also merit testing, but I haven't tested
those, just the "no argument" case.

@p6rt
Copy link
Author

p6rt commented Jun 25, 2010

From @bbkr

[17​:02] <bbkr> rakudo​: try { die "foo" }; try { die; CATCH { say $!} }
[17​:02] <p6eval> rakudo f34e78​: OUTPUT«Died␤␤»

However I'm not sure if your test is spec-compatible - die without
params should passthrough previously set $! ?

@p6rt
Copy link
Author

p6rt commented Jun 25, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 16, 2011

From @coke

On Fri Jun 25 08​:08​:54 2010, bbkr wrote​:

[17​:02] <bbkr> rakudo​: try { die "foo" }; try { die; CATCH { say $!} }
[17​:02] <p6eval> rakudo f34e78​: OUTPUT«Died␤␤»

However I'm not sure if your test is spec-compatible - die without
params should passthrough previously set $! ?

This and the original posting all work now​:

10​:52 < [Coke]> rakudo​: die
10​:52 <+p6eval> rakudo 25af2d​: OUTPUT«␤ in block <anon> at /tmp/goE0GS1Zpn​:1␤
  in <anon> at /tmp/goE0GS1Zpn​:1␤»
10​:52 < [Coke]> rakudo​: fail
10​:52 <+p6eval> rakudo 25af2d​: ( no output )
10​:52 < [Coke]> rakudo​: exit
10​:52 <+p6eval> rakudo 25af2d​: ( no output )
10​:53 < [Coke]> rakudo​: ...
10​:53 <+p6eval> rakudo 25af2d​: ( no output )
10​:53 < [Coke]> rakudo​: try { die "foo" }; try { die; CATCH { say $!} }
10​:53 <+p6eval> rakudo 25af2d​: OUTPUT«foo␤»

Closable with tests.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Jun 1, 2012

From @diakopter

On Sun Oct 16 07​:54​:08 2011, coke wrote​:

On Fri Jun 25 08​:08​:54 2010, bbkr wrote​:

[17​:02] <bbkr> rakudo​: try { die "foo" }; try { die; CATCH { say $!}
}
[17​:02] <p6eval> rakudo f34e78​: OUTPUT«Died␤␤»

However I'm not sure if your test is spec-compatible - die without
params should passthrough previously set $! ?

This and the original posting all work now​:

10​:52 < [Coke]> rakudo​: die
10​:52 <+p6eval> rakudo 25af2d​: OUTPUT«␤ in block <anon> at
/tmp/goE0GS1Zpn​:1␤
in <anon> at /tmp/goE0GS1Zpn​:1␤»
10​:52 < [Coke]> rakudo​: fail
10​:52 <+p6eval> rakudo 25af2d​: ( no output )
10​:52 < [Coke]> rakudo​: exit
10​:52 <+p6eval> rakudo 25af2d​: ( no output )
10​:53 < [Coke]> rakudo​: ...
10​:53 <+p6eval> rakudo 25af2d​: ( no output )
10​:53 < [Coke]> rakudo​: try { die "foo" }; try { die; CATCH { say $!}
}
10​:53 <+p6eval> rakudo 25af2d​: OUTPUT«foo␤»

Closable with tests.

fail, exit, die, and ... have tests. closing.

@p6rt
Copy link
Author

p6rt commented Jun 1, 2012

@diakopter - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant