| 306 | |
| 307 | namespace CodegenHelper { |
| 308 | AbstractType::Ptr typeForShortenedString(Declaration* decl) |
| 309 | { |
| 310 | AbstractType::Ptr type = decl->abstractType(); |
| 311 | if (decl->isTypeAlias()) { |
| 312 | if (auto alias = type.dynamicCast<TypeAliasType>()) { |
| 313 | type = alias->type(); |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | if (decl->isFunctionDeclaration()) { |
| 318 | FunctionType::Ptr funType = decl->type<FunctionType>(); |
| 319 | if (!funType) { |
| 320 | return AbstractType::Ptr(); |
| 321 | } |
| 322 | type = funType->returnType(); |
| 323 | } |
| 324 | return type; |
| 325 | } |
| 326 | |
| 327 | QString shortenedTypeString(Declaration* decl, DUContext* ctx, int desiredLength, const QualifiedIdentifier& stripPrefix) |
| 328 | { |
no test coverage detected