Skip to content

Commit

Permalink
don't fail on converting type objects to Num or Int; I couldn't make …
Browse files Browse the repository at this point in the history
…it emit a warning, but I think just returning 0 is still more correct than a hard failure
  • Loading branch information
moritz committed Mar 23, 2010
1 parent f20f1e5 commit 4c56ade
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/cheats/parrot/Protoobject.pir
Expand Up @@ -108,18 +108,12 @@ Return a clone of the protoobject with a new WHENCE property set.

.namespace ['P6protoobject']
.sub '' :vtable('get_integer') :method
.const 'Sub' $P1 = '!FAIL'
$P0 = $P1('Use of type object as value in integer context')
$I0 = $P0
.return ($I0)
.return (0)
.end

.namespace ['P6protoobject']
.sub '' :vtable('get_number') :method
.const 'Sub' $P1 = '!FAIL'
$P0 = $P1('Use of type object as value in numeric context')
$N0 = $P0
.return ($N0)
.return (0.0)
.end

# Local Variables:
Expand Down

0 comments on commit 4c56ade

Please sign in to comment.