Added primitive math ops, and realized when chaining them that overload resolution had to happen for different functions at different times (esp now that we don't just go outside in). Added a iterative resolver to solve the overloads, which iterates over each one and binds the one that only has one option and unifing types based on that, then running through them all again. If progress is not made for a whole iteration, it errors out and shows the first ambigious call. It could show all ambigious calls...
This commit is contained in:
@@ -81,6 +81,19 @@ obj type (Object) {
|
||||
}
|
||||
return base == other.base
|
||||
}
|
||||
fun shallow_equality(other: *type):bool {
|
||||
return shallow_equality(*other)
|
||||
}
|
||||
fun shallow_equality(other: ref type):bool {
|
||||
if (indirection != other.indirection)
|
||||
return false
|
||||
match(base) {
|
||||
base_type::_fun(b) {
|
||||
return other.is_fun() && base._fun.third == other.base._fun.third
|
||||
}
|
||||
}
|
||||
return base == other.base
|
||||
}
|
||||
fun to_string(): str {
|
||||
var indr_string = str("")
|
||||
if (is_ref)
|
||||
|
||||
Reference in New Issue
Block a user