We currently scan all references for interfaces with DynamicInterfaceCastableImplementationAttribute, and keep any that implement marked interfaces. This attribute was designed to make the IDynamicCastableInterface feature linker-friendly, by explicitly annotating types that can serve as interface implementations for dynamic casts.
Depending on the expected behavior of GetInterfaceImplementation, we may be able to avoid this scan. There are already cases where we would not mark the attributed implementation (when GetInterfaceImplementation does non-analyzable reflection to get the implementing type's assembly, and that assembly isn't statically referenced).
However, we currently still scan referenced assemblies and keep such types (even if they are only used by non-analyzable reflection). Would it be safe to remove the attributed interfaces in this case? The linker already issues a warning for this.
We currently scan all references for interfaces with
DynamicInterfaceCastableImplementationAttribute, and keep any that implement marked interfaces. This attribute was designed to make theIDynamicCastableInterfacefeature linker-friendly, by explicitly annotating types that can serve as interface implementations for dynamic casts.Depending on the expected behavior of
GetInterfaceImplementation, we may be able to avoid this scan. There are already cases where we would not mark the attributed implementation (whenGetInterfaceImplementationdoes non-analyzable reflection to get the implementing type's assembly, and that assembly isn't statically referenced).However, we currently still scan referenced assemblies and keep such types (even if they are only used by non-analyzable reflection). Would it be safe to remove the attributed interfaces in this case? The linker already issues a warning for this.