summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs
diff options
context:
space:
mode:
authorWilliam Scalf <wscalf@gmail.com>2023-08-13 18:35:10 -0400
committerWilliam Scalf <wscalf@gmail.com>2023-08-13 18:35:10 -0400
commit41cf94e8b61ee81fc0e682f2ee4ea2c6df893d37 (patch)
treedf51a5d8f0f871b6d765c29f439cbde572ac2d9b /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs
parent7ba79d68bd0f97797d7cb37452da6a036ba7c7c9 (diff)
downloadredot-engine-41cf94e8b61ee81fc0e682f2ee4ea2c6df893d37.tar.gz
Allow readonly and writeonly C# properties to be accessed from GDScript
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs')
-rw-r--r--modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs9
1 files changed, 0 insertions, 9 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs
index b6ea4b8e88..5866db5144 100644
--- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs
+++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs
@@ -303,11 +303,6 @@ namespace Godot.SourceGenerators
{
foreach (var property in properties)
{
- // TODO: We should still restore read-only properties after reloading assembly. Two possible ways: reflection or turn RestoreGodotObjectData into a constructor overload.
- // Ignore properties without a getter, without a setter or with an init-only setter. Godot properties must be both readable and writable.
- if (property.IsWriteOnly || property.IsReadOnly || property.SetMethod!.IsInitOnly)
- continue;
-
var marshalType = MarshalUtils.ConvertManagedTypeToMarshalType(property.Type, typeCache);
if (marshalType == null)
@@ -325,10 +320,6 @@ namespace Godot.SourceGenerators
foreach (var field in fields)
{
// TODO: We should still restore read-only fields after reloading assembly. Two possible ways: reflection or turn RestoreGodotObjectData into a constructor overload.
- // Ignore properties without a getter or without a setter. Godot properties must be both readable and writable.
- if (field.IsReadOnly)
- continue;
-
var marshalType = MarshalUtils.ConvertManagedTypeToMarshalType(field.Type, typeCache);
if (marshalType == null)