-
Notifications
You must be signed in to change notification settings - Fork 82
Description
There used to be 1 function called resultingType, which was used to get the "output" type of a binary op node, to get the type of an array, and to determine whether a binary op should compile to a numeric opcode (e.g. NUMEQUAL instead of EQUAL). This was a terrible abstraction since these things barely have anything in common.
We ran into that issue some time ago when adding bitshifts. Back then we split up the function into resultingTypeForArrayElements and resultingTypeForBinaryOp. Then today we refactored the use case for numeric opcodes, so that that doesn't use either of these functions at all.
resultingTypeForBinaryOp is still a bit of an awkward function, so we want to refactor the type checking code for binary ops at some point in the future.