Skip to content

Commit

Permalink
Assigning Nil to a container resets it to type.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed Jun 26, 2010
1 parent 92d0c1c commit ac1c280
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/builtins/assign.pir
Expand Up @@ -47,8 +47,18 @@ src/builtins/assign.pir - assignment operations
goto cont_loop

scalar_assign:
# put the source in item context, fully dereference it, and set the
# lhs objectref to it
# check for Nil assignment
$I0 = isa source, ['Parcel']
unless $I0 goto item_assign
$I0 = elements source
if $I0 goto item_assign
nil_assign:
source = getprop 'type', cont
unless null source goto have_source
source = get_hll_global '$!OBJECTREF'
goto have_source
item_assign:
# put the source in item context
$I0 = can source, 'item'
unless $I0 goto have_source
source = source.'item'()
Expand Down

0 comments on commit ac1c280

Please sign in to comment.