MCPcopy Create free account
hub / github.com/beefytech/Beef / FindCommonOuterType

Method FindCommonOuterType

IDEHelper/Compiler/BfModuleTypeUtils.cpp:15455–15483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15453}
15454
15455BfTypeDef* BfModule::FindCommonOuterType(BfTypeDef* type, BfTypeDef* type2)
15456{
15457 if ((type == NULL) || (type2 == NULL))
15458 return NULL;
15459 int curNestDepth = BF_MIN(type->mNestDepth, type2->mNestDepth);
15460 while (type->mNestDepth > curNestDepth)
15461 type = type->mOuterType;
15462 while (type2->mNestDepth > curNestDepth)
15463 type2 = type2->mOuterType;
15464
15465 while (curNestDepth >= 0)
15466 {
15467 if ((!type->mIsPartial) && (!type2->mIsPartial))
15468 {
15469 if (type->GetDefinition() == type2->GetDefinition())
15470 return type;
15471 }
15472 else
15473 {
15474 if (type->mFullNameEx == type2->mFullNameEx)
15475 return type;
15476 }
15477 type = type->mOuterType;
15478 type2 = type2->mOuterType;
15479 curNestDepth--;
15480 }
15481
15482 return NULL;
15483}
15484
15485bool BfModule::TypeIsSubTypeOf(BfTypeInstance* srcType, BfTypeInstance* wantType, bool checkAccessibility)
15486{

Callers 3

DoHashMethod · 0.80
GenericTypeEqualsMethod · 0.80

Calls 1

GetDefinitionMethod · 0.80

Tested by

no test coverage detected