diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-08-28 18:16:57 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-08-28 18:16:57 +0200 |
commit | 761e2b1a65d40ffc8f8b6912e44c4fcfdb164b6f (patch) | |
tree | f509d0c52b0c50ea7ab820d6c81d4ffa68cf222c /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs | |
parent | f38ea254f334ffa02fb501b336b1a60374c7f945 (diff) | |
download | redot-engine-761e2b1a65d40ffc8f8b6912e44c4fcfdb164b6f.tar.gz |
C#: Ignore property indexers and report if exported
Ignore property indexers since they are unsupported and report a
diagnostic if an user tries to export it.
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs index 85fadaa52e..c7745391d0 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertyDefValGenerator.cs @@ -134,6 +134,12 @@ namespace Godot.SourceGenerators continue; } + if (property.IsIndexer) + { + Common.ReportExportedMemberIsIndexer(context, property); + continue; + } + // 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 or without a setter. Godot properties must be both readable and writable. if (property.IsWriteOnly) @@ -148,7 +154,6 @@ namespace Godot.SourceGenerators continue; } - var propertyType = property.Type; var marshalType = MarshalUtils.ConvertManagedTypeToMarshalType(propertyType, typeCache); |