@@ -180,7 +180,7 @@ moduleToIL (Module _ coms mn _ imps _ foreigns decls) project =
180180 updates <- mapM (sndM valueToIL) ps
181181 obj' <- freshName'
182182 let objVar = AST.Var Nothing obj'
183− copy = AST.VariableIntroduction Nothing obj' (Just $ AST.App Nothing (AST.StringLiteral Nothing (mkString dictType)) [obj])
183+ copy = AST.VariableIntroduction Nothing obj' (Just $ copyDict obj)
184184 assign (k, v) = AST.Assignment Nothing (accessorString k objVar) v
185185 sts = copy : (assign <$> updates) ++ [AST.Return Nothing objVar]
186186 return $ AST.App Nothing (AST.Function Nothing Nothing [] (AST.Block Nothing sts)) []
@@ -359,3 +359,6 @@ emptyAnn = (SourceSpan "" (SourcePos 0 0) (SourcePos 0 0), [], Nothing, Nothing)
359359arrayLength :: AST -> AST
360360arrayLength a = AST.App Nothing (AST.Var Nothing arrayLengthFn) [a]
361361-- arrayLength a = AST.Var Nothing (arrayLengthFn <> "(" <> prettyPrintIL1 a <> ")")
362+
363+copyDict :: AST -> AST
364+copyDict a = AST.App Nothing (AST.Var Nothing copyDictFn) [a]