Currently C# will fail to compile any async block using a type with one than one generic type parameter.
I believe this is so that the type T in SetResult(T result) on AsyncMethodBuilder types has an obvious type parameter.
I propose that this requirement be relaxed, so that AsyncMethodBuilders can have arbitrary type parameters and it's the first of these type parameters that is required in the argument to SetResult. This would allow me to carry extra type information in an async block that doesn't interact with the block itself.
The same issue was raised in #2273 but was framed as a bug rather than a feature request. Supporting multiple type parameters would also allow functionality proposed in issues like #1407 to be more powerful.
Currently C# will fail to compile any
asyncblock using a type with one than one generic type parameter.I believe this is so that the type
TinSetResult(T result)onAsyncMethodBuildertypes has an obvious type parameter.I propose that this requirement be relaxed, so that
AsyncMethodBuilders can have arbitrary type parameters and it's the first of these type parameters that is required in the argument toSetResult. This would allow me to carry extra type information in anasyncblock that doesn't interact with the block itself.The same issue was raised in #2273 but was framed as a bug rather than a feature request. Supporting multiple type parameters would also allow functionality proposed in issues like #1407 to be more powerful.