| 394 | } |
| 395 | |
| 396 | DUContext* Declaration::logicalInternalContext(const TopDUContext* topContext) const |
| 397 | { |
| 398 | ENSURE_CAN_READ |
| 399 | |
| 400 | if (!isDefinition()) { |
| 401 | Declaration* def = FunctionDefinition::definition(this); |
| 402 | if (def) |
| 403 | return def->internalContext(); |
| 404 | } |
| 405 | |
| 406 | if (d_func()->m_isTypeAlias) { |
| 407 | ///If this is a type-alias, return the internal context of the actual type. |
| 408 | TypeAliasType::Ptr t = type<TypeAliasType>(); |
| 409 | if (t) { |
| 410 | AbstractType::Ptr target = t->type(); |
| 411 | |
| 412 | auto* idType = dynamic_cast<IdentifiedType*>(target.data()); |
| 413 | if (idType) { |
| 414 | Declaration* decl = idType->declaration(topContext); |
| 415 | if (decl && decl != this) { |
| 416 | return decl->logicalInternalContext(topContext); |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | } |
| 421 | |
| 422 | return internalContext(); |
| 423 | } |
| 424 | |
| 425 | DUContext* Declaration::internalContext() const |
| 426 | { |
no test coverage detected