Skip to content

Fix IsStaticallyResolvable#111523

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Joy-less:fix-IsStaticallyResolvable
Oct 16, 2025
Merged

Fix IsStaticallyResolvable#111523
Repiteo merged 1 commit into
godotengine:masterfrom
Joy-less:fix-IsStaticallyResolvable

Conversation

@Joy-less

@Joy-less Joy-less commented Oct 11, 2025

Copy link
Copy Markdown
Contributor

Fixes #111370.

In #104135, the IsStaticallyResolvable method was added to avoid trying to statically reference primary constructor parameters in property default values.

This pull request does the following:

  • Adds the IsStaticallyResolvable call to fields as well.
  • The IsStaticallyResolvable is changed to support more expression types (e.g. 2 * Mathf.Pi) by, instead of checking lots of supported types of expressions, instead only checks sub-expressions for local variable or parameter references.

@paulloz paulloz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I think this is a better implementation, and applying it on fields makes sense.

Thank you!

@Repiteo Repiteo merged commit 1340451 into godotengine:master Oct 16, 2025
20 checks passed
@Repiteo

Repiteo commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Thanks!

@Joy-less Joy-less deleted the fix-IsStaticallyResolvable branch October 16, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C#] Cannot set the default value of an auto-implemented property if that value is a simple arithmetic expression

4 participants