On Thu Nov 16 19:08:37 2023 +0000, Nikolay Sivov wrote:
I got a little carried away and checked a few more variants. It also supports "L" and "UL" in all case combinations. Not sure if we need to support that right away, but seems harmless to have it. While "L" part looks meaningless, "U" does for unsigned constant type. You can check that like this:
float4 func(int i) { return float4(1, 0, 0, 0); } float4 func(uint i) { return float4(2, 0, 0, 0); } float4 main() : sv_target { return func(1u); }
It's unable to find correct overload with "1" or "1L" though.
it is never simple, isn't it? :')
I added a test similar to this one in patch 3/5; patch 4/5 is to identify signed and unsigned numeric values at parse time so we get the data type of the constant right; also, I reverted fef118555cd6341eb648f482a4517d61c347a0d3 in 5/5 so that the test passes.
@zfigura I think that the native compiler throwing an error with multiple compatible function overloads with "float" vs "float1" arguments is an exception rather than the rule and we should indeed revert the patch to make more applications work.