I recently learned that any object with a GetAwaiter
method returning an awaiter can be await
-ed. This is true even if it's an extension method, meaning basically any object can be made await
-able, if you so choose.
But is there a way to tell at runtime if an object is await
-able? Normal reflection won't work, since it doesn't list an object's extension methods.
I don't have a particular need in mind when asking this question, I'm just curious if it's possible.