summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-lookup.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-08-21 01:10:45 -0700
committerGitHub <noreply@github.com>2020-08-21 01:10:45 -0700
commita8bc5983eae60ca37e853041e989a654c1247876 (patch)
tree330cae10c2c24ba14ca726b61c576d9f362f5b8e /source/slang/slang-lookup.cpp
parent11748a75e66c2bd3fa7ef7635fd35363465f599c (diff)
Allow calling a generic function with an existential value (dynamic dispatch) (#1508)
* Allow calling a generic function with an existential value (dynamic dispatch). * Fixes per review comments. * Clean up implementation by having `openExistential` return `ExtractExistentialType` instead of a DeclRef to the interface with a `ThisTypeSubstitution`. * More cleanups Co-authored-by: Tim Foley <tfoleyNV@users.noreply.github.com> Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-lookup.cpp')
-rw-r--r--source/slang/slang-lookup.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/slang/slang-lookup.cpp b/source/slang/slang-lookup.cpp
index c9b922415..a17ba0ba2 100644
--- a/source/slang/slang-lookup.cpp
+++ b/source/slang/slang-lookup.cpp
@@ -587,6 +587,10 @@ static void _lookUpMembersInSuperTypeImpl(
_lookUpMembersInSuperTypeDeclImpl(astBuilder, name, leafType, superType, leafIsSuperWitness, declRef, request, ioResult, inBreadcrumbs);
}
+ if (auto extractExistentialType = as<ExtractExistentialType>(superType))
+ {
+ _lookUpMembersInSuperTypeDeclImpl(astBuilder, name, leafType, superType, leafIsSuperWitness, extractExistentialType->interfaceDeclRef, request, ioResult, inBreadcrumbs);
+ }
}
/// Perform lookup for `name` in the context of `type`.