dotnet/roslyn

Debugger stepping out of async ValueTask method simply continues execution of program

オープン

#36,240 opened on 2019/06/07

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)C# (4,257 件のフォーク)batch import
Area-InteractiveBugDeveloper CommunityInteractive-Debugginghelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

VSF_TYPE_MARKDOWN1. Create a .NET (Core) console application with the code below.

  1. Hit F11 to begin stepping into the program.
  2. Continue pressing F11 till the program exits.

Expected Each statement and closing curly brace is stepped to.

Actual At the exiting curly brace of the async ValueTask method, Step Into simply Runs the rest of the program instead of stepping back to the 2 calling methods.

using System;
using System.Threading.Tasks;

namespace StepIntoRepro
{
    class Program
    {
        static void Main(string[] args)
        {
            StepIntoValueTaskMethod(). Wait();
        }

public static async Task StepIntoValueTaskMethod()
        {
            await DoValueTask(false);
        }

private static async ValueTask DoValueTask(bool yield)
        {
            if (!yield)
            {
                return;
            }

await Task.Yield();
        }
    }
}

This issue has been moved from https://developercommunity.visualstudio.com/content/problem/591002/debugger-stepping-out-of-async-valuetask-method-si.html VSTS ticketId: 903574 These are the original issue comments:

Visual Studio Feedback System on 6/3/2019, 02:28 AM (4 days ago): We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

These are the original issue solutions: (no solutions)

コントリビューターガイド