|
@@ -1502,6 +1502,10 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|
|
|
|
|
for (auto baseTypeRef : typeDef->mBaseTypes)
|
|
for (auto baseTypeRef : typeDef->mBaseTypes)
|
|
{
|
|
{
|
|
|
|
+ SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, baseTypeRef);
|
|
|
|
+ SetAndRestoreValue<bool> prevIgnoreError(mIgnoreErrors, true);
|
|
|
|
+ SetAndRestoreValue<bool> prevSkipTypeProtectionChecks(typeInstance->mSkipTypeProtectionChecks, true);
|
|
|
|
+
|
|
auto baseType = ResolveTypeRef(baseTypeRef, BfPopulateType_Declaration);
|
|
auto baseType = ResolveTypeRef(baseTypeRef, BfPopulateType_Declaration);
|
|
if (baseType != NULL)
|
|
if (baseType != NULL)
|
|
{
|
|
{
|
|
@@ -3811,6 +3815,10 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
|
|
if (ifaceMethodInst == NULL)
|
|
if (ifaceMethodInst == NULL)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
|
|
+ // Don't even try to match generics
|
|
|
|
+ if (!ifaceMethodInst->mMethodDef->mGenericParams.IsEmpty())
|
|
|
|
+ continue;
|
|
|
|
+
|
|
auto iReturnType = ifaceMethodInst->mReturnType;
|
|
auto iReturnType = ifaceMethodInst->mReturnType;
|
|
if (iReturnType->IsSelf())
|
|
if (iReturnType->IsSelf())
|
|
iReturnType = typeInstance;
|
|
iReturnType = typeInstance;
|
|
@@ -3931,7 +3939,7 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if ((bestMethodInst->mMethodDef->HasBody()) && (matchedMethod == NULL))
|
|
|
|
|
|
+ if ((bestMethodInst->mMethodDef->HasBody()) && (bestMethodInst->mMethodDef->mGenericParams.size() == 0) && (matchedMethod == NULL))
|
|
{
|
|
{
|
|
auto methodDef = bestMethodInst->mMethodDef;
|
|
auto methodDef = bestMethodInst->mMethodDef;
|
|
BfGetMethodInstanceFlags flags = BfGetMethodInstanceFlag_ForeignMethodDef;
|
|
BfGetMethodInstanceFlags flags = BfGetMethodInstanceFlag_ForeignMethodDef;
|
|
@@ -3939,10 +3947,10 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance)
|
|
flags = (BfGetMethodInstanceFlags)(flags | BfGetMethodInstanceFlag_UnspecializedPass);
|
|
flags = (BfGetMethodInstanceFlags)(flags | BfGetMethodInstanceFlag_UnspecializedPass);
|
|
auto methodInst = GetMethodInstance(typeInstance, methodDef, BfTypeVector(), flags, ifaceInst);
|
|
auto methodInst = GetMethodInstance(typeInstance, methodDef, BfTypeVector(), flags, ifaceInst);
|
|
if (methodInst)
|
|
if (methodInst)
|
|
- {
|
|
|
|
|
|
+ {
|
|
*matchedMethodRef = methodInst.mMethodInstance;
|
|
*matchedMethodRef = methodInst.mMethodInstance;
|
|
|
|
|
|
- BfMethodInstance* newMethodInstance = *matchedMethodRef;
|
|
|
|
|
|
+ BfMethodInstance* newMethodInstance = methodInst.mMethodInstance;
|
|
BF_ASSERT(newMethodInstance->mIsForeignMethodDef);
|
|
BF_ASSERT(newMethodInstance->mIsForeignMethodDef);
|
|
if (newMethodInstance->mMethodInstanceGroup->mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingReference)
|
|
if (newMethodInstance->mMethodInstanceGroup->mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingReference)
|
|
mOnDemandMethodCount++;
|
|
mOnDemandMethodCount++;
|
|
@@ -4053,7 +4061,7 @@ void BfModule::AddMethodToWorkList(BfMethodInstance* methodInstance)
|
|
return;
|
|
return;
|
|
|
|
|
|
BF_ASSERT(mCompiler->mCompileState != BfCompiler::CompileState_VData);
|
|
BF_ASSERT(mCompiler->mCompileState != BfCompiler::CompileState_VData);
|
|
- if (methodInstance->mIsReified)
|
|
|
|
|
|
+ if ((methodInstance->mIsReified) && (!methodInstance->mIsUnspecialized))
|
|
{
|
|
{
|
|
BF_ASSERT(mCompiler->mCompileState != BfCompiler::CompileState_Unreified);
|
|
BF_ASSERT(mCompiler->mCompileState != BfCompiler::CompileState_Unreified);
|
|
}
|
|
}
|