Skip to content

Conversation

@CharlesZ-Chen
Copy link
Owner

@CharlesZ-Chen CharlesZ-Chen commented Nov 21, 2017

Solve issue #4 .

Now we checking on unsafe EOF comparison, instead of preventing every type cast from ReadInt to byte or char. (As the only unsafe operation is comparing converted byte or char to EOF value -1, the type cast itself is safe in terms of avoiding prematurely exit from loop or stuck into infinite loop).


Reason of removing tests:

  • post-condition: Original post-condition is for propagating the EOF value check in a separate method, to determine if the type cast in the caller is safe. The new mechanism doesn't prevent type cast anymore, therefore, we don't need this post-condition in the new way.

  • binaryOpRefine: this is a TODO. Currently new way only checking on eqaulTo and notEqualTo, should add checking on range checking (e.g. for lessThan: should prevent unsafe comparison like @NRI < 0).

  • teamed-quiz: this is a realWorld example for binaryOpRefine. Also a TODO here.

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.

2 participants