Function lookup now handles overloading
This commit is contained in:
@@ -38,17 +38,19 @@ obj type (Object) {
|
||||
base.copy_construct(&base_type::none())
|
||||
parameter_types.construct()
|
||||
indirection = 0
|
||||
return_type = null<type>()
|
||||
return this
|
||||
}
|
||||
fun construct(base_in: base_type, indirection_in: int): *type {
|
||||
base.copy_construct(&base_in)
|
||||
parameter_types.construct()
|
||||
indirection = indirection_in
|
||||
return_type = null<type>()
|
||||
return this
|
||||
}
|
||||
fun construct(parameter_types_in: vector<*type>, return_type_in: *type, indirection_in: int): *type {
|
||||
base.copy_construct(&base_type::function())
|
||||
parameter_types.copy_construct(¶meter_types)
|
||||
parameter_types.copy_construct(¶meter_types_in)
|
||||
return_type = return_type_in
|
||||
indirection = indirection_in
|
||||
return this
|
||||
@@ -67,6 +69,12 @@ obj type (Object) {
|
||||
base.destruct()
|
||||
parameter_types.destruct()
|
||||
}
|
||||
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) )
|
||||
return false
|
||||
return base == other.base && parameter_types == other.parameter_types && indirection == other.indirection
|
||||
}
|
||||
fun to_string(): string {
|
||||
match (base) {
|
||||
base_type::none() return string("none, indirection: ") + indirection
|
||||
|
||||
Reference in New Issue
Block a user