From 8f962894fd38edb47d782d303ac9ff87b3a3bb6a Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 4 Sep 2020 10:18:44 -0700 Subject: Allow mixing unspecialized and specialized existential parameters. (#1533) * Allow mixing unspecialized and specialized existential parameters. * Fixes. --- source/slang/slang-check-conformance.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'source/slang/slang-check-conformance.cpp') diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp index 25a7ac4ee..6a397e8b6 100644 --- a/source/slang/slang-check-conformance.cpp +++ b/source/slang/slang-check-conformance.cpp @@ -180,8 +180,16 @@ namespace Slang } return true; } - - if( auto aggTypeDeclRef = declRef.as() ) + if (auto dynamicType = as(subType)) + { + // A __Dynamic type always conforms to the interface via its witness table. + if (outWitness) + { + *outWitness = m_astBuilder->create(); + } + return true; + } + else if( auto aggTypeDeclRef = declRef.as() ) { ensureDecl(aggTypeDeclRef, DeclCheckState::CanEnumerateBases); @@ -363,7 +371,6 @@ namespace Slang } return true; } - // default is failure return false; } -- cgit v1.2.3