start type narrowing for binary exprs
This commit is contained in:
@@ -8,6 +8,13 @@
|
||||
|
||||
namespace Solstice {
|
||||
|
||||
enum class Narrowing {
|
||||
None,
|
||||
Left,
|
||||
Right,
|
||||
Both
|
||||
};
|
||||
|
||||
class TypeChecker {
|
||||
std::unordered_map<std::string, PossibleType> variables;
|
||||
std::unordered_map<std::string, Type> types;
|
||||
@@ -37,6 +44,9 @@ namespace Solstice {
|
||||
|
||||
void checkCodeBlockType(Node& node);
|
||||
|
||||
Narrowing doesNodeChildrenNeedNarrowing(Node& node);
|
||||
void narrowBinaryNode(Node& node, std::unordered_map<TypePair, Type>& overloads);
|
||||
|
||||
void checkAddType(Node& node);
|
||||
void checkSubtractType(Node& node);
|
||||
void checkMultiplyType(Node& node);
|
||||
|
||||
Reference in New Issue
Block a user