diff options
| author | Yong He <yonghe@outlook.com> | 2017-12-28 17:38:05 -0500 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-12-28 17:39:14 -0500 |
| commit | 9efd9597c50d4dbbf57a9285085aab044ed6c8c0 (patch) | |
| tree | 506ff773e065280b58c8b67f0c6dccbd7a8c9114 /source | |
| parent | 69242398be1ba76898c0d6541eec3b7ca0ec1ab4 (diff) | |
Fix substitution for associatedtype.
fixes #341
When a typedef definition is used to satisfy an associated type, we must also substitute the resulting typedef type using parent substitution, in the case that the typedef is a generic application.
Diffstat (limited to 'source')
| -rw-r--r-- | source/slang/syntax.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/slang/syntax.cpp b/source/slang/syntax.cpp index 070362ddf..e67e21883 100644 --- a/source/slang/syntax.cpp +++ b/source/slang/syntax.cpp @@ -503,7 +503,7 @@ 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; + return typeDefDecl->type.type->Substitute(aggTypeDeclRef.substitutions); else return DeclRefType::Create(getSession(), DeclRef<Decl>(targetType, aggTypeDeclRef.substitutions)); } |
