diff options
| author | Yong He <yonghe@outlook.com> | 2017-11-03 09:38:02 -0400 |
|---|---|---|
| committer | Yong He <yonghe@outlook.com> | 2017-11-03 09:38:02 -0400 |
| commit | a0458266d7cd5d802b8c51e6a997b4bf0d9beb82 (patch) | |
| tree | 39f16538178907240e59b8e531ae153391805833 /source/slang/lookup.cpp | |
| parent | d5e2319c33115d0241dd9d2047c0a5f029553dde (diff) | |
in-progress work
Diffstat (limited to 'source/slang/lookup.cpp')
| -rw-r--r-- | source/slang/lookup.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source/slang/lookup.cpp b/source/slang/lookup.cpp index b97dac560..a5425074f 100644 --- a/source/slang/lookup.cpp +++ b/source/slang/lookup.cpp @@ -452,28 +452,28 @@ void lookUpMemberImpl( lookUpMemberImpl(session, semantics, name, bound, ioResult, &breadcrumb); } } - } - else if (auto assocTypeDeclRefType = type->As<AssocTypeDeclRefType>()) - { - auto assocTypeDeclRef = assocTypeDeclRefType->declRef; - for (auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(assocTypeDeclRef)) + else if (auto assocTypeDeclRef = declRef.As<AssocTypeDecl>()) { - // The super-type in the constraint (e.g., `Foo` in `T : Foo`) - // will tell us a type we should use for lookup. - auto bound = GetSup(constraintDeclRef); + for (auto constraintDeclRef : getMembersOfType<GenericTypeConstraintDecl>(assocTypeDeclRef)) + { + // The super-type in the constraint (e.g., `Foo` in `T : Foo`) + // will tell us a type we should use for lookup. + auto bound = GetSup(constraintDeclRef); - // Go ahead and use the target type, with an appropriate breadcrumb - // to indicate that we indirected through a type constraint. + // Go ahead and use the target type, with an appropriate breadcrumb + // to indicate that we indirected through a type constraint. - BreadcrumbInfo breadcrumb; - breadcrumb.prev = inBreadcrumbs; - breadcrumb.kind = LookupResultItem::Breadcrumb::Kind::Constraint; - breadcrumb.declRef = constraintDeclRef; + BreadcrumbInfo breadcrumb; + breadcrumb.prev = inBreadcrumbs; + breadcrumb.kind = LookupResultItem::Breadcrumb::Kind::Constraint; + breadcrumb.declRef = constraintDeclRef; - // TODO: Need to consider case where this might recurse infinitely. - lookUpMemberImpl(session, semantics, name, bound, ioResult, &breadcrumb); + // TODO: Need to consider case where this might recurse infinitely. + lookUpMemberImpl(session, semantics, name, bound, ioResult, &breadcrumb); + } } } + } LookupResult lookUpMember( |
