mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Merge pull request #99206 from a-johnston/fix_double_diagnostic
Remove duplicate read/write-only property warning from ScriptPropertiesGenerator
This commit is contained in:
commit
1889d2a264
@ -423,25 +423,10 @@ namespace Godot.SourceGenerators
|
|||||||
|
|
||||||
if (exportAttr != null && propertySymbol != null)
|
if (exportAttr != null && propertySymbol != null)
|
||||||
{
|
{
|
||||||
if (propertySymbol.GetMethod == null)
|
if (propertySymbol.GetMethod == null || propertySymbol.SetMethod == null || propertySymbol.SetMethod.IsInitOnly)
|
||||||
{
|
{
|
||||||
// This should never happen, as we filtered WriteOnly properties, but just in case.
|
// Exports can be neither read-only nor write-only but the diagnostic errors for properties are already
|
||||||
context.ReportDiagnostic(Diagnostic.Create(
|
// reported by ScriptPropertyDefValGenerator.cs so just quit early here.
|
||||||
Common.ExportedPropertyIsWriteOnlyRule,
|
|
||||||
propertySymbol.Locations.FirstLocationWithSourceTreeOrDefault(),
|
|
||||||
propertySymbol.ToDisplayString()
|
|
||||||
));
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (propertySymbol.SetMethod == null || propertySymbol.SetMethod.IsInitOnly)
|
|
||||||
{
|
|
||||||
// This should never happen, as we filtered ReadOnly properties, but just in case.
|
|
||||||
context.ReportDiagnostic(Diagnostic.Create(
|
|
||||||
Common.ExportedMemberIsReadOnlyRule,
|
|
||||||
propertySymbol.Locations.FirstLocationWithSourceTreeOrDefault(),
|
|
||||||
propertySymbol.ToDisplayString()
|
|
||||||
));
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user