-
Couldn't load subscription status.
- Fork 5.2k
Closed
Labels
area-Extensions-Configurationblocking-releasebugsource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature
Milestone
Description
The built-in Bind method annotates the object as nullable:
public static void Bind(this IConfiguration configuration, object? instance)and then explicitly nops if it's null:
if (instance != null)
{
...
}In contrast, the code generated by the generator annotates it as non-nullable and throws an exception if it's null, changing the semantics when using the source generator.
if (obj is null)
{
throw new ArgumentNullException(nameof(obj));
}(It also names the parameter obj instead of instance.)
Metadata
Metadata
Assignees
Labels
area-Extensions-Configurationblocking-releasebugsource-generatorIndicates an issue with a source generator featureIndicates an issue with a source generator feature