1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Changed array to Ordered instead of CRepr

This commit is contained in:
Brian Fiete 2020-04-04 12:14:52 -07:00
parent 36c99d2088
commit 15c3ad98de
6 changed files with 121 additions and 44 deletions

View file

@ -2622,6 +2622,14 @@ BfError* BfModule::Fail(const StringImpl& error, BfAstNode* refNode, bool isPers
return bfError;
}
BfError* BfModule::FailInternal(const StringImpl& error, BfAstNode* refNode)
{
if (mHadBuildError)
return NULL;
return Fail(error, refNode);
}
BfError* BfModule::FailAfter(const StringImpl& error, BfAstNode* refNode)
{
if (mIgnoreErrors)
@ -9059,29 +9067,6 @@ bool BfModule::HasMixin(BfTypeInstance* typeInstance, const StringImpl& methodNa
return BfModuleMethodInstance();
}
BfFieldInstance* BfModule::GetFieldByName(BfTypeInstance* typeInstance, const StringImpl& fieldName)
{
PopulateType(typeInstance, BfPopulateType_DataAndMethods);
typeInstance->mTypeDef->PopulateMemberSets();
BfMemberSetEntry* entry = NULL;
BfFieldDef* fieldDef = NULL;
if (typeInstance->mTypeDef->mFieldSet.TryGetWith(fieldName, &entry))
{
fieldDef = (BfFieldDef*)entry->mMemberDef;
return &typeInstance->mFieldInstances[fieldDef->mIdx];
}
// for (auto& fieldInst : typeInstance->mFieldInstances)
// {
// auto fieldDef = fieldInst.GetFieldDef();
// if ((fieldDef != NULL) && (fieldDef->mName == fieldName))
// return &fieldInst;
// }
return NULL;
}
String BfModule::MethodToString(BfMethodInstance* methodInst, BfMethodNameFlags methodNameFlags, BfTypeVector* methodGenericArgs)
{
auto methodDef = methodInst->mMethodDef;