diff --git a/compiler/transf.nim b/compiler/transf.nim index 7fe6c63b9ebd..c712561e84eb 100644 --- a/compiler/transf.nim +++ b/compiler/transf.nim @@ -508,7 +508,7 @@ proc transformAddrDeref(c: PTransf, n: PNode, kinds: TNodeKinds, isAddr = false) n.typ.kind == tyVar and n.typ.skipTypes(abstractVar).kind == tyOpenArray and n[0][0].typ.skipTypes(abstractVar).kind == tyString) and - not (n.typ.kind == tyVar and n[0][0].typ.kind == tyRef) + not (isAddr and n.typ.kind == tyVar and n[0][0].typ.kind == tyRef) : # elimination is harmful to `for tuple unpack` because of newTupleAccess # it is also harmful to openArrayLoc (var openArray) for strings # addr ( deref ( x )) --> x