Open kortschak opened 7 years ago
Fix for the slice case at kortschak/utter#7.
Nice find! I'll take at a look at the proposed fix and get this updated accordingly.
Fixing this should also fix #44.
Note that it doesn't fix the type t map[T]t
case. I need to spend some more time thinking on that one.
I suspect that interface pointers in general will need to be saved since it could really happen with any compound data structure that contains an interface due to them really just being a reference.
It can only happen with pointer or pointer-like types. So for example, you do not get the effect with type T struct { F interface{} }; v := T{}; v.F = v
. So this means it's just limited to maps, slices and pointers. I have a partial fix for maps, but it need mores work.
Here is a fix for maps https://github.com/kortschak/utter/pull/8.
Reproducer:
See kortschak/utter#5