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