Ошибка в операции с датой#1692
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFixes date addition in DynamicOperations.Add to add numeric values to BslDateValue correctly and refactors DynamicOperations.Subtract to simplify date-vs-date and date-vs-numeric subtraction paths, with a numeric fallback. ChangesDate operations changes
Sequence Diagram(s)(see hidden review stack artifact for sequence diagrams visualizing Add and Subtract flows) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| var foundType = manager.GetTypeByName(name); | ||
| return new BslTypeValue(foundType); | ||
| } | ||
| => new(manager.GetTypeByName(name)); |
There was a problem hiding this comment.
Разобрался, это новый синтаксис конструктора new, просто в возвращаемом значении я к нему не привык, обычно они встречаются в инициализации полей..
There was a problem hiding this comment.
- убираем временную переменную
- var foundType = manager.GetTypeByName(name);
- return new BslTypeValue(foundType);
+ return new BslTypeValue(manager.GetTypeByName(name));
- меняем body на lambda
- {
- return new BslTypeValue(manager.GetTypeByName(name));
- }
+ => new BslTypeValue(manager.GetTypeByName(name));
- используем автовывод типа (C#9)
- => new BslTypeValue(manager.GetTypeByName(name));
+ => new(manager.GetTypeByName(name));
Summary by CodeRabbit
Bug Fixes
Refactor