Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Access to instance members in async postconditions lead to invalid IL #365

@SergeyTeplyakov

Description

@SergeyTeplyakov

Consider following example:

class State
{
    private int _state;
    public async Task<int> StartAsync()
    {
        Contract.Ensures(Contract.Result<int>() != 0 && _state == -1);
        await Task.Delay(42);
    }
}

With current implmenetation AsyncClosure doesn't have a _this field that will point to enclosing class, that's why using any instance members in async postconditions lead to invalid IL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions