change method locals to type object too (same as args)
This commit is contained in:
@@ -7,7 +7,7 @@ module Typed
|
||||
|
||||
reset_regs # field_def is a statement, no return and all regs
|
||||
name_s = no_space( statement.name.value )
|
||||
@method.ensure_local( name_s, statement.type ) unless( @method.has_arg(name_s))
|
||||
@method.add_local( name_s, statement.type ) unless( @method.has_arg(name_s))
|
||||
# if there is a value assigned, process it as am assignemnt statement (kind of call on_assign)
|
||||
process( Tree::Assignment.new(statement.name , statement.value ) ) if statement.value
|
||||
return nil
|
||||
|
@@ -28,7 +28,7 @@ module Typed
|
||||
raise "must define variable '#{statement.name}' before using it" unless index
|
||||
frame = use_reg :Frame
|
||||
add_code Register.get_slot(statement , :message , :frame , frame )
|
||||
ret = use_reg @method.locals[index].value_type
|
||||
ret = use_reg @method.locals_type( index )
|
||||
add_code Register.get_slot(statement , frame , Parfait::Frame.get_indexed(index), ret )
|
||||
return ret
|
||||
end
|
||||
|
Reference in New Issue
Block a user