Starting to fix resolve mechanism

resolve had the wrong approach, sort of class based oo
It took methods from "derived" types and just used them
To be correct, those methods would have to be recompiled for the current type, rubyx is type, not class based.
Started on that, still soe strange hang though

Later, type and method analysis may reveal "compatible" types (down only off course) where one could use the exact same code, but that is phase 2
This commit is contained in:
2019-09-29 12:06:37 +03:00
parent 1e5073200c
commit 17f87f7464
9 changed files with 51 additions and 38 deletions

View File

@ -79,5 +79,9 @@ module Parfait
def test_class_name
assert_equal :Message , @type.class_name
end
def test_class_object_type
int_class = @space.get_type_by_class_name(:Integer)
assert_equal :Integer, int_class.object_class.name
end
end
end

View File

@ -67,21 +67,5 @@ module Parfait
test_get_instance
assert_equal :foo , @space.get_method!(:Object , :foo).name
end
def test_resolve_on_object
add_foo_to :Object
assert_equal :foo , object_type.resolve_method( :foo ).name
end
def test_resolve_super
add_foo_to :Object
assert_equal :foo , @try_class.instance_type.resolve_method( :foo ).name
end
def test_resolve_is_get
add_foo_to
assert_equal :foo , @try_class.instance_type.resolve_method( :foo ).name
assert_equal :foo , @try_class.instance_type.get_method( :foo ).name
end
def test_resolve_fail
assert_nil object_type.resolve_method( :foo )
end
end
end