refactor!: consistent null handling in coercible signatures
Which issue does this PR close?
- Closes #15013.
Rationale for this change
Currently, there is a special case for null handling in TypeSignatureClass::matches_native_type, which causes inconsistencies and issues between TypeSignatureClass::matches_native_type and TypeSignatureClass::default_casted_type (it will hit the else match arm which returns an error) when self is not a TypeSignatureClass::Native.
What changes are included in this PR?
- Remove the special handling of null case in
TypeSignatureClass::matches_native_type - Add
TypeSignatureClass::Native(logical_null())where the argument is nullable and it was not originally supplied.
Are these changes tested?
These changes should be covered in existing test.
Are there any user-facing changes?
Yes, if the user rely on the special null case handling behavior of 'TypeSignatureClass::Native, they will need to transform the usage to Coercible::new_implicitand add aTypeSignatureClass::Native(logical_null())`.
Hi @alamb, I’ve updated upgrading.md. Since this is my first PR with an API change, I’m not 100% sure I did everything right. Would appreciate it if you could take a look and let me know if anything needs adjusting. Thanks!
Thanks @alan910127 -- I'll check it out in a few days
Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.