Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnC: Changing signature of an async method or an iterator does not work #69199

Open
tmat opened this issue Jul 25, 2023 · 0 comments
Open

EnC: Changing signature of an async method or an iterator does not work #69199

tmat opened this issue Jul 25, 2023 · 0 comments
Assignees

Comments

@tmat
Copy link
Member

tmat commented Jul 25, 2023

A state machine can be in-progress and emitting new kick-off method does not affect the old MoveNext method. The old method keeps executing but the execution no longer matches the code.

The same issue is with rename, which is only blocked when there is an active statement in the method body but not when the state machine is otherwise in-progress.

using System;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        await F(1);
    }

    static async Task F(byte a)
    {
        Console.WriteLine($"1: {a}");
        await Task.Delay(1);
        Console.WriteLine($"2: {a}");
        await Task.Delay(1);
    }
}

After changing the parameter type to int, inserting some whitespace and stepping:

image

See tests.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 25, 2023
@arkalyanms arkalyanms removed the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants