Add test for issue #1946
This commit is contained in:
parent
c7934be7e8
commit
f25c47db1a
1 changed files with 14 additions and 0 deletions
14
tests/vm/tldconst.nim
Normal file
14
tests/vm/tldconst.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# Passes if it compiles
|
||||
# From issue #1946
|
||||
|
||||
type
|
||||
Part = object
|
||||
index: int ## array index of argument to be accessed
|
||||
|
||||
proc foobar(): int =
|
||||
var x: Part
|
||||
if x.index < high(int):
|
||||
discard
|
||||
0
|
||||
|
||||
const x = foobar()
|
||||
Loading…
Add table
Add a link
Reference in a new issue