Problem resolving mixed generic/non-generic overload taking a closure as an argument
Closed this issue · 1 comments
masonwheeler commented
x as int
System.Threading.Tasks.Task.Factory.StartNew({ x = 42 })
Expected: This should compile.
Observed: Overload resolution fails for argument of type error
.
This appears to be happening because ProcessMethodBodies.OnBlockExpression
defers processing of closures being passed to an overloaded method in which any of the overloads are generic methods, so that generic type references can be inferred properly later on. But in this case, there are no generic type references; we're trying to reach the non-generic overload that takes a single argument of type Action
, and there is no code in the compiler that handles deferred processing in that case.
masonwheeler commented
Fixed this as part of the async/await merge.