Repository navigation
@cpp overloads take a class for T | null and for its base class, in a partial resolve too - #577
Merged
Merged
Conversation
… a partial resolve too resolveCppOverload fitted an argument only by its own type, a number conversion or canCastFromTo (tuples, interfaces): an IFramebuffer fit neither of NVRHI's createGraphicsPipeline overloads, (Ref<GraphicsPipelineDesc>, Ref<FramebufferInfo>) and (Ref<GraphicsPipelineDesc>, IFramebuffer | null), and a derived class no base class parameter. Now a class fits its own type and a `T | null` holding it as 3 (the same C++ pointer), and a base class, alone or in a union, as 2 (a derived-to-base conversion). The overload was also picked in the full pass only: the partial resolve before it called the first overload with the arguments, and an argument it can't be cast to (a class for an s32) failed the function. It is picked in a partial resolve too; there, a call that fits none (or two) keeps the first overload without an error and the full pass reports it. 00cpp_overloads.ts: a class, a `T | null` and a derived class for `T | null`, and a derived class choosing its own overload over its base's. TSLANG_ISSUES.md 19; docs/cpp-classes.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TSLANG_ISSUES.md 19, found on pre-alpha101 in native_ts_graphics once tsbindgen started writing NVRHI's overloads under one name (#576):
device.createGraphicsPipeline(Ref(desc), framebuffer)withframebuffer: IFramebufferfit neither overload.resolveCppOverloadfitted an argument only by its own type, a number conversion, orcanCastFromTo(tuples, interfaces). Now a class fits its own type and aT | nullholding it as 3 (the same C++ pointer), and a base class, alone or in a union, as 2 (a derived-to-base conversion).s32) failed the function. Now the overload is picked in a partial resolve too; there, a call that fits none (or two) keeps the first overload without an error, and the full pass reports it.Tests:
00cpp_overloads.tscovers a class, aT | null, and a derived class forT | null, plus a derived class picking its own overload over its base's. Full ctest (Release, Windows): 4085/4085 pass. docs/cpp-classes.md updated.native_ts_graphics works around this with a
IFramebuffer | nulllocal increateGraphicsPipeline()until a release has this fix.🤖 Generated with Claude Code