checking return type is a type
This commit is contained in:
@ -56,7 +56,7 @@ module Phisol
|
||||
raise "unimplemented: \n#{code} \nfor #{ref.inspect}"
|
||||
end
|
||||
else
|
||||
if( me.type == :int)
|
||||
if( me.type.is_a? Phisol::Integer)
|
||||
name = :plus if name == :+
|
||||
method = Virtual.machine.space.get_class_by_name(:Integer).get_instance_method(name)
|
||||
puts Virtual.machine.space.get_class_by_name(:Integer).method_names.to_a
|
||||
|
@ -40,13 +40,10 @@ module Phisol
|
||||
@method.source.receiver = r
|
||||
puts "compile method #{@method.name}"
|
||||
|
||||
|
||||
#frame = frame.new_frame
|
||||
kids.to_a.each do |ex|
|
||||
return_type = process(ex)
|
||||
raise return_type.inspect if return_type.is_a? Virtual::Instruction
|
||||
ret = process(ex)
|
||||
raise ret.inspect if ret.is_a? Virtual::Instruction
|
||||
end
|
||||
@method.source.return_type = return_type
|
||||
@method = nil
|
||||
Virtual::Return.new(return_type)
|
||||
end
|
||||
|
Reference in New Issue
Block a user