diff options
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
| -rw-r--r-- | source/slang/slang-check-conformance.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp index e77ea4981..5889c6140 100644 --- a/source/slang/slang-check-conformance.cpp +++ b/source/slang/slang-check-conformance.cpp @@ -390,6 +390,28 @@ namespace Slang return _isDeclaredSubtype(subType, subType, superTypeDeclRef, nullptr, nullptr); } + bool SemanticsVisitor::isDeclaredSubtype( + Type* subType, + Type* superType) + { + if (auto declRefType = as<DeclRefType>(superType)) + { + if (auto aggTypeDeclRef = declRefType->declRef.as<AggTypeDecl>()) + return _isDeclaredSubtype(subType, subType, aggTypeDeclRef, nullptr, nullptr); + } + return false; + } + + bool SemanticsVisitor::isInterfaceType(Type* type) + { + if (auto declRefType = as<DeclRefType>(type)) + { + if (auto interfaceDeclRef = declRefType->declRef.as<InterfaceDecl>()) + return true; + } + return false; + } + Val* SemanticsVisitor::tryGetSubtypeWitness( Type* subType, DeclRef<AggTypeDecl> superTypeDeclRef) |
