From 37cff92604729a477ff259ef2b561ae9999aac90 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 28 Dec 2017 22:51:58 -0500 Subject: fixup substitution of typedef associated type implementation via GetType() call. --- source/slang/syntax.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'source/slang/syntax.cpp') diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index ef5113f97..c49cd3648 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -505,9 +505,18 @@ void Type::accept(IValVisitor* visitor, void* extra) if (aggTypeDeclRef.getDecl()->memberDictionary.TryGetValue(assocTypeDecl->getName(), targetType)) { if (auto typeDefDecl = dynamic_cast(targetType)) - return typeDefDecl->type.type->Substitute(aggTypeDeclRef.substitutions); + { + DeclRef targetTypeDeclRef(typeDefDecl, aggTypeDeclRef.substitutions); + return GetType(targetTypeDeclRef); + } + else if (auto targetAggType = dynamic_cast(targetType)) + { + return DeclRefType::Create(getSession(), DeclRef(targetAggType, aggTypeDeclRef.substitutions)); + } else - return DeclRefType::Create(getSession(), DeclRef(targetType, aggTypeDeclRef.substitutions)); + { + SLANG_UNIMPLEMENTED_X("unknown assoctype implementation type."); + } } } } -- cgit v1.2.3