Fix bug for type comparisons
This commit is contained in:
@@ -308,12 +308,13 @@ namespace Solstice {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Narrowing::None: {
|
case Narrowing::None: {
|
||||||
for (const auto& [key, value] : overloads) {
|
for (const auto& ltype : left.ptype.possiblities) {
|
||||||
if (
|
for (const auto& rtype : right.ptype.possiblities) {
|
||||||
left.ptype.possiblities.find(key.left) != left.ptype.possiblities.end() &&
|
TypePair pair{ltype, rtype};
|
||||||
right.ptype.possiblities.find(key.right) != right.ptype.possiblities.end()
|
if (overloads.find(pair) == overloads.end()) {
|
||||||
) {
|
throw std::runtime_error("no valid overload compatible with previous statements");
|
||||||
node.ptype.possiblities.insert(value);
|
}
|
||||||
|
node.ptype.possiblities.insert(overloads[pair]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user