Find, test and fix an issue related to function argument type reporting when discussing dynamic object functions (ie, def int::somefunc() {} )
This commit is contained in:
@@ -5,6 +5,10 @@ def test_function(a)
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// test_function tests
|
||||
assert_equal(test_function.get_arity(), 1);
|
||||
assert_equal(test_function.get_annotation(), "#Test Function Description\n");
|
||||
assert_equal(test_function.get_contained_functions().size(), 0);
|
||||
@@ -16,6 +20,24 @@ assert_not_equal(test_function, `+`);
|
||||
|
||||
assert_equal(test_function.call([1]), 1);
|
||||
|
||||
// dynamic object function tests
|
||||
|
||||
def int::test_fun()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
assert_equal(test_fun.get_arity(), 1);
|
||||
assert_equal(test_fun.get_contained_functions.size(), 1);
|
||||
assert_equal(test_fun.get_param_types().size(), 2);
|
||||
assert_equal(test_fun, test_fun);
|
||||
var test_fun_types = test_fun.get_param_types();
|
||||
assert_equal(true, test_fun_types[0].bare_equal(Object_type));
|
||||
assert_equal(true, test_fun_types[1].bare_equal(int_type));
|
||||
|
||||
|
||||
// built-ins tests
|
||||
|
||||
assert_equal(2, `==`.get_arity());
|
||||
|
||||
// < should be the merging of two functions bool <(PODObject, PODObject) and bool <(string, string)
|
||||
|
Reference in New Issue
Block a user