fix resolve issue
the typed method has to be created in the to_pafait pass for it to work correctly, ie for the sends to have something to call also means that when during compilation creating (raising?) a method, not only vool. but also callable has to be created
This commit is contained in:
@ -12,7 +12,9 @@ module Vool
|
||||
# Must pass in the actual Parfait class (default nil is just to conform to api)
|
||||
def to_parfait( clazz = nil )
|
||||
raise "No class given to class method #{name}" unless clazz
|
||||
clazz.single_class.add_instance_method_for(name , make_arg_type , make_frame , body )
|
||||
vool_m = clazz.single_class.create_instance_method_for(name , make_arg_type , make_frame , body )
|
||||
vool_m.create_callable_method_for(clazz.single_class.instance_type)
|
||||
vool_m
|
||||
end
|
||||
|
||||
def to_mom(clazz)
|
||||
|
@ -17,7 +17,9 @@ module Vool
|
||||
#FIXME , should check arg_type, and if the same, clear method and ok
|
||||
raise "Redefining #{clazz.name}.#{name} not supported #{method}"
|
||||
end
|
||||
clazz.add_instance_method_for(name , make_arg_type , make_frame , body )
|
||||
vool_m = clazz.create_instance_method_for(name , make_arg_type , make_frame , body )
|
||||
vool_m.create_callable_method_for(clazz.instance_type)
|
||||
vool_m
|
||||
end
|
||||
|
||||
# Creates the Mom::MethodCompiler that will do the next step
|
||||
|
@ -56,8 +56,9 @@ module Vool
|
||||
def create_method_from_source(compiler)
|
||||
vool_method = @receiver.ct_type.object_class.resolve_method!(@name)
|
||||
return nil unless vool_method
|
||||
puts "#{vool_method} , adding to #{@receiver.ct_type.object_class.name}"
|
||||
#puts "#{vool_method.name} , adding to #{@receiver.ct_type.object_class.name}"
|
||||
@receiver.ct_type.object_class.add_instance_method(vool_method)
|
||||
vool_method.create_callable_method_for(@receiver.ct_type)
|
||||
new_compiler = vool_method.compiler_for(@receiver.ct_type)
|
||||
compiler.add_method_compiler(new_compiler)
|
||||
new_compiler.callable
|
||||
|
Reference in New Issue
Block a user