overloading of [] for derefence operation should be possible now
This commit is contained in:
parent
e5eb36e472
commit
958961bd8d
3 changed files with 31 additions and 5 deletions
24
tests/accept/run/tgenericassign.nim
Normal file
24
tests/accept/run/tgenericassign.nim
Normal 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"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue