✅ How do async methods handle references
You can't manually declare references (out and ref arguments) in async methods because of how async works (method returns before any work is done).
It got me questioning the logic of it, because as far as i know, most of the argument passing in c# uses references, and by default passing an instance of a class uses a reference (except for records)
Are all arguments in async methods treated as records and copied into a separate instance to later be used? Or it only affects the manual declaration of pointers? Why?
It got me questioning the logic of it, because as far as i know, most of the argument passing in c# uses references, and by default passing an instance of a class uses a reference (except for records)
Are all arguments in async methods treated as records and copied into a separate instance to later be used? Or it only affects the manual declaration of pointers? Why?
