fix: resolve Symbol::For overload ambiguity by umuoy1 · Pull Request #1742 · nodejs/node-addon-api · GitHub
Skip to content

fix: resolve Symbol::For overload ambiguity - #1742

Merged
legendecas merged 5 commits into
nodejs:mainfrom
umuoy1:fix/symbol-for-overload-ambiguity
Aug 10, 2026
Merged

legendecas merged 5 commits into
nodejs:mainfrom
umuoy1:fix/symbol-for-overload-ambiguity

Conversation

@umuoy1

@umuoy1 umuoy1 commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Symbol::For an ambiguous for types that can convert to both std::string and std::string_view.

Instead of removing the existing std::string overload, this keep it so string-only wrappers continue to work and adds a constrained forwarding overload for the ambiguous case. Calls that already have a unique best match keep using the existing overloads.

Fixes #1741

Signed-off-by: umuoy1 <burningdian@gmail.com>
@codecov-commenter

codecov-commenter commented Aug 7, 2026 •

Copy link
Copy Markdown

Comment thread test/symbol.cc
umuoy1 added 2 commits August 9, 2026 15:51
Signed-off-by: umuoy1 <burningdian@gmail.com>
Signed-off-by: umuoy1 <burningdian@gmail.com>
Comment thread napi.h Outdated
Signed-off-by: umuoy1 <burningdian@gmail.com>
Comment thread napi.h Outdated
Comment thread napi.h Outdated
Comment thread napi.h Outdated
Signed-off-by: umuoy1 <burningdian@gmail.com>
@legendecas
legendecas merged commit 13c854a into nodejs:main Aug 10, 2026
70 checks passed
@github-project-automation github-project-automation Bot moved this from Need Triage to Done in Node-API Team Project Aug 10, 2026
@github-actions github-actions Bot mentioned this pull request Aug 10, 2026
dadezzz pushed a commit to dadezzz/events-cash-register that referenced this pull request Aug 16, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [node-addon-api](https://github.com/nodejs/node-addon-api) | [`8.9.1` → `8.9.2`](https://renovatebot.com/diffs/npm/node-addon-api/8.9.1/8.9.2) | ![age](https://developer.mend.io/api/mc/badges/age/npm/node-addon-api/8.9.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/node-addon-api/8.9.1/8.9.2?slim=true) |

---

### Release Notes

<details>
<summary>nodejs/node-addon-api (node-addon-api)</summary>

### [`v8.9.2`](https://github.com/nodejs/node-addon-api/blob/HEAD/CHANGELOG.md#892-2026-08-10)

[Compare Source](nodejs/node-addon-api@v8.9.1...v8.9.2)

##### Bug Fixes

- resolve Symbol::For overload ambiguity ([#&#8203;1742](nodejs/node-addon-api#1742)) ([13c854a](nodejs/node-addon-api@13c854a))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNy4xIiwidXBkYXRlZEluVmVyIjoiNDQuMTcuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Ambiguity on Symbol::For overload between std::string and std::string_view convertible

3 participants