<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/diagnostics/const-to-nodiff-function-diagnostic-improvement.slang, 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-07-09T16:25:29+00:00</updated>
<entry>
<title>no_diff diagnostics improvement (#7655)</title>
<updated>2025-07-09T16:25:29+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2025-07-09T16:25:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a670bafc121c20168624f70a388dbe8556402c7f'/>
<id>urn:sha1:a670bafc121c20168624f70a388dbe8556402c7f</id>
<content type='text'>
close #6286.

This PR is to improve the diagnostics for no_diff usage.

In a differentiable function, any calls to a non-diff function with constant arguments should not require no_diff attribute.
This PR adds this extra check at `checkAutoDiffUsages` where it checks the differentiability on IR.

In a differentiable method, we will force to use `[NoDiffThis]` attribute if there is access to non-differentiable `This` type. Once this access is detected we will report a warning to bring users attention that this access won't generate any derivative, they have to use `[NoDiffThis]` to suppress that warning.
This PR adds this check at type checking stage, because it's the easiest way to find out all the `This` accesses.</content>
</entry>
</feed>
