In the course of writing tests for the fix to #2693 and #818, I discovered that intrinsic methods have their own error reporting path that fix doesn't resolve.
https://godbolt.org/z/ExYrj31z9
Texture2D<float4> tex;
SamplerComparisonState samp;
float4 main(float2 coord : C) : SV_Target {
return tex.Sample(samp, coord);
}
The reporting attempts to report why both variants don't match, but the reporting for the arg type mismatch is elided due to incomplete error reporting from the HLSL code, so the only error message is for the second version, which takes more arguments, leading to this baffling error:
<source>:5:14: error: no matching member function for call to 'Sample'
return tex.Sample(samp, coord);
~~~~^~~~~~
<source>:5:14: note: candidate function template not viable: requires 3 arguments, but 2 were provided
<source>:5:14: note: candidate function template not viable: requires 4 arguments, but 2 were provided
<source>:5:14: note: candidate function template not viable: requires 5 arguments, but 2 were provided
In the course of writing tests for the fix to #2693 and #818, I discovered that intrinsic methods have their own error reporting path that fix doesn't resolve.
https://godbolt.org/z/ExYrj31z9
The reporting attempts to report why both variants don't match, but the reporting for the arg type mismatch is elided due to incomplete error reporting from the HLSL code, so the only error message is for the second version, which takes more arguments, leading to this baffling error: