Skip to content

Annotations for cases the analyzer can't figure out. #126

Open
@JohanLarsson

Description

public interface IWithAnnotations
{
    [return: MustDispose]
    IDisposable Create();

    bool TryCreate([MustDispose]out IDisposable disposable);

    [return: DoNotDispose]
    IDisposable GetOrCreate();

    bool TryGet([DoNotDispose]out IDisposable disposable);

    void Add([TransferOwnership] IDisposable disposable);
}

Not sure what attributes are needed and how we should word things. Also should probably not require a dependency on a nuget with attributes. Does JetBrains.Annotations have something for this?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions