Skip to content

Resources disposition not working? #1521

@fabio-rizzello-omnia

Description

@fabio-rizzello-omnia

As I understand this piece of code should call the Dispose method but it doesn't. Am I doing something wrong?

 class Test(ILogger logger) : IDisposable
    {
        public void Dispose()
        {
            logger.LogInformation("Disposing Test");
        }
    }


var workflow = bracketIO(
            from d in use(IO.lift(() => new Test(logger)))
            select d
        );
var result = await workflow.RunSafeAsync());

It doesn't call dispose neither with success or with fail.
I tested this with .net 8 v5.0.0-beta-55 and .net 10 v5.0.0-beta-61

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions