added proper template function instantiation caching

This commit is contained in:
Nathan Braswell
2016-02-03 21:57:06 -05:00
parent 1ea07d4f92
commit de3ead0573
5 changed files with 49 additions and 22 deletions

View File

@@ -109,9 +109,13 @@ obj type (Object) {
}
fun operator!=(other: ref type):bool return !(*this == other);
fun operator==(other: ref type):bool {
if ( (return_type && other.return_type && *return_type != *other.return_type) || (return_type && !other.return_type) || (!return_type && other.return_type) )
if (parameter_types.size != other.parameter_types.size)
return false
return base == other.base && parameter_types == other.parameter_types && indirection == other.indirection && type_def == other.type_def && traits == other.traits
for (var i = 0; i < parameter_types.size; i++;)
if (!deref_equality(parameter_types[i], other.parameter_types[i]))
return false
return base == other.base && deref_equality(return_type, other.return_type) &&
indirection == other.indirection && deref_equality(type_def, other.type_def) && traits == other.traits
}
fun to_string(): string {
var all_string = string("traits:[")