mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 13:07:48 +00:00
fixes #794 properly
This commit is contained in:
@@ -399,7 +399,7 @@ proc transformConv(c: PTransf, n: PNode): PTransNode =
|
||||
if diff < 0:
|
||||
result = newTransNode(nkObjUpConv, n, 1)
|
||||
result[0] = transform(c, n.sons[1])
|
||||
elif diff > 0:
|
||||
elif diff > 0 and diff != high(int):
|
||||
result = newTransNode(nkObjDownConv, n, 1)
|
||||
result[0] = transform(c, n.sons[1])
|
||||
else:
|
||||
@@ -411,7 +411,7 @@ proc transformConv(c: PTransf, n: PNode): PTransNode =
|
||||
if diff < 0:
|
||||
result = newTransNode(nkObjUpConv, n, 1)
|
||||
result[0] = transform(c, n.sons[1])
|
||||
elif diff > 0:
|
||||
elif diff > 0 and diff != high(int):
|
||||
result = newTransNode(nkObjDownConv, n, 1)
|
||||
result[0] = transform(c, n.sons[1])
|
||||
else:
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
discard """
|
||||
disabled: "true"
|
||||
output: '''1
|
||||
1234
|
||||
1234
|
||||
2
|
||||
234
|
||||
234
|
||||
3
|
||||
34
|
||||
34
|
||||
4
|
||||
4
|
||||
4'''
|
||||
"""
|
||||
|
||||
# Now the compiler fails with OOM. yay.
|
||||
|
||||
# bug #794
|
||||
type TRange = range[0..3]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user