1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed global lookup in default param values

This commit is contained in:
Brian Fiete 2021-02-13 07:24:26 -08:00
parent 1d5bb1fade
commit 6e58454825

View file

@ -22002,6 +22002,12 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
}
else
{
BfTypeState typeState;
typeState.mTypeInstance = mCurTypeInstance;
typeState.mCurTypeDef = methodDef->mDeclaringType;
//typeState.mCurMethodDef = methodDef;
SetAndRestoreValue<BfTypeState*> prevTypeState(mContext->mCurTypeState, &typeState);
BfConstResolver constResolver(this);
defaultValue = constResolver.Resolve(paramDef->mParamDeclaration->mInitializer, resolvedParamType, (BfConstResolveFlags)(BfConstResolveFlag_NoCast | BfConstResolveFlag_AllowGlobalVariable));
if ((defaultValue) && (defaultValue.mType != resolvedParamType))