fixes #5079
This commit is contained in:
parent
20cf28adde
commit
7b44896e03
2 changed files with 27 additions and 1 deletions
25
tests/ccgbugs/tmissingderef2.nim
Normal file
25
tests/ccgbugs/tmissingderef2.nim
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
discard """
|
||||
output: "c"
|
||||
"""
|
||||
|
||||
# bug #5079
|
||||
|
||||
import tables, strutils
|
||||
|
||||
type Test = ref object
|
||||
s: string
|
||||
|
||||
proc `test=`(t: Test, s: string) =
|
||||
t.s = s
|
||||
|
||||
var t = Test()
|
||||
|
||||
#t.test = spaces(2) # -- works
|
||||
|
||||
var a = newTable[string, string]()
|
||||
a["b"] = "c"
|
||||
|
||||
#t.s = a["b"] # -- works
|
||||
#t.test a["b"] # -- works
|
||||
t.test = a["b"] # -- prints "out of memory" and quits
|
||||
echo t.s
|
||||
Loading…
Add table
Add a link
Reference in a new issue