Why is Enumerator.MoveNext not working as I expect it when used with using and async-await?

前端 未结 2 601
走了就别回头了
走了就别回头了 2021-02-05 06:20

I would like to enumerate through a List and call a async method.

If I do this in this way:

public async Task NotWorking() {
           


        
2条回答
  •  广开言路
    2021-02-05 06:56

    Looks like a bug in the old compiler, possibly caused by some interference of code transformations performed in using and async.

    Compiler shipping with VS2015 seems to get this correctly.

提交回复
热议问题