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:
Torsten Ruger
2017-04-25 09:06:49 +03:00
parent e387bdb5f2
commit 47683817ee
4 changed files with 57 additions and 11 deletions

View File

@ -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