Skip to content

incorrect null-return from method calls #503

plobsing opened this Issue Jan 3, 2011 · 3 comments

2 participants

plobsing commented Jan 3, 2011

Calling a method expecting one return value when the method returns none does not work as expected. The register should be filled with PMCNULL, or an exception should be thrown.

In stead, the register is filled with the invocant. While this allows for a nifty chaining accidental feature, this is not what is expected in these situations.


plobsing commented Jan 3, 2011

492 byte attachment from plobsing

```# Copyright (C) 2006-2009, Parrot Foundation.


.sub 'main' :main
# set up filehandle
$P0 = new ['FileHandle']
$P0.'open'('/dev/null', 'w')
$P0.'puts'("null null null null null")

push_eh OK
    # expect incorrect number of parameters
    $P1 = $P0.'flush'() 
if_null $P1, OK

say "not ok"

say "ok"

Local Variables:

mode: pir

fill-column: 100


vim: expandtab shiftwidth=4 ft=pir:

plobsing commented Jan 3, 2011

test for proper nullary method return behaviour (using FileHandle.flush)

jkeenan commented Aug 28, 2011

Can we get an update on the status of this ticket?

If the bug plobsing describes is real, then should we transform the patch into a test and TODO it?

Thank you very much.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.