From a8bc5983eae60ca37e853041e989a654c1247876 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 Aug 2020 01:10:45 -0700 Subject: 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 Co-authored-by: Yong He --- source/slang/slang-check-overload.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/slang/slang-check-overload.cpp') diff --git a/source/slang/slang-check-overload.cpp b/source/slang/slang-check-overload.cpp index 94638e473..df5424659 100644 --- a/source/slang/slang-check-overload.cpp +++ b/source/slang/slang-check-overload.cpp @@ -1517,6 +1517,11 @@ namespace Slang return CreateErrorExpr(expr); } + for (auto& arg : expr->arguments) + { + arg = maybeOpenExistential(arg); + } + context.originalExpr = expr; context.funcLoc = funcExpr->loc; -- cgit v1.2.3