Open ChloePlanet opened 4 years ago
Related pr #447.
If a new name is used, it works fine, even through the pattern matching machinery:
@> let (a: g, b: x) = (a: {://grammar.lang.wbnf.grammar: expr -> @:[-+] > @:[/*] > \d+; :}, b: 42); > let (:h) = (h: g); > {:h.expr:1+2*3:} ('': [107\'+'], @rule: 'expr', expr: [(expr: [('': 106\'1')]), ('': [109\'*'], expr: [('': 108\'2'), ('': 110\'3')])])
But it affects scenarios where a name is re-bound to a new value:
@> let (a: g, b: x) = (a: {://grammar.lang.wbnf.grammar: expr -> @:[-+] > @:[/*] > \d+; :}, b: 42); > let g = g; > {:g.expr:1+2*3:}
Expected behavior: output
('': [107\'+'], @rule: 'expr', expr: [(expr: [('': 106\'1')]), ('': [109\'*'], expr: [('': 108\'2'), ('': 110\'3')])])
Actual behavior: runtime: goroutine stack exceeds 1000000000-byte limit fatal error: stack overflow
runtime: goroutine stack exceeds 1000000000-byte limit fatal error: stack overflow
runtime stack: runtime.throw(0x182c051, 0xe) /Users/zhangx19/.gvm/gos/go1.13/src/runtime/panic.go:774 +0x72 runtime.newstack() /Users/zhangx19/.gvm/gos/go1.13/src/runtime/stack.go:1046 +0x6e9 runtime.morestack() /Users/zhangx19/.gvm/gos/go1.13/src/runtime/asm_amd64.s:449 +0x8f
goroutine 1 [running]: runtime.assertE2I2(0x1751c60, 0x16ffee0, 0xc0003e3bc0, 0x0, 0x0, 0x0) /Users/zhangx19/.gvm/gos/go1.13/src/runtime/iface.go:482 +0x9e fp=0xc02089a328 sp=0xc02089a320 pc=0x100c20e github.com/arr-ai/hash.Interface(0x16ffee0, 0xc0003e3bc0, 0x0, 0x231a038) /Users/zhangx19/Code/go/pkg/mod/github.com/arr-ai/hash@v0.5.0/hash.go:12 +0x14a fp=0xc02089a3e8 sp=0xc02089a328 pc=0x11da04a github.com/arr-ai/frozen.KeyValue.Hash(...) /Users/zhangx19/Code/go/pkg/mod/github.com/arr-ai/frozen@v0.14.0/map.go:21 github.com/arr-ai/frozen.(*KeyValue).Hash(0xc00044b500, 0x0, 0xc00044b500)
Description
Related pr #447.
If a new name is used, it works fine, even through the pattern matching machinery:
But it affects scenarios where a name is re-bound to a new value:
Expected behavior: output
Actual behavior: runtime: goroutine stack exceeds 1000000000-byte limit fatal error: stack overflow
runtime stack: runtime.throw(0x182c051, 0xe) /Users/zhangx19/.gvm/gos/go1.13/src/runtime/panic.go:774 +0x72 runtime.newstack() /Users/zhangx19/.gvm/gos/go1.13/src/runtime/stack.go:1046 +0x6e9 runtime.morestack() /Users/zhangx19/.gvm/gos/go1.13/src/runtime/asm_amd64.s:449 +0x8f
goroutine 1 [running]: runtime.assertE2I2(0x1751c60, 0x16ffee0, 0xc0003e3bc0, 0x0, 0x0, 0x0) /Users/zhangx19/.gvm/gos/go1.13/src/runtime/iface.go:482 +0x9e fp=0xc02089a328 sp=0xc02089a320 pc=0x100c20e github.com/arr-ai/hash.Interface(0x16ffee0, 0xc0003e3bc0, 0x0, 0x231a038) /Users/zhangx19/Code/go/pkg/mod/github.com/arr-ai/hash@v0.5.0/hash.go:12 +0x14a fp=0xc02089a3e8 sp=0xc02089a328 pc=0x11da04a github.com/arr-ai/frozen.KeyValue.Hash(...) /Users/zhangx19/Code/go/pkg/mod/github.com/arr-ai/frozen@v0.14.0/map.go:21 github.com/arr-ai/frozen.(*KeyValue).Hash(0xc00044b500, 0x0, 0xc00044b500)