overloading of [] for derefence operation should be possible now

This commit is contained in:
Araq 2011-06-05 13:59:41 +02:00
commit 958961bd8d
3 changed files with 31 additions and 5 deletions

View file

@ -0,0 +1,24 @@
discard """
output: '''came here'''
"""
type
TAny* = object {.pure.}
value*: pointer
rawType: pointer
proc newAny(value, rawType: pointer): TAny =
result.value = value
result.rawType = rawType
var name: cstring = "example"
var ret: seq[tuple[name: string, a: TAny]] = @[]
for i in 0..8000:
var tup = ($name, newAny(nil, nil))
assert(tup[0] == "example")
ret.add(tup)
assert(ret[ret.len()-1][0] == "example")
echo "came here"