buunguyen / fasterflect

.NET Reflection Made Fast and Simple ⛺
https://www.nuget.org/packages/fasterflect/
Apache License 2.0
283 stars 55 forks source link

DeepClone cloning static fields #15

Open justinharrell opened 4 years ago

justinharrell commented 4 years ago

We ran into an issue where the DeepClone it seems to be cloning static fields, is this intentional? I can't see why you would ever clone a static field as all instances will be updated.

Issue seems to be here: https://github.com/buunguyen/fasterflect/blob/41be82cfac041d7fc562c6e9be5afb8eb1e0a71a/Fasterflect/Fasterflect/Extensions/Services/CloneExtensions.cs#L65

Seems like Flags.StaticInstanceAnyVisibility should be Flags.InstanceAnyVisibility instead.