Fix issue with incomplete property overrides in C# sourcegen

This commit is contained in:
Paul Joannon
2024-10-21 23:02:25 +02:00
committed by Raul Santos
parent fa6cad230f
commit 4bb041de8b
15 changed files with 264 additions and 9 deletions
@@ -123,10 +123,12 @@ namespace Godot.SourceGenerators
// 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.
var godotClassProperties = propertySymbols.Where(property => !(property.IsReadOnly || property.IsWriteOnly || property.SetMethod!.IsInitOnly))
var godotClassProperties = propertySymbols
.Where(property => !(property.IsReadOnly || property.IsWriteOnly) && property.SetMethodOrBaseSetMethod() is { IsInitOnly: false })
.WhereIsGodotCompatibleType(typeCache)
.ToArray();
var godotClassFields = fieldSymbols.Where(property => !property.IsReadOnly)
var godotClassFields = fieldSymbols
.Where(property => !property.IsReadOnly)
.WhereIsGodotCompatibleType(typeCache)
.ToArray();