Skip to content

Add MemberInfo.IsCollectible & Assembly.IsCollectible #24330

@JonHanna

Description

@JonHanna

We may wish to treat a collectible assembly or member info differently to a non-collectible. Most obviously, we might want to avoid caching a collectible type or method for a long time and preventing that possible collection. (Type has an IsCollectible method, but it is not exposed.)

Proposed API:

namespace System.Reflection
{
    public abstract class Assembly
    {
        public virtual bool IsCollectible { get; }
    }

    public abstract class MemberInfo
    {
        public virtual bool IsCollectible { get; }
    }
}

Note that collectibility of assemblies is not the only factor on collectibility of member infos. TypeBuilder is derived from Type and instances are always collectible.

TypeDelegator is itself collectible, but it should report on its delegatee.

Editted to include all of MemberInfo and also Assembly.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions