Skip to content

Emit an error when attempting add a user-defined conversion function - #8206

Merged
Damyan Pepper (damyanp) merged 9 commits into
microsoft:mainfrom
damyanp:copilot/fix-issue-5103-tests
Apr 14, 2026
Merged

Damyan Pepper (damyanp) merged 9 commits into
microsoft:mainfrom
damyanp:copilot/fix-issue-5103-tests

Conversation

@damyanp

Copy link
Copy Markdown
Member

Previously, user-defined conversion functions were silently ignored. This change reports an error if one is defined.

Fixes #5103

Copilot AI and others added 5 commits February 21, 2026 00:26
…soft#5103)

Add err_hlsl_unsupported_conversion_operator diagnostic and check in
CheckConversionDeclarator to reject conversion operators in HLSL.
Previously these were silently ignored, misleading users into thinking
their cast operator overloads were being used.

Co-authored-by: damyanp <[email protected]>
@damyanp
Damyan Pepper (damyanp) marked this pull request as ready for review February 27, 2026 00:14
@damyanp
Damyan Pepper (damyanp) merged commit b13e386 into microsoft:main Apr 14, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Apr 14, 2026
@devshgraphicsprogramming

Copy link
Copy Markdown

We actually used .operator T() in our code, this change breaks things for us

CC: Arkadiusz Lachowicz (@AnastaZIuk)

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.

Should emit error on unsupported cast operator overloading that's silently ignored

5 participants