From 622714b76b6c3a21a5806e894151d6de8a7e6866 Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Tue, 2 Aug 2022 17:15:56 +0200 Subject: [PATCH] autodoc: fix frontend crash while rendering std.mem Previously we expected to only find decl refs in a `foo.bar.baz` type of expression. This would crash when trying to render something like `@typeInfo(T).Int.bits`. We now properly account for builtins and other components. --- lib/docs/main.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/docs/main.js b/lib/docs/main.js index a6b75eb1fc..31f91a8445 100644 --- a/lib/docs/main.js +++ b/lib/docs/main.js @@ -931,8 +931,7 @@ var zigAnalysis; return exprName(switchIndex, opts); } case "refPath" : { - const declRef = expr.refPath[0].declRef; - let name = zigAnalysis.decls[declRef].name; + let name = exprName(expr.refPath[0]); for (let i = 1; i < expr.refPath.length; i++) { let component = undefined; if ("string" in expr.refPath[i]) {