From a911ca6e06ce41e403b80fe6054162393491c8ac Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 13 Mar 2023 10:57:28 -0700 Subject: Support high order diff pattern: `bwd_diff(fwd_diff(f))`. (#2695) * Support high order diff pattern: `bwd_diff(fwd_diff(f))`. * Fix. --------- Co-authored-by: Yong He --- source/slang/slang-syntax.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source/slang/slang-syntax.cpp') diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp index 6076a41ca..470f5f983 100644 --- a/source/slang/slang-syntax.cpp +++ b/source/slang/slang-syntax.cpp @@ -1232,6 +1232,25 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt } break; } + + // Hard code implementation of T.Differential.Differential == T.Differential rule. + if (auto builtinReq = substDeclRef.getDecl()->findModifier()) + { + if (builtinReq->kind == BuiltinRequirementKind::DifferentialType) + { + // Is the concrete type a Differential associated type? + if (auto innerDeclRefType = as(thisSubst->witness->sub)) + { + if (auto innerBuiltinReq = innerDeclRefType->declRef.decl->findModifier()) + { + if (innerBuiltinReq->kind == BuiltinRequirementKind::DifferentialType) + { + return innerDeclRefType; + } + } + } + } + } } } } -- cgit v1.2.3