From cdfea42f1b28c6ec7b13500a64be823f67bf8e0a Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 7 Jul 2023 03:52:00 +0800 Subject: Fix erroneous error claiming variable is being used before its declaration (#2958) * Simplify type of diagnoseImpl * Show source line for Note diagnostics, opting out of this where appropriate * Make declared after use diagnostic clearer * Fix erroneous error claiming variable is being used before its declaration Closes https://github.com/shader-slang/slang/issues/2936 * Fix build on msvc --------- Co-authored-by: jsmall-nvidia --- tests/diagnostics/generic-type-inference-fail.slang.expected | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests/diagnostics/generic-type-inference-fail.slang.expected') diff --git a/tests/diagnostics/generic-type-inference-fail.slang.expected b/tests/diagnostics/generic-type-inference-fail.slang.expected index 3f9753d68..17cb28ca2 100644 --- a/tests/diagnostics/generic-type-inference-fail.slang.expected +++ b/tests/diagnostics/generic-type-inference-fail.slang.expected @@ -4,6 +4,8 @@ tests/diagnostics/generic-type-inference-fail.slang(66): error 39999: could not var obj3 = CreateT_Assoc_Inner(1); // ERROR. ^ tests/diagnostics/generic-type-inference-fail.slang(18): note 39999: see declaration of func CreateT_Assoc_Inner(int) -> T.TAssoc +T.TAssoc CreateT_Assoc_Inner(int inVal) + ^~~~~~~~~~~~~~~~~~~ } standard output = { } -- cgit v1.2.3