summaryrefslogtreecommitdiffstats
path: root/source/slang/slang-syntax.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-syntax.cpp')
-rw-r--r--source/slang/slang-syntax.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index e41e5517c..d74e3a993 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -12,7 +12,7 @@ namespace Slang
bool BasicExpressionType::EqualsImpl(Type * type)
{
- auto basicType = dynamicCast<const BasicExpressionType>(type);
+ auto basicType = as<BasicExpressionType>(type);
return basicType && basicType->baseType == this->baseType;
}
@@ -85,6 +85,15 @@ bool SyntaxClassBase::isSubClassOfImpl(SyntaxClassBase const& super) const
return false;
}
+NodeBase* _dynamicCastImpl(NodeBase* node, SyntaxClassBase const& toClass)
+{
+ if(!node) return nullptr;
+ if(node->getClass().isSubClassOfImpl(toClass))
+ return node;
+ return nullptr;
+}
+
+
void Type::accept(IValVisitor* visitor, void* extra)
{
accept((ITypeVisitor*)visitor, extra);