From 32056803d45212d0fffb1c507c568cd6e924bd2f Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Mon, 17 Jul 2023 17:07:35 +0200 Subject: [PATCH] Containers - Fixed `clone(Container)` implementation for `Struct` whereby it would not parent the newly created copy --- source/tlang/compiler/symbols/containers.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/tlang/compiler/symbols/containers.d b/source/tlang/compiler/symbols/containers.d index a591e9a..3b9463e 100644 --- a/source/tlang/compiler/symbols/containers.d +++ b/source/tlang/compiler/symbols/containers.d @@ -283,6 +283,9 @@ public class Struct : Type, Container, MCloneable clonedStruct.addStatement(clonedStmt); } + // Parent ourselves to the given parent + clonedStruct.parentTo(newParent); + return clonedStruct; } }