Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional assignment to VariableDeclaration. #44

Closed
cgewecke opened this issue Jan 13, 2017 · 0 comments
Closed

Conditional assignment to VariableDeclaration. #44

cgewecke opened this issue Jan 13, 2017 · 0 comments

Comments

@cgewecke
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants