mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-31 02:43:41 +00:00
@@ -1,5 +1,6 @@
|
||||
discard """
|
||||
cmd: "nim c -d:release --rangeChecks:on $file"
|
||||
disabled: "windows"
|
||||
output: '''StrictPositiveRange
|
||||
float
|
||||
range fail expected
|
||||
@@ -33,11 +34,11 @@ try:
|
||||
myoverload(StrictPositive(z))
|
||||
except:
|
||||
echo "range fail expected"
|
||||
|
||||
|
||||
|
||||
|
||||
proc strictOnlyProc(x: StrictPositive): bool =
|
||||
if x > 1.0: true else: false
|
||||
|
||||
|
||||
let x2 = 5.0.Positive
|
||||
doAssert(strictOnlyProc(x2))
|
||||
|
||||
@@ -46,4 +47,4 @@ try:
|
||||
discard strictOnlyProc(x4)
|
||||
except:
|
||||
echo "range fail expected"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user