@@ -82,10 +82,11 @@ internal readonly record struct MemberModel(
8282 // Property accessor capabilities
8383 bool HasGetter , // Whether the property has a getter
8484 bool HasSetter , // Whether the property has a setter (regular, not init-only)
85- bool SetterIsAccessible // Whether the setter is publicly accessible (not private/protected)
85+ bool SetterIsAccessible , // Whether the setter is publicly accessible (not private/protected)
86+ bool IsShallowClone // Whether the member should be shallow cloned (has [FastClonerShallow] attribute)
8687) : IEquatable < MemberModel >
8788{
88- public static MemberModel Create ( IPropertySymbol property , bool nullabilityEnabled , Compilation compilation )
89+ public static MemberModel Create ( IPropertySymbol property , bool nullabilityEnabled , Compilation compilation , bool isShallowClone = false )
8990 {
9091 ( MemberTypeKind typeKind , string ? elementName , string ? keyName , string ? valueName , bool elementSafe , bool elementClonable , bool keySafe , bool keyClonable , bool valSafe , bool valClonable , bool requiresFastCloner , CollectionKind collectionKind , string ? concreteType , int arrayRank )
9192 = AnalyzeType ( property . Type , compilation ) ;
@@ -130,10 +131,11 @@ public static MemberModel Create(IPropertySymbol property, bool nullabilityEnabl
130131 isNullable ,
131132 hasGetter ,
132133 hasSetter ,
133- setterIsAccessible ) ;
134+ setterIsAccessible ,
135+ isShallowClone ) ;
134136 }
135137
136- public static MemberModel Create ( IFieldSymbol field , bool nullabilityEnabled , Compilation compilation )
138+ public static MemberModel Create ( IFieldSymbol field , bool nullabilityEnabled , Compilation compilation , bool isShallowClone = false )
137139 {
138140 ( MemberTypeKind typeKind , string ? elementName , string ? keyName , string ? valueName , bool elementSafe , bool elementClonable , bool keySafe , bool keyClonable , bool valSafe , bool valClonable , bool requiresFastCloner , CollectionKind collectionKind , string ? concreteType , int arrayRank )
139141 = AnalyzeType ( field . Type , compilation ) ;
@@ -172,7 +174,8 @@ public static MemberModel Create(IFieldSymbol field, bool nullabilityEnabled, Co
172174 isNullable ,
173175 hasGetter ,
174176 hasSetter ,
175- setterIsAccessible ) ;
177+ setterIsAccessible ,
178+ isShallowClone ) ;
176179 }
177180
178181 private static ( MemberTypeKind kind , string ? elem , string ? key , string ? val , bool elemSafe , bool elemClon , bool keySafe , bool keyClon , bool valSafe , bool valClon , bool requiresFastCloner , CollectionKind collKind , string ? concreteType , int arrayRank )
0 commit comments