On Thu Feb 2 03:55:32 2023 +0000, Francisco Casas wrote:
Unless I am mistaken, if there is a declaration after a definition, the parameter variables will end up with the name in the last definition, e.g. in:
float foo(float aa); float foo(float bb) { return bb + 1; } float foo(float cc); float4 main() : sv_target { return foo(5); }
the parameter will end up with `"cc"` as its name. I think this could be a problem for error logging.
I haven't tested, but I think it may actually be fine, or even preferred? Because the vast majority of errors are done while parsing, references to the parameters from inside the function should print "bb" here, and references to parameters from outside the function (like, say, for a type mismatch) would use the last definition or declaration (so in this case "cc"), which seems like a reasonable or even desirable behaviour.