|
@@ -69,11 +69,21 @@ BfBaseClassWalker::BfBaseClassWalker(BfType* typeA, BfType* typeB, BfModule* mod
|
|
|
AddConstraints(typeA, module->GetGenericParamInstance((BfGenericParamType*)typeA));
|
|
|
}
|
|
|
|
|
|
+ if ((typeA != NULL) && (typeA->IsInterface()))
|
|
|
+ {
|
|
|
+ AddInterfaces(typeA, typeA->ToTypeInstance());
|
|
|
+ }
|
|
|
+
|
|
|
if ((typeB != NULL) && (typeB->IsGenericParam()))
|
|
|
{
|
|
|
mMayBeFromInterface = true;
|
|
|
AddConstraints(typeB, module->GetGenericParamInstance((BfGenericParamType*)typeB));
|
|
|
}
|
|
|
+
|
|
|
+ if ((typeB != NULL) && (typeB->IsInterface()))
|
|
|
+ {
|
|
|
+ AddInterfaces(typeB, typeB->ToTypeInstance());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/*BfBaseClassWalker::BfBaseClassWalker(BfTypeInstance* typeA, BfTypeInstance* typeB)
|
|
@@ -95,6 +105,8 @@ void BfBaseClassWalker::AddConstraints(BfType* srcType, BfGenericParamInstance*
|
|
|
{
|
|
|
auto typeInst = genericParam->mTypeConstraint->ToTypeInstance();
|
|
|
{
|
|
|
+ if (typeInst->IsInterface())
|
|
|
+ AddInterfaces(srcType, typeInst->ToTypeInstance());
|
|
|
Entry entry(srcType, typeInst);
|
|
|
if ((typeInst != NULL) && (!mManualList.Contains(entry)))
|
|
|
mManualList.Add(entry);
|
|
@@ -103,12 +115,24 @@ void BfBaseClassWalker::AddConstraints(BfType* srcType, BfGenericParamInstance*
|
|
|
|
|
|
for (auto typeInst : genericParam->mInterfaceConstraints)
|
|
|
{
|
|
|
+ if (typeInst->IsInterface())
|
|
|
+ AddInterfaces(srcType, typeInst->ToTypeInstance());
|
|
|
Entry entry(srcType, typeInst);
|
|
|
if ((typeInst != NULL) && (!mManualList.Contains(entry)))
|
|
|
mManualList.Add(entry);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void BfBaseClassWalker::AddInterfaces(BfType* srcType, BfTypeInstance* typeInst)
|
|
|
+{
|
|
|
+ for (auto ifaceEntry : typeInst->mInterfaces)
|
|
|
+ {
|
|
|
+ Entry entry(srcType, ifaceEntry.mInterfaceType);
|
|
|
+ if ((typeInst != NULL) && (!mManualList.Contains(entry)))
|
|
|
+ mManualList.Add(entry);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
BfBaseClassWalker::Entry BfBaseClassWalker::Next()
|
|
|
{
|
|
|
if (!mManualList.IsEmpty())
|