From ba6f55ed9481960b4f6c7f0a6b8f1cf7d450c752 Mon Sep 17 00:00:00 2001 From: Yong He Date: Wed, 24 Aug 2022 12:05:19 -0700 Subject: Allow `static const` interface requirements. (#2378) --- source/slang/slang-ast-decl.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/slang/slang-ast-decl.cpp') diff --git a/source/slang/slang-ast-decl.cpp b/source/slang/slang-ast-decl.cpp index edc79c030..2df9164fb 100644 --- a/source/slang/slang-ast-decl.cpp +++ b/source/slang/slang-ast-decl.cpp @@ -18,4 +18,18 @@ const TypeExp& TypeConstraintDecl::_getSupOverride() const } +bool isInterfaceRequirement(Decl* decl) +{ + auto ancestor = decl->parentDecl; + for (; ancestor; ancestor = ancestor->parentDecl) + { + if (as(ancestor)) + return true; + + if (as(ancestor)) + return false; + } + return false; +} + } // namespace Slang -- cgit v1.2.3