mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
* allow defects to be caught even for --exceptions:goto (WIP) * implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180 * new implementation for integer overflow checking * produce a warning if a user-defined exception type inherits from Exception directly * applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic' * fixes #13627 * don't inherit from Exception directly
18 lines
196 B
Nim
18 lines
196 B
Nim
discard """
|
|
outputsub: "value out of range: 50 notin 0 .. 40 [RangeError]"
|
|
exitcode: "1"
|
|
"""
|
|
|
|
type
|
|
TRange = range[0..40]
|
|
|
|
proc p(r: TRange) =
|
|
discard
|
|
|
|
var
|
|
r: TRange
|
|
y = 50
|
|
r = y
|
|
|
|
#p y
|