From ff43b5c553b88d7a788464809b1b791f3dfe7d18 Mon Sep 17 00:00:00 2001 From: Lawrence Niu Date: Mon, 24 Jul 2023 15:31:46 -0400 Subject: [PATCH] Add extra generated checks for attributes If the attribute is dependent on another property, then the dependent object should be treated as empty if the object is a link. --- +file/fillExport.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/+file/fillExport.m b/+file/fillExport.m index 1fb5a1c2..a287e129 100644 --- a/+file/fillExport.m +++ b/+file/fillExport.m @@ -231,7 +231,10 @@ flattened = strrep(elisions(1:flattened(end)), '/', '_'); depPropname = [flattened prop.dependent]; end - propertyChecks{end+1} = ['~isempty(obj.' depPropname ')']; + propertyReference = sprintf('obj.%s', depPropname); + propertyChecks{end+1} = sprintf(['~isempty(%1$s) ' ... + '&& ~isa(%1$s, ''types.untyped.SoftLink'') ' ... + '&& ~isa(%1$s, ''types.untyped.ExternalLink'')'], propertyReference); end if ~prop.required