Repository navigation
Add Nullable<T> support to command parameter parser selection - #575
Conversation
Agent-Logs-Url: https://github.com/ikkentim/SampSharp/sessions/77a9687c-15e6-4def-9cbc-aa65aad72396 Co-authored-by: ikkentim <[email protected]>
Agent-Logs-Url: https://github.com/ikkentim/SampSharp/sessions/77a9687c-15e6-4def-9cbc-aa65aad72396 Co-authored-by: ikkentim <[email protected]>
|
@copilot it now returns a |
Agent-Logs-Url: https://github.com/ikkentim/SampSharp/sessions/c55ab535-d386-4d03-93a2-f986e6f8a7d5 Co-authored-by: ikkentim <[email protected]>
Agent-Logs-Url: https://github.com/ikkentim/SampSharp/sessions/c55ab535-d386-4d03-93a2-f986e6f8a7d5 Co-authored-by: ikkentim <[email protected]>
Yes—this works correctly. A boxed |
.NET libraries test results535 tests 535 ✅ 13s ⏱️ Results for commit 8a65288. |
The command parser factory did not recognize nullable value-type parameters (e.g.
int?,float?), which blocked optional nullable command arguments. This change makes parser resolution nullable-aware by reusing existing parsers for the underlying type.Parser factory: nullable-aware type resolution
DefaultCommandParameterParserFactoryto unwrapNullable<T>before parser lookup.int?→IntParserfloat?→FloatParserdouble?→DoubleParserbool?→BooleanParserEnum?→EnumParserTest coverage: nullable mapping cases
DefaultCommandParameterParserFactoryTestswith focused cases for:int?,float?,double?,bool?DayOfWeek?)Integration-style execution coverage
PlayerCommandServiceTestscases to validate end-to-end behavior from input string through dispatch and execution for:/money 123→ method receivesint?value123/money→ method receives defaultnullintfrom parsing works correctly when invoking command methods with nullable parameters.Example usage now supported: