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
ReplOptionAttribute.CaseSensitivity is typed ReplCaseSensitivity? (nullable enum). A nullable enum cannot be a named attribute argument in C#, so any attempt to set it fails to compile:
[ReplOption(CaseSensitivity=ReplCaseSensitivity.CaseInsensitive)]string? channel
// error CS0655: 'CaseSensitivity' is not a valid named attribute argument// because it is not a valid attribute parameter type
The property therefore always resolves to null through the attribute path. OptionSchemaBuilder feeds it into every option entry as CaseSensitivity: optionAttribute?.CaseSensitivity, so the per-option case-sensitivity override the property is meant to provide is effectively dead code for options declared via [ReplOption].
(The OptionSchemaEntry.CaseSensitivity field itself works — it is exercised by direct-schema tests and by value-alias / enum-flag configuration, which carry their own CaseSensitivity. Only the option-level override via the attribute is unreachable.)
Impact
Users cannot make a single option case-insensitive (or case-sensitive) independently of the global ParsingOptions.OptionCaseSensitivity.
Replace the nullable enum with two bool flags (e.g. CaseInsensitive / and rely on absence for "inherit"), or a non-nullable enum with an explicit Inherit member (ReplCaseSensitivity would need such a member, or a dedicated ReplOptionCaseSensitivity { Inherit, CaseSensitive, CaseInsensitive }).
Expose the override through a fluent builder API instead of (or in addition to) the attribute.
Remove it. If per-option case override is not a supported feature, drop the property and the optionAttribute?.CaseSensitivity plumbing so the API does not advertise a knob that cannot be used.
Either way, add a test that actually sets the override and asserts a differently-cased token resolves (or does not) accordingly — today no test can exercise the attribute path.
Context
src/Repl.Core/Parameters/Attributes/ReplOptionAttribute.cs — the property.
Summary
ReplOptionAttribute.CaseSensitivityis typedReplCaseSensitivity?(nullable enum). A nullable enum cannot be a named attribute argument in C#, so any attempt to set it fails to compile:The property therefore always resolves to
nullthrough the attribute path.OptionSchemaBuilderfeeds it into every option entry asCaseSensitivity: optionAttribute?.CaseSensitivity, so the per-option case-sensitivity override the property is meant to provide is effectively dead code for options declared via[ReplOption].(The
OptionSchemaEntry.CaseSensitivityfield itself works — it is exercised by direct-schema tests and by value-alias / enum-flag configuration, which carry their ownCaseSensitivity. Only the option-level override via the attribute is unreachable.)Impact
ParsingOptions.OptionCaseSensitivity.--Fooand a--foo) is not reachable precisely because this override cannot be set.Options
boolflags (e.g.CaseInsensitive/ and rely on absence for "inherit"), or a non-nullable enum with an explicitInheritmember (ReplCaseSensitivitywould need such a member, or a dedicatedReplOptionCaseSensitivity { Inherit, CaseSensitive, CaseInsensitive }).optionAttribute?.CaseSensitivityplumbing so the API does not advertise a knob that cannot be used.Either way, add a test that actually sets the override and asserts a differently-cased token resolves (or does not) accordingly — today no test can exercise the attribute path.
Context
src/Repl.Core/Parameters/Attributes/ReplOptionAttribute.cs— the property.src/Repl.Core/Internal/Options/OptionSchemaBuilder.cs— consumesoptionAttribute?.CaseSensitivity(multiple sites).