Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# diagnostics GD0103 and GD0104 are reported twice for properties #99205

Open
a-johnston opened this issue Nov 13, 2024 · 0 comments · May be fixed by #99206
Open

C# diagnostics GD0103 and GD0104 are reported twice for properties #99205

a-johnston opened this issue Nov 13, 2024 · 0 comments · May be fixed by #99206

Comments

@a-johnston
Copy link
Contributor

Tested versions

Introduced by #67304 starting in 4.2

System information

n/a

Issue description

Given the code

[Export] public string Foo { set => foo = value; }

[Export] public string Bar { get; }

the diagnostic errors for read only and write only property exports are raised twice:

Screenshot 2024-11-13 at 1 53 03 PM

due to ScriptPropertiesGenerator.cs previously having relied on WhereIsGodotCompatibleType to filter those cases out. The errors are otherwise raised ScriptPropertyDefValGenerator.cs alongside other export property checks.

The easy fix would be to keep the early return in DeterminePropertyInfo but removing the ReportDiagnostic calls and changing the comments to indicate that case is handled by a different generator class. Ideally IMO there wouldn't be multiple classes deriving the same information and doing the same validation to begin with but that is a different issue.

Steps to reproduce

Try to export a read only or write only property.

Minimal reproduction project (MRP)

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants