Skip to content

chore: Enable nullable annotations on BenchmarkDotNet project#3003

Open
filzrev wants to merge 9 commits intodotnet:masterfrom
filzrev:chore-enable-nullable-9
Open

chore: Enable nullable annotations on BenchmarkDotNet project#3003
filzrev wants to merge 9 commits intodotnet:masterfrom
filzrev:chore-enable-nullable-9

Conversation

@filzrev
Copy link
Contributor

@filzrev filzrev commented Feb 12, 2026

This PR fix a part of issue #2815

By enabling #nullable enable and fix nullable errors.

@filzrev filzrev force-pushed the chore-enable-nullable-9 branch 2 times, most recently from 3bc5d24 to b1e57f6 Compare February 12, 2026 10:02
public static string EnsureNotNull(this string? value)
{
return value ?? "";
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helper method is used for [PublicAPI] related parameter.
When caller is not nullable aware. string type parameter can be null.

RepresentativeBenchmarkCase = default!;
Benchmarks = [];
ProgramName = default!;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties are not expected to be accessed when using BuildPartition.Empty

@filzrev filzrev marked this pull request as draft February 12, 2026 12:13
string tfm,
string customDotNetCliPath = "",
string extraArguments = "",
IReadOnlyList<EnvironmentVariable>? environmentVariables = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can also remove nullable for collection.
It'll be modified on another PR.

@filzrev filzrev force-pushed the chore-enable-nullable-9 branch from f622096 to 3f45451 Compare February 15, 2026 09:02
@filzrev filzrev marked this pull request as ready for review February 15, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant