| 2280 | } |
| 2281 | |
| 2282 | void BfAutoComplete::CheckTypeRef(BfTypeReference* typeRef, bool mayBeIdentifier, bool isInExpression, bool onlyAttribute) |
| 2283 | { |
| 2284 | if ((typeRef == NULL) || (typeRef->IsTemporary()) || (!IsAutocompleteNode(typeRef))) |
| 2285 | return; |
| 2286 | |
| 2287 | if (auto genericTypeRef = BfNodeDynCast<BfGenericInstanceTypeRef>(typeRef)) |
| 2288 | { |
| 2289 | CheckTypeRef(genericTypeRef->mElementType, mayBeIdentifier, isInExpression, onlyAttribute); |
| 2290 | for (auto genericArg : genericTypeRef->mGenericArguments) |
| 2291 | CheckNode(genericArg, false, isInExpression); |
| 2292 | return; |
| 2293 | } |
| 2294 | |
| 2295 | if (!onlyAttribute) |
| 2296 | { |
| 2297 | if (auto tupleTypeRef = BfNodeDynCast<BfTupleTypeRef>(typeRef)) |
| 2298 | { |
| 2299 | for (auto fieldTypeRef : tupleTypeRef->mFieldTypes) |
| 2300 | CheckTypeRef(fieldTypeRef, false, isInExpression, false); |
| 2301 | return; |
| 2302 | } |
| 2303 | |
| 2304 | if (auto delegateTypeRef = BfNodeDynCast<BfDelegateTypeRef>(typeRef)) |
| 2305 | { |
| 2306 | CheckTypeRef(delegateTypeRef->mReturnType, false, isInExpression); |
| 2307 | for (auto param : delegateTypeRef->mParams) |
| 2308 | { |
| 2309 | auto attributes = param->mAttributes; |
| 2310 | while (attributes != NULL) |
| 2311 | { |
| 2312 | if (attributes->mAttributeTypeRef != NULL) |
| 2313 | { |
| 2314 | CheckAttributeTypeRef(attributes->mAttributeTypeRef); |
| 2315 | } |
| 2316 | |
| 2317 | attributes = attributes->mNextAttribute; |
| 2318 | } |
| 2319 | CheckTypeRef(param->mTypeRef, false, isInExpression); |
| 2320 | } |
| 2321 | return; |
| 2322 | } |
| 2323 | |
| 2324 | if (auto elementedTypeRef = BfNodeDynCast<BfElementedTypeRef>(typeRef)) |
| 2325 | { |
| 2326 | // "May be identifier" where pointer types could actually end up be multiplies, etc. |
| 2327 | CheckTypeRef(elementedTypeRef->mElementType, true, isInExpression); |
| 2328 | return; |
| 2329 | } |
| 2330 | } |
| 2331 | |
| 2332 | if ((mayBeIdentifier) && (mResolveType != BfResolveType_GoToDefinition)) |
| 2333 | { |
| 2334 | if (auto namedTypeRef = BfNodeDynCast<BfNamedTypeReference>(typeRef)) |
| 2335 | { |
| 2336 | CheckIdentifier(namedTypeRef->mNameNode, isInExpression); |
| 2337 | return; |
| 2338 | } |
| 2339 | else if (auto varTypeRef = BfNodeDynCast<BfVarTypeReference>(typeRef)) |
no test coverage detected