out of memory error from `test=` type proc call when parameter is a call to a table's `[]` proc #5079

Closed
Athaudia opened this Issue Nov 30, 2016 · 0 comments

Projects

None yet

1 participant

@Athaudia
import tables, strutils

type Test = ref object
  s: string

proc `test=`(t: Test, s: string) =
  t.s = s

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
@Araq Araq added a commit that closed this issue Nov 30, 2016
@Araq Araq fixes #5079 7b44896
@Araq Araq closed this in 7b44896 Nov 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment