diff options
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
| -rw-r--r-- | source/slang/slang-check-conformance.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp index 174d4be89..b95df520d 100644 --- a/source/slang/slang-check-conformance.cpp +++ b/source/slang/slang-check-conformance.cpp @@ -211,6 +211,20 @@ namespace Slang auto inheritedType = getBaseType(m_astBuilder, inheritanceDeclRef); + + // There's one annoying corner case where something that *looks* like an inheritnace + // declaration isn't actually one, and that is when an `enum` type includes an explicit + // declaration of its "tag type." + // + if (auto enumDeclRef = declRef.as<EnumDecl>()) + { + if (inheritedType->equals(getTagType(m_astBuilder, enumDeclRef))) + { + return; + } + } + + // We need to ensure that the witness that gets created // is a composite one, reflecting lookup through // the inheritance declaration. |
