diff options
| author | Yong He <yonghe@outlook.com> | 2023-12-11 16:13:32 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-11 16:13:32 -0800 |
| commit | ec0224edc3a867bbf059e790ad7b2a1a881a0705 (patch) | |
| tree | 9c56c3fd2dd11f79f597c152326d555d81414fc3 /source/slang/slang-lower-to-ir.cpp | |
| parent | 12fcffaaaf2d1ffa2eefa680e2d7c9971e38a5db (diff) | |
Diagnose for invalid decl nesting + namespace lookup fixes. (#3397)
* Diagnose for invalid decl nesting.
* Fix.
* Fix.
* Fix.
* Fix `namespace` lookup and `using` resolution.
* fix project files.
* revert project files.
* Enhance namespace syntax, docs.
* Fixes.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index f0fd33e13..146f54932 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -2267,6 +2267,10 @@ static String getNameForNameHint( if(auto genericParentDecl = as<GenericDecl>(parentDecl)) parentDecl = genericParentDecl->parentDecl; + // Skip past a FileDecl parent. + if (auto fileParentDecl = as<FileDecl>(parentDecl)) + parentDecl = fileParentDecl->parentDecl; + // A `ModuleDecl` can have a name too, but in the common case // we don't want to generate name hints that include the module // name, simply because they would lead to every global symbol @@ -10148,6 +10152,13 @@ static void ensureAllDeclsRec( ensureAllDeclsRec(context, memberDecl); } } + else if (auto fileDecl = as<FileDecl>(decl)) + { + for (auto memberDecl : fileDecl->members) + { + ensureAllDeclsRec(context, memberDecl); + } + } else if (auto genericDecl = as<GenericDecl>(decl)) { ensureAllDeclsRec(context, genericDecl->inner); |
