Asserts don't work
marcogalluzzi opened this issue · comments
marcogalluzzi commented
If you include "assert()" in the source code they don't seem to be evaluated. To reproduce the error just try assert(false)
. Nothing happens when executing.
Marcin Krzyzanowski commented
This is because the source is compiled with optimization "-O", that disables assert
ref: https://blog.krzyzanowskim.com/2015/03/09/swift-asserts-the-missing-manual/
marcogalluzzi commented
Of course, I didn't think about it. Thanks for clarifying.
However I would suggest to switch off optimization (-Onone) because the application is meant for people to "play" with Swift.
Another option would be to write a warning text about assert() not working.
Have a nice day