From 765061a77bcf4fe6300721263cc9e0f25595488d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 10 May 2022 19:42:48 -0700 Subject: Initial support for COM interface in host code. (#2230) Co-authored-by: Yong He Co-authored-by: Theresa Foley <10618364+tangent-vector@users.noreply.github.com> --- source/slang/slang-check-decl.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang/slang-check-decl.cpp') diff --git a/source/slang/slang-check-decl.cpp b/source/slang/slang-check-decl.cpp index 3c654a48b..6c414b292 100644 --- a/source/slang/slang-check-decl.cpp +++ b/source/slang/slang-check-decl.cpp @@ -3232,6 +3232,16 @@ namespace Slang _validateCrossModuleInheritance(decl, inheritanceDecl); } + + if (decl->findModifier()) + { + // `associatedtype` declaration is not allowed in a COM interface declaration. + for (auto associatedType : decl->getMembersOfType()) + { + getSink()->diagnose( + associatedType, Diagnostics::associatedTypeNotAllowInComInterface); + } + } } void SemanticsDeclBasesVisitor::visitStructDecl(StructDecl* decl) -- cgit v1.2.3