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 --- source/slang/slang-parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/slang/slang-parser.cpp') diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 5f9d5fbc4..b8310451c 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -1021,7 +1021,9 @@ namespace Slang parser->astBuilder, nullptr, // no semantics visitor available yet name, - parser->currentScope); + parser->currentScope, + LookupMask::Default, + true); // If we didn't find anything, or the result was overloaded, // then we aren't going to be able to extract a single decl. -- cgit v1.2.3