Skip to content

[objective_c] Implement NSNumber methods for bool#3331

Open
knopp wants to merge 2 commits intodart-lang:mainfrom
knopp:bool_to_nsnumber
Open

[objective_c] Implement NSNumber methods for bool#3331
knopp wants to merge 2 commits intodart-lang:mainfrom
knopp:bool_to_nsnumber

Conversation

@knopp
Copy link
Copy Markdown
Contributor

@knopp knopp commented Apr 25, 2026

Adds bool.toNSNumber() extension method, NSNumber.isBool check and add converter support for bool.

Related Issues

List which issues are fixed by this PR. Use the syntax Fixes #1234.

PR Checklist

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • I've run dart tool/ci.dart --all locally and resolved all issues identified. This ensures the PR is formatted, has no lint errors, and ran all code generators. This applies to the packages part of the toplevel pubspec.yaml workspace.
  • All existing and new tests are passing. I added new tests to check the change I am making.
  • The PR is actually solving the issue. PRs that don't solve the issue will be closed. Please be respectful of the maintainers' time. If it's not clear what the issue is, feel free to ask questions on the GitHub issue before submitting a PR.
  • I have updated CHANGELOG.md for the relevant packages. (Not needed for small changes such as doc typos).
  • I have updated the pubspec package version if necessary.

@knopp
Copy link
Copy Markdown
Contributor Author

knopp commented Apr 25, 2026

Not sure why there are so many changes in generated bindings, is that expected?

@github-actions
Copy link
Copy Markdown

PR Health

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
objective_c Breaking 9.3.0 9.4.0-wip 9.4.0-wip ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry
Package Changed Files
package:objective_c pkgs/objective_c/lib/src/converter.dart
pkgs/objective_c/lib/src/ns_number.dart
pkgs/objective_c/lib/src/objective_c_bindings_exported.dart
pkgs/objective_c/lib/src/objective_c_bindings_generated.dart

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

Copy link
Copy Markdown
Contributor

@liamappelbe liamappelbe left a comment

Choose a reason for hiding this comment

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

I think technically renaming NSNumberIsFloat is a breaking change, even though it's unlikely to actually affect any users. But just to be safe, it would be better to add a separate NSNumberIsBool interface.

As for the bindings diffs, no, they're not expected. I suspect you're using a different version of xcode than me and the github bot. Some of the diffs look problematic too. Are you able to update your xcode?

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.

2 participants