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.
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 typeAction
, and there is no code in the compiler that handles deferred processing in that case.