summaryrefslogtreecommitdiff
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.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp
index f6b902c68..b7e9af43a 100644
--- a/source/slang/slang-syntax.cpp
+++ b/source/slang/slang-syntax.cpp
@@ -423,21 +423,20 @@ Index getFilterCountImpl(const ReflectClassInfo& clsInfo, MemberFilterStyle filt
}
else if (auto magicMod = declRef.getDecl()->findModifier<MagicTypeModifier>())
{
+ if (magicMod->magicNodeType == ASTNodeType(-1))
+ {
+ SLANG_UNEXPECTED("unhandled type");
+ }
// Always create builtin types in global AST builder.
if (astBuilder->getSharedASTBuilder()->getInnerASTBuilder() != astBuilder)
return DeclRefType::create(astBuilder->getSharedASTBuilder()->getInnerASTBuilder(), declRef);
declRef = createDefaultSubstitutionsIfNeeded(astBuilder, nullptr, declRef);
- auto classInfo = astBuilder->findSyntaxClass(magicMod->magicName.getUnownedSlice());
- if (!classInfo.classInfo)
- {
- SLANG_UNEXPECTED("unhandled type");
- }
ValNodeDesc nodeDesc = {};
- nodeDesc.type = (ASTNodeType)classInfo.classInfo->m_classId;
+ nodeDesc.type = magicMod->magicNodeType;
nodeDesc.operands.add(ValNodeOperand(declRef));
nodeDesc.init();
- NodeBase* type = astBuilder->_getOrCreateImpl(nodeDesc);
+ NodeBase* type = astBuilder->_getOrCreateImpl(_Move(nodeDesc));
if (!type)
{
SLANG_UNEXPECTED("constructor failure");