Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

chriseth
Copy link
Contributor

I was increasingly uneasy with ConstantEvaluator setting the type property of the annotations. This should only be done by the TypeChecker, and not already in the reference resolution stage.

}
)";
CHECK_ERROR(text, TypeError, "Identifier must be declared constant.");
CHECK_ERROR(text, TypeError, "Invalid array length, expected integer literal or constant expression.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We lose a little precision here, but I think the previous error message was not particularly helpful, because you actually cannot declare a constant.

@axic
Copy link
Contributor

axic commented Nov 22, 2017

I'd split this into:

  • remove some fatal errors and just abort (changes error messages to less precision)
  • rework constantevaluator

}
}
)";
CHECK_ERROR(text, TypeError, "Constant identifier declaration must have a constant value.");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is also not too helpful, because you cannot assign a constant value to this variable.

_operation,
Token::isCompareOp(_operation.getOperator()) ?
make_shared<BoolType>() :
left->binaryOperatorResult(_operation.getOperator(), right)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not keep using commonType here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right

@chriseth
Copy link
Contributor Author

@axic I don't think I have time to work on splitting this...

@chriseth chriseth merged commit 3d1830f into develop Dec 14, 2017
@axic axic deleted the simplifyConstant branch December 15, 2017 14:29
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

Successfully merging this pull request may close these issues.

3 participants