compiler-services

Why cant we use IteratorStateMachineAttribute in C#?

不打扰是莪最后的温柔 提交于 2020-02-02 06:05:31
问题 I did a Go To Definition ( F12 ) on a class I was trying to derive from and I noticed that one of the methods was marked with AsyncStateMachineAttribute . Which in turn inherits StateMachineAttribute . I was curious and decide to read up on this attribute and all its derivates on MSDN. That led me to this and I came across this statement: You can't use IteratorStateMachineAttribute to test whether a method is an iterator method in C#. Because that statement is made to stand out, there must be