mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
Add test for issue #1946
This commit is contained in:
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()
|
||||
Reference in New Issue
Block a user