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 nullable warnings for interface parameters. #859

Merged
merged 1 commit into from
Apr 27, 2023
Merged

Conversation

cameronwhite
Copy link
Contributor

This could generate nullable warnings from the as expression producing null, or from the parameter being nullable. Since interfaces inherit from the GLib.IHandle interface, this cast can be avoided by just using its Handle property. This is done inline, similar to how class parameters are converted to native parameters.

This reduces the number of warnings in the build from 6552 to 5792

  • I agree that my contribution may be licensed either under MIT or any version of LGPL license.

This could generate nullable warnings from the `as` expression producing null, or from the parameter being nullable.
Since interfaces inherit from the `GLib.IHandle` interface, this cast can be avoided by just using its `Handle` property. This is done inline, similar to how class parameters are converted to native parameters.
@cameronwhite cameronwhite force-pushed the fix/nullable-warning branch from 353cad3 to 14e1935 Compare April 27, 2023 13:14
@badcel
Copy link
Member

badcel commented Apr 27, 2023

Looks good to me. Thank you 👍

@badcel badcel merged commit 216ce3f into main Apr 27, 2023
@badcel badcel deleted the fix/nullable-warning branch April 27, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants