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

Limit core type usage on registered properties #668

Merged

Conversation

chippmann
Copy link
Contributor

@chippmann chippmann commented Aug 29, 2024

This limits the usage of core types on exported properties to actually allowed cases.

That means that registered core type properties can no longer be lateinit!

Edit: This now also fixes some type checks which failed because callables did not implement the core type interface

@CedNaru
Copy link
Member

CedNaru commented Aug 30, 2024

I said it was okay for them to be nullable. In such case, Godot Variant is going to interpret the null as the "zero value" of the corresponding core type. Unlike lateinit, nullables are not the cause of any known bug right now.
Maybe we should not allow them, as it's more rigorous but in this case, you also have to check the return type of registered methods, not just properties.

@chippmann
Copy link
Contributor Author

Yeah it was just easy going to directly limit them.
I mean i can also limit the functions right now. Not much work.
But we can also allow them. Both are ok for me.

CedNaru
CedNaru previously approved these changes Aug 30, 2024
@CedNaru CedNaru self-requested a review August 30, 2024 15:45
CedNaru
CedNaru previously approved these changes Aug 31, 2024
@CedNaru CedNaru requested review from piiertho and CedNaru August 31, 2024 09:35
@chippmann chippmann merged commit 757a39b into master Aug 31, 2024
50 checks passed
@chippmann chippmann deleted the feature/limit_core_type_usage_on_registered_properties branch August 31, 2024 10:24
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.

3 participants