Skip to content

Align MethodInfo equality check with engine#1965

Merged
dsnopek merged 1 commit into
godotengine:masterfrom
Naros:fix-methodinfo-equality-check
Apr 7, 2026
Merged

Align MethodInfo equality check with engine#1965
dsnopek merged 1 commit into
godotengine:masterfrom
Naros:fix-methodinfo-equality-check

Conversation

@Naros

@Naros Naros commented Apr 5, 2026

Copy link
Copy Markdown
Contributor

Fixes the MethodInfo equality operator== check to use the name like in the engine.

I came across this because I was using some similar code to the engine that does:

if (!(info == MethodInfo())) {
  /* do stuff */
}

And I could not understand why a full MethodInfo would not trigger the if-block. 😭

@Naros Naros requested a review from a team as a code owner April 5, 2026 22:15
@Naros

Naros commented Apr 5, 2026

Copy link
Copy Markdown
Contributor Author

@dsnopek @Ivorforce, this is at least the second or third time I've come across inconsistencies between these structs (MethodInfo / PropertyInfo), since they're defined in both the engine and the godot-cpp side. Is there any chance we can develop some sort of check that prevents this from happening, where the engine and godot-cpp get out of sync?

@Ivorforce Ivorforce 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.

The id+name check doesn't make much sense to me, but the engine does it so we should follow along.

Regarding automated checks for parity, I'm not sure how that would be possible. Do you have any ideas how to do it?

@Naros

Naros commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

@Ivorforce I don't really have a good solution given there are data type differences between the two and there are some methods that make sense on the engine side but not the CPP side :(

@dsnopek dsnopek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

I'm not really sure of how we could automate checks for inconsistencies. Maybe if we had unit tests of all the classes that could be copied from the engine? That would still depend on us syncing the unit tests to know that we no longer match the engine's behavior, though.

@dsnopek dsnopek added the bug This has been identified as a bug label Apr 7, 2026
@dsnopek dsnopek added this to the 10.x milestone Apr 7, 2026
@dsnopek dsnopek merged commit 41cfbd1 into godotengine:master Apr 7, 2026
19 checks passed
@Naros

Naros commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

Agreed @dsnopek.

The only thing that has come to mind is some sort of Agentic SDLC workflow that compares the two using a good set of prompts and generates a PASS/FAIL result in CI. But I don't know how GF feels about moving toward the Agentic SDLC for these tasks.

@dsnopek

dsnopek commented Apr 7, 2026

Copy link
Copy Markdown
Collaborator

I'm not totally opposed to the use of AI in general, but the idea of an AI deciding if CI passes or fails seems far too fragile and potentially frustrating. I could imagine someone periodically asking Claude Code (or similar) to look at the files in both places and point out any possible discrepancies, which would then be investigated by a human. But that's not really automatic

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

Labels

bug This has been identified as a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants