1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed mixin const evaluation

This commit is contained in:
Brian Fiete 2020-06-03 05:22:29 -07:00
parent e1c340a711
commit 78bb60cddc

View file

@ -3755,6 +3755,7 @@ BfTypedValue BfModule::GetFieldInitializerValue(BfFieldInstance* fieldInstance,
// auto-created underlying type and it will cause an 'error flash'. We defer errors until the full resolve for that purpose
resolveFlags = BfConstResolveFlag_NoCast;
}
UpdateSrcPos(initializer);
return constResolver.Resolve(initializer, fieldType, resolveFlags);
}
}
@ -9333,7 +9334,7 @@ String BfModule::MethodToString(BfMethodInstance* methodInst, BfMethodNameFlags
methodName = TypeToString(type, typeNameFlags);
if (methodName == "$")
methodName = "";
else
else if (!methodName.IsEmpty())
methodName += ".";
}
String accessorString;
@ -12608,6 +12609,8 @@ BfLocalVariable* BfModule::AddLocalVariableDef(BfLocalVariable* localVarDef, boo
}
}
if (!mBfIRBuilder->mIgnoreWrites)
{
auto diVariable = mBfIRBuilder->DbgCreateAutoVariable(mCurMethodState->mCurScope->mDIScope,
localVarDef->mName, mCurFilePosition.mFileInstance->mDIFile, mCurFilePosition.mCurLine, diType, initType);
localVarDef->mDbgVarInst = diVariable;
@ -12638,6 +12641,7 @@ BfLocalVariable* BfModule::AddLocalVariableDef(BfLocalVariable* localVarDef, boo
}
}
}
}
localVarDef->mDeclBlock = mBfIRBuilder->GetInsertBlock();
DoAddLocalVariable(localVarDef);
@ -19488,7 +19492,8 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
}
BfType* resolvedReturnType = NULL;
if (((methodDef->mMethodType == BfMethodType_Normal) || (methodDef->mMethodType == BfMethodType_CtorCalcAppend) || (methodDef->mMethodType == BfMethodType_PropertyGetter) || (methodDef->mMethodType == BfMethodType_Operator)) &&
if (((methodDef->mMethodType == BfMethodType_Normal) || (methodDef->mMethodType == BfMethodType_Extension) || (methodDef->mMethodType == BfMethodType_CtorCalcAppend) ||
(methodDef->mMethodType == BfMethodType_PropertyGetter) || (methodDef->mMethodType == BfMethodType_Operator)) &&
(methodDef->mReturnTypeRef != NULL))
{
SetAndRestoreValue<bool> prevIngoreErrors(mIgnoreErrors, mIgnoreErrors || (methodDef->GetPropertyDeclaration() != NULL));