<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tools/slang-unit-test/unit-test-function-lookup-resolution.cpp, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2025-08-08T00:34:05+00:00</updated>
<entry>
<title>Fix FunctionReflection getName() returning null for overloaded functions (#8113)</title>
<updated>2025-08-08T00:34:05+00:00</updated>
<author>
<name>Copilot</name>
<email>198982749+Copilot@users.noreply.github.com</email>
</author>
<published>2025-08-08T00:34:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c7c4816146bb9ec055e9a8f8c3f975624f2fdb07'/>
<id>urn:sha1:c7c4816146bb9ec055e9a8f8c3f975624f2fdb07</id>
<content type='text'>
When using Slang reflection API to find functions by name in a type,
`FunctionReflection::getName()` would return `nullptr` for overloaded
functions instead of the expected function name.

The issue occurred in `spReflectionFunction_GetName` when
`findFunctionByNameInType` returned a `SlangReflectionFunction` wrapping
an `OverloadedExpr` (for overloaded functions) instead of a single
`DeclRef&lt;FunctionDeclBase&gt;`. The `convertToFunc()` function would fail
for `OverloadedExpr` objects, causing `getName()` to return `nullptr`.

**Example of the bug:**
```cpp
// This code would fail before the fix
public interface IBase {
    public void step(inout float f);
}

public struct Impl : IBase {
    public void step(inout float f) { f += 1.0f; }
}

// Using reflection API:
auto implType = reflection-&gt;findTypeByName("Impl");
auto stepFunction = reflection-&gt;findFunctionByNameInType(implType, "step");
auto name = stepFunction-&gt;getName(); // Would return nullptr
```

**Fix:**
Modified `spReflectionFunction_GetName` to handle overloaded functions
by falling back to the name of the first overload candidate when
`convertToFunc` fails. This follows the same pattern already used by
`spReflectionFunction_specializeWithArgTypes`.

The fix ensures that:
- Overloaded function containers return the correct function name
- Individual overload candidates also return their names correctly  
- Non-overloaded functions continue to work as before
- No regression in existing functionality

**Testing:**
Added comprehensive test cases covering both the original issue scenario
and explicit function overloading. All existing reflection tests
continue to pass.

Fixes #8047.

&lt;!-- START COPILOT CODING AGENT TIPS --&gt;
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] &lt;198982749+Copilot@users.noreply.github.com&gt;
Co-authored-by: csyonghe &lt;2652293+csyonghe@users.noreply.github.com&gt;
Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;
Co-authored-by: ArielG-NV &lt;159081215+ArielG-NV@users.noreply.github.com&gt;
Co-authored-by: slangbot &lt;ellieh+slangbot@nvidia.com&gt;
Co-authored-by: slangbot &lt;186143334+slangbot@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Add reflection api for overload candidate filtering. (#8066)</title>
<updated>2025-08-06T08:07:41+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-08-06T08:07:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=68b0125226464cb3c9e9b7f50bfb53cda97723b4'/>
<id>urn:sha1:68b0125226464cb3c9e9b7f50bfb53cda97723b4</id>
<content type='text'>
* Add reflection api for overload candidate filtering.

* Fix API.

* Fix.

* Update build.

* Update test.

* Update formatting.</content>
</entry>
</feed>
