From 9efd9597c50d4dbbf57a9285085aab044ed6c8c0 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 28 Dec 2017 17:38:05 -0500 Subject: 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. --- source/slang/syntax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/slang/syntax.cpp') 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(targetType)) - return typeDefDecl->type.type; + return typeDefDecl->type.type->Substitute(aggTypeDeclRef.substitutions); else return DeclRefType::Create(getSession(), DeclRef(targetType, aggTypeDeclRef.substitutions)); } -- cgit v1.2.3