| 5671 | //--------------------------------------------------------------------------- |
| 5672 | |
| 5673 | const Type* SymbolDatabase::findVariableTypeInBase(const Scope* scope, const Token* typeTok) |
| 5674 | { |
| 5675 | if (scope && scope->definedType && !scope->definedType->derivedFrom.empty()) { |
| 5676 | const std::vector<Type::BaseInfo> &derivedFrom = scope->definedType->derivedFrom; |
| 5677 | for (const Type::BaseInfo & i : derivedFrom) { |
| 5678 | const Type *base = i.type; |
| 5679 | if (base && base->classScope) { |
| 5680 | if (base->classScope == scope) |
| 5681 | return nullptr; |
| 5682 | const Type * type = base->classScope->findType(typeTok->str()); |
| 5683 | if (type) |
| 5684 | return type; |
| 5685 | type = findVariableTypeInBase(base->classScope, typeTok); |
| 5686 | if (type) |
| 5687 | return type; |
| 5688 | } |
| 5689 | } |
| 5690 | } |
| 5691 | |
| 5692 | return nullptr; |
| 5693 | } |
| 5694 | |
| 5695 | //--------------------------------------------------------------------------- |
| 5696 | |