fix Issue 12186 - Problems with partially inferred type for immutable lambda argument