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

Method TypeRefNotFound

IDEHelper/Compiler/BfModuleTypeUtils.cpp:10791–10826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10789}
10790
10791void BfModule::TypeRefNotFound(BfTypeReference* typeRef, const char* appendName)
10792{
10793 if (typeRef->IsTemporary())
10794 return;
10795
10796 if (PreFail())
10797 Fail("Type could not be found (are you missing a using directive or library reference?)", typeRef);
10798
10799 if (!mIgnoreErrors)
10800 {
10801 while (auto elementedType = BfNodeDynCast<BfElementedTypeRef>(typeRef))
10802 typeRef = elementedType->mElementType;
10803
10804 if (auto namedTypeRef = BfNodeDynCast<BfNamedTypeReference>(typeRef))
10805 {
10806 String findNameStr = namedTypeRef->mNameNode->ToString();
10807 if (appendName != NULL)
10808 findNameStr += appendName;
10809 BfSizedAtomComposite findName;
10810 if ((!mSystem->ParseAtomComposite(findNameStr, findName)) && (mCurTypeInstance != NULL))
10811 {
10812 //BfTypeInstance* typeInstance = (typeInstanceOverride != NULL) ? typeInstanceOverride : mCurTypeInstance;
10813 // We don't need a typeInstanceOverride because that is used to lookup references
10814 // from mixins, but it's the type using the mixin (mCurTypeInstance) that needs
10815 // rebuilding if the lookup fails
10816 BfTypeInstance* typeInstance = mCurTypeInstance;
10817 BfTypeLookupEntry typeLookupEntry;
10818 typeLookupEntry.mNumGenericParams = 0;
10819 typeLookupEntry.mAtomUpdateIdx = mSystem->mAtomUpdateIdx;
10820 typeInstance->mLookupResults.TryAdd(typeLookupEntry, BfTypeLookupResult());
10821 }
10822 }
10823 }
10824
10825 CheckTypeRefFixit(typeRef, appendName);
10826}
10827
10828bool BfModule::ValidateTypeWildcard(BfAstNode* typeRef, bool isAttributeRef)
10829{

Callers

nothing calls this directly

Calls 6

FailFunction · 0.85
BfTypeLookupResultClass · 0.85
ParseAtomCompositeMethod · 0.80
IsTemporaryMethod · 0.45
ToStringMethod · 0.45
TryAddMethod · 0.45

Tested by

no test coverage detected