-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #1419: проверка типов перечислений при передаче параметров и присваивании #1421
Conversation
WalkthroughThe latest changes introduce a range of updates focusing on enhancing error handling, type conversion, and logic in various components. Key changes include a new constructor for Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- src/OneScript.Core/Exceptions/TypeConversionException.cs (1 hunks)
- src/OneScript.StandardLibrary/Text/ConsoleContext.cs (5 hunks)
- src/ScriptEngine/Machine/Contexts/ContextValuesMarshaller.cs (1 hunks)
Additional comments not posted (2)
src/OneScript.StandardLibrary/Text/ConsoleContext.cs (1)
43-43
: Improved cursor positioning logic.The modification ensures that the cursor position does not exceed the console's window width. This is a good preventive measure against runtime errors.
src/ScriptEngine/Machine/Contexts/ContextValuesMarshaller.cs (1)
135-145
: Enhanced type safety in type conversion.The added checks ensure that the type of the underlying object matches the expected type before casting, which is crucial for preventing runtime type errors. This is a solid enhancement for robustness.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/OneScript.Core/Exceptions/TypeConversionException.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/OneScript.Core/Exceptions/TypeConversionException.cs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/OneScript.StandardLibrary/Text/ConsoleContext.cs (6 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/OneScript.StandardLibrary/Text/ConsoleContext.cs
В Консоли |
Согласен. На что именно? |
Что-то вроде такого [EnumerationType(ЦветКонсоли", "ConsoleColor")]
public enum ConsoleColorEnum
{
[EnumValue("Черный", "Black")]
Black = System.ConsoleColor.Black,
[EnumValue("ТемноСиний", "DarkBlue")]
DarkBlue = ConsoleColor.DarkBlue,
// ...
}
public static IValue ToBSLValue(this System.ConsoleColor color)
{
// ...
} И подобное для других перечислений. |
@EvilBeaver for review: |
Добрый день!
В период с 24.06.2024 по 07.07.2024 включительно, буду находиться в ежегодном отпуске.
Почта просматриваться не будет.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/ScriptEngine/Machine/Contexts/ContextValuesMarshaller.cs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/ScriptEngine/Machine/Contexts/ContextValuesMarshaller.cs
Заявленная ошибка исправлена, предлагаю влить в v2. Переделка перечислений, и чтоб ничего не сломалось - долгая процедура. Сейчас в движке есть минимум пять вариантов работы с ними. Да и особенности C# накладываются. |
Summary by CodeRabbit
New Features
TypeConversionException
constructor.Bug Fixes
Improvements