diff options
| author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-03-14 13:57:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 13:57:36 +0100 |
| commit | 258ea41ffa00a71bbb6ba9844840f18ba5802816 (patch) | |
| tree | b615e78de7fff785e8d5e191b4401da99f44367d /modules/mono/csharp_script.cpp | |
| parent | 30e81fcc26ee4e9394abe2504c6dd613b06a85db (diff) | |
| parent | 84e9a79ace17094a3d0f7cde5af2f35ce2c8986f (diff) | |
Merge pull request #74884 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 2nd batch
Diffstat (limited to 'modules/mono/csharp_script.cpp')
| -rw-r--r-- | modules/mono/csharp_script.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index aad8ab9a57..1dbf6b3471 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -57,6 +57,7 @@ #include "godotsharp_dirs.h" #include "managed_callable.h" #include "mono_gd/gd_mono_cache.h" +#include "servers/text_server.h" #include "signal_awaiter_utils.h" #include "utils/macros.h" #include "utils/naming_utils.h" @@ -366,6 +367,10 @@ String CSharpLanguage::validate_path(const String &p_path) const { if (keywords.find(class_name)) { return RTR("Class name can't be a reserved keyword"); } + if (!TS->is_valid_identifier(class_name)) { + return RTR("Class name must be a valid identifier"); + } + return ""; } |