diff options
| author | Yong He <yonghe@outlook.com> | 2017-12-28 22:51:58 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-12-28 22:51:58 -0500 |
| commit | 37cff92604729a477ff259ef2b561ae9999aac90 (patch) | |
| tree | 6b1fdcdcdc47f0a88194238e7f0b5144c1249b3a /source/slang | |
| parent | ee1ea355f2cde3a3bfb0ce0308129f3cf82a2971 (diff) | |
fixup substitution of typedef associated type implementation via GetType() call.
Diffstat (limited to 'source/slang')
| -rw-r--r-- | source/slang/syntax.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
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<TypeDefDecl*>(targetType)) - return typeDefDecl->type.type->Substitute(aggTypeDeclRef.substitutions); + { + DeclRef<TypeDefDecl> targetTypeDeclRef(typeDefDecl, aggTypeDeclRef.substitutions); + return GetType(targetTypeDeclRef); + } + else if (auto targetAggType = dynamic_cast<AggTypeDecl*>(targetType)) + { + return DeclRefType::Create(getSession(), DeclRef<Decl>(targetAggType, aggTypeDeclRef.substitutions)); + } else - return DeclRefType::Create(getSession(), DeclRef<Decl>(targetType, aggTypeDeclRef.substitutions)); + { + SLANG_UNIMPLEMENTED_X("unknown assoctype implementation type."); + } } } } |
