summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-decl.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-09 04:48:03 -0800
committerGitHub <noreply@github.com>2024-12-09 20:48:03 +0800
commit09a9d673322ebf4ca2fcb7d48f13a44e015ea33f (patch)
tree8bae8fa5718669dcbff98b8bcb29784483905f34 /source/slang/slang-check-decl.cpp
parent051ae8acec0a641bcaf86e7eeff35eff29e8922d (diff)
Allow pointers to existential values. (#5793)
* Fix pointer offset logic and add executable tests. * Fix. * Fix test. * Add existential ptr test. * Allow pointers to existential values. * Fix. * Fix. --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-decl.cpp')
-rw-r--r--source/slang/slang-check-decl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp
index 4a4ade047..eeb75e3fd 100644
--- a/source/slang/slang-check-decl.cpp
+++ b/source/slang/slang-check-decl.cpp
@@ -3105,6 +3105,17 @@ Type* unwrapArrayType(Type* type)
}
}
+Type* unwrapModifiedType(Type* type)
+{
+ for (;;)
+ {
+ if (auto modType = as<ModifiedType>(type))
+ type = modType->getBase();
+ else
+ return type;
+ }
+}
+
void discoverExtensionDecls(List<ExtensionDecl*>& decls, Decl* parent)
{
if (auto extDecl = as<ExtensionDecl>(parent))