summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-check-conformance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-check-conformance.cpp')
-rw-r--r--source/slang/slang-check-conformance.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/slang/slang-check-conformance.cpp b/source/slang/slang-check-conformance.cpp
index ffa037996..9d9047e41 100644
--- a/source/slang/slang-check-conformance.cpp
+++ b/source/slang/slang-check-conformance.cpp
@@ -274,9 +274,14 @@ namespace Slang
return isInterfaceType(type);
}
- bool SemanticsVisitor::isTypeDifferentiable(Type* type)
+ SubtypeWitness* SemanticsVisitor::isTypeDifferentiable(Type* type)
{
- return isSubtype(type, m_astBuilder->getDiffInterfaceType(), IsSubTypeOptions::None);
+ if (auto valueWitness = isSubtype(type, m_astBuilder->getDiffInterfaceType(), IsSubTypeOptions::None))
+ return valueWitness;
+ else if (auto ptrWitness = isSubtype(type, m_astBuilder->getDifferentiableRefInterfaceType(), IsSubTypeOptions::None))
+ return ptrWitness;
+
+ return nullptr;
}
bool SemanticsVisitor::doesTypeHaveTag(Type* type, TypeTag tag)