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

Fix comparison of callables #99078

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

DarkMessiah
Copy link
Contributor

There was a mistake in the conditions that made it impossible to compare callables.

Is it worth adding an argument comparison?

if (a->binds != b->binds) {
     return false
}

because

func foo(): pass

func _ready():
    var a = foo.bind(1)
    var b = foo.bind("a")
    print(a == b) # will be true if we don't compare arguments

@DarkMessiah DarkMessiah requested a review from a team as a code owner November 11, 2024 16:27
@AThousandShips
Copy link
Member

Is it worth adding an argument comparison?

This would break compatibility and a lot of existing code, so can't be done now, maybe for 5.0

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@Repiteo Repiteo merged commit bb3d5ef into godotengine:master Nov 11, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 11, 2024

Thanks!

@DarkMessiah DarkMessiah deleted the fix_callables_compare branch November 11, 2024 21:51
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.

4 participants