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

Method Finish

IDEHelper/Compiler/BfModule.cpp:401–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399}
400
401void BfAmbiguityContext::Finish()
402{
403 for (auto& entryPair : mEntries)
404 {
405 int id = entryPair.mKey;
406 auto entry = &entryPair.mValue;
407
408 if (id >= 0)
409 {
410 auto declMethodInstance = mTypeInstance->mVirtualMethodTable[id].mDeclaringMethod;
411 auto error = mModule->Fail(StrFormat("Method '%s' has ambiguous overrides", mModule->MethodToString(declMethodInstance).c_str()), declMethodInstance->mMethodDef->GetRefNode());
412 if (error != NULL)
413 {
414 for (auto candidate : entry->mCandidates)
415 {
416 mModule->mCompiler->mPassInstance->MoreInfo(StrFormat("'%s' is a candidate",
417 mModule->MethodToString(candidate, (BfMethodNameFlags)(BfMethodNameFlag_ResolveGenericParamNames | BfMethodNameFlag_IncludeReturnType)).c_str()), candidate->mMethodDef->GetRefNode());
418 }
419 }
420 }
421 else
422 {
423 auto iMethodInst = entry->mInterfaceEntry->mInterfaceType->mMethodInstanceGroups[entry->mMethodIdx].mDefault;
424 auto error = mModule->Fail(StrFormat("Interface method '%s' has ambiguous implementations", mModule->MethodToString(iMethodInst).c_str()), entry->mInterfaceEntry->mDeclaringType->GetRefNode());
425 if (error != NULL)
426 {
427 for (auto candidate : entry->mCandidates)
428 {
429 mModule->mCompiler->mPassInstance->MoreInfo(StrFormat("'%s' is a candidate",
430 mModule->MethodToString(candidate, (BfMethodNameFlags)(BfMethodNameFlag_ResolveGenericParamNames | BfMethodNameFlag_IncludeReturnType)).c_str()), candidate->mMethodDef->GetRefNode());
431 }
432 }
433 }
434 }
435 mEntries.Clear();
436}
437
438//////////////////////////////////////////////////////////////////////////
439

Callers 7

CreateTypeDataMethod · 0.45
ResolveTypeMethod · 0.45
ResolveTypeRef_RefMethod · 0.45
DoCompileMethod · 0.45
VisitMethod · 0.45
GetLambdaInstanceMethod · 0.45

Calls 15

MethodToStringMethod · 0.80
MoreInfoMethod · 0.80
DbgHasInfoMethod · 0.80
DbgFinalizeMethod · 0.80
HasExportsMethod · 0.80
GetDynCastVDataCountMethod · 0.80
GenerateHashMethod · 0.80
FailMethod · 0.45
c_strMethod · 0.45
GetRefNodeMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected