From f675c39340ac751fcabc1f30604c8ea737fbe57f Mon Sep 17 00:00:00 2001 From: kaizhangNV <149626564+kaizhangNV@users.noreply.github.com> Date: Thu, 19 Dec 2024 00:27:30 -0600 Subject: Fix the parser issue for not recognize Generic[N] (#5912) Close #5911. In this issue, if we define the generic in source file 1, and import it into source file 2, then when parsing the reference of that generic in source file 2, we will not parse the generic directly, instead we have a logic to speculate it as generics first with a fake diagnostic sink, and if there is no error report, we will consider it as a actual generic and will parse it again. In this logic, we will also disambiguate the expression based on the following token, but we didn't consider the token '[', so we will finally not treat the expression as generic. The fix is just simply add '[' here. Co-authored-by: Yong He --- source/slang/slang-parser.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/slang/slang-parser.cpp b/source/slang/slang-parser.cpp index 10dbe3140..8a4ba55eb 100644 --- a/source/slang/slang-parser.cpp +++ b/source/slang/slang-parser.cpp @@ -2335,6 +2335,7 @@ static Expr* tryParseGenericApp(Parser* parser, Expr* base) case TokenType::Dot: case TokenType::LParent: case TokenType::RParent: + case TokenType::LBracket: case TokenType::RBracket: case TokenType::Colon: case TokenType::Comma: -- cgit v1.2.3