BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

[Feature Request] Enable nullable type checks

Open filzrev opened this issue 5 months ago • 2 comments

Currently BenchmarkDotNet using <Nullable>annotations</Nullable> setting.

Is there a plan to migrate to use <Nullable>enable</Nullable> in future?

Migration path Currently 828 errors are raised when setting <Nullable>enable</Nullable> on solution-level. Therefore, it might be better to migrate with following steps.

  1. Enable nullable check with #nullable enable setting per-files. and fix build errors.
  2. When entire code is refactored. Migrate to use <Nullable>enable</Nullable>. And remove #nullable enable settings

Background When accessing ExecuteResult::StandardOutput property. It's expected to be non-null value is returned. But it returns null in some cases (When used constructor that don't initialize StandardOutput property)

filzrev avatar Jul 24 '25 03:07 filzrev

Can I work on this? If anyone already started, please share here. I welcome any suggestions you might have.

kapilepatel avatar Oct 01 '25 20:10 kapilepatel

@kapilepatel Sure you can work on it. I'm fine if you want to enable nullable and fix all the errors at once, or do it more piece-meal like @filzrev suggested. Up to you.

timcassell avatar Oct 02 '25 08:10 timcassell