implements resolve_method on parfait type
with associated changes to class adds note about the not being the final version
This commit is contained in:
@ -114,6 +114,20 @@ module Parfait
|
||||
nil
|
||||
end
|
||||
|
||||
# resolve according to normal oo logic, ie look up in superclass if not present
|
||||
# NOTE: this will probably not work in future as the code for the superclass
|
||||
# method, being bound to t adifferent type, will assume that types (not the run-time
|
||||
# actual types) layout. Either need to enforce some c++ style upwards compatibility (buuh)
|
||||
# or copy the methods and recompile them for the actual type. (maybe still later dynamically)
|
||||
# But for now we walk up, as it should really just be to object
|
||||
def resolve_method( fname )
|
||||
method = get_method(fname)
|
||||
return method if method
|
||||
sup = object_class.super_class
|
||||
return nil unless sup
|
||||
sup.instance_type.resolve_method(fname)
|
||||
end
|
||||
|
||||
def == other
|
||||
self.object_id == other.object_id
|
||||
end
|
||||
|
Reference in New Issue
Block a user