| 16 | using namespace KDevelop; |
| 17 | |
| 18 | AbstractType::Ptr unAliasedType(const AbstractType::Ptr& _type) |
| 19 | { |
| 20 | auto type = _type; |
| 21 | auto alias = type.dynamicCast<KDevelop::TypeAliasType>(); |
| 22 | |
| 23 | int depth = 0; //Prevent endless recursion |
| 24 | while (alias && depth < 20) { |
| 25 | uint hadModifiers = alias->modifiers(); |
| 26 | |
| 27 | type = alias->type(); |
| 28 | |
| 29 | if (hadModifiers && type) |
| 30 | type->setModifiers(type->modifiers() | hadModifiers); |
| 31 | |
| 32 | alias = type.dynamicCast<KDevelop::TypeAliasType>(); |
| 33 | ++depth; |
| 34 | } |
| 35 | |
| 36 | return type; |
| 37 | } |
| 38 | |
| 39 | ///@todo remove constant and topContext |
| 40 | AbstractType::Ptr targetType(const AbstractType::Ptr& _base, const TopDUContext* /*topContext*/, bool* /*constant*/) |