summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSai Praveen Bangaru <31557731+saipraveenb25@users.noreply.github.com>2024-12-06 16:25:01 -0500
committerGitHub <noreply@github.com>2024-12-06 13:25:01 -0800
commit0d5636c2426fad43490e0f06830fe6e6db71d045 (patch)
tree2697177b681f230086756901c4e2407b84583eba
parent27b7ac0e8ae02a41f748cccd76d617bb3b9d9734 (diff)
Update slang-ast-decl-ref.cpp (#5786)
-rw-r--r--source/slang/slang-ast-decl-ref.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/slang/slang-ast-decl-ref.cpp b/source/slang/slang-ast-decl-ref.cpp
index 29ab7f86e..3025381ea 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<Decl*> decls;
for (auto dd = getDecl(); dd; dd = dd->parentDecl)
{
- // Skip the top-level decl.
- if (as<ModuleDecl>(dd))
+ // Skip the module, file & include decls since their names are
+ // considered "transparent"
+ //
+ if (as<ModuleDecl>(dd) || as<FileDecl>(dd) || as<IncludeDecl>(dd))
continue;
// Skip base decls in generic containers. We will handle them when we handle the generic