Ticket #4 (closed defect: fixed)
Don't allow assignment in an assert
Reported by: | Chuck.Esterbrook | Owned by: | Chuck |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Cobra Workspace | Version: | 0.7.4 |
Keywords: | Cc: |
Description
Asserts should have no side effects as they may be excluded (-include-asserts:no or -turbo). Particularly, the top level expression should not be an assignment as this is usually just a typo where the programmer meant to say "x == y", not "x = y". This often gives a warning:
warning: The expression "..." (of type "...") will always evaluate to true because it is not nilable. You can remove the expression.
It should always give an error with a more appropriate message.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.