mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 10:22:15 +00:00
18 lines
421 B
Nim
18 lines
421 B
Nim
discard """
|
|
errormsg: "invalid type: 'SomeRefObj' in this context: 'seq[SomeRefObj]' for const"
|
|
line: 14
|
|
"""
|
|
|
|
# bug #5870
|
|
type SomeRefObj = ref object of RootObj
|
|
someIntMember: int
|
|
|
|
proc createSomeRefObj(v: int): SomeRefObj=
|
|
result.new()
|
|
result.someIntMember = v
|
|
|
|
const compileTimeSeqOfRefObjs = @[createSomeRefObj(100500), createSomeRefObj(2)]
|
|
|
|
for i in 0..1:
|
|
echo compileTimeSeqOfRefObjs[i].someIntMember
|