Closed
Description
For binding List<(string Error, string MemberName)>
, the binding source generator produces code like this:
public static void BindCore(IConfiguration configuration, ref global::System.Collections.Generic.List<(string Error, string MemberName)> instance, bool defaultValueIfNotFound, BinderOptions? binderOptions)
{
foreach (IConfigurationSection section in configuration.GetChildren())
{
if (!string.IsNullOrEmpty(section.Value) && !section.GetChildren().Any())
{
continue;
}
var value = new (string Error, string MemberName)(); // error CS8181
instance.Add(value);
}
}
which produces an error:
error CS8181: 'new' cannot be used with tuple type. Use a tuple literal expression instead.