I really like the tuple solution for conditional statements.
Theres an uncovered edge case for Variable initializations because solidity wont allow you to reference a var before its type is decided. Basically this:
Error: Instrumented solidity invalid: :26:5: Error: Assignment necessary for type detection.
var z; (,z) = y ? (y,false) : (y,true);
^----^
To fix this you'd have to look down the tree and figure out what the type of the result of the ConditionalExpression is and initialize the var statement with it. It would be incredibly complicated.
I really like the tuple solution for conditional statements.
Theres an uncovered edge case for Variable initializations because solidity wont allow you to reference a
var
before its type is decided. Basically this:To fix this you'd have to look down the tree and figure out what the type of the result of the
ConditionalExpression
is and initialize the var statement with it. It would be incredibly complicated.