|
|
|
|
|
by Kon-Peki
1254 days ago
|
|
I'm wondering if what you are asking for is what Swift does - overflow kills your program, but you can opt into allowing it by using "Overflow Operators" (&+, &- and &*). This crashes in Swift var potentialOverflow = Int16.max
potentialOverflow += 1
This does not crash var potentialOverflow = Int16.max
potentialOverflow &+= 1
[1] https://docs.swift.org/swift-book/LanguageGuide/AdvancedOper... |
|