diff --git a/source/slang/slang-ast-decl-ref.cpp b/source/slang/slang-ast-decl-ref.cpp index 29ab7f86ea..3025381ea2 100644 --- a/source/slang/slang-ast-decl-ref.cpp +++ b/source/slang/slang-ast-decl-ref.cpp @@ -336,8 +336,10 @@ void DeclRefBase::toText(StringBuilder& out) List decls; for (auto dd = getDecl(); dd; dd = dd->parentDecl) { - // Skip the top-level decl. - if (as(dd)) + // Skip the module, file & include decls since their names are + // considered "transparent" + // + if (as(dd) || as(dd) || as(dd)) continue; // Skip base decls in generic containers. We will handle them when we handle the generic