You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot use ConfigurationBinder source generator with a type that has a string ctor parameter with default value #93159
When binding to a type with a constructor that has a default string parameter, the generator emits code that doesn't compile.
C:\scratch\configStringCtorParam\Microsoft.Extensions.Configuration.Binder.SourceGeneration\Microsoft.Extensions.Config
uration.Binder.SourceGeneration.ConfigurationBindingGenerator\BindingExtensions.g.cs(77,27): error CS0103: The name 's'
does not exist in the current context [C:\scratch\configStringCtorParam\configStringCtorParam.csproj]
Bug is likely in the EmitBindImplForMember method but I haven't tracked it down. I suspect there's a disagreement between the case where the member is string parseable but also has a default value. This same repro works when removing the default value.
Activity