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

Protect against invalid fixit for adding method

This commit is contained in:
Brian Fiete 2020-09-09 23:52:21 -07:00
parent be093b6bde
commit c34e6fe66a

View file

@ -7529,7 +7529,8 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
if (targetType != NULL) if (targetType != NULL)
{ {
auto typeInst = targetType->ToTypeInstance(); auto typeInst = targetType->ToTypeInstance();
if ((targetType != NULL) && (!methodName.IsEmpty()))
{
BfTypeVector paramTypes; BfTypeVector paramTypes;
for (int argIdx = 0; argIdx < (int)argValues.mResolvedArgs.size(); argIdx++) for (int argIdx = 0; argIdx < (int)argValues.mResolvedArgs.size(); argIdx++)
{ {
@ -7540,6 +7541,7 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
autoComplete->FixitAddMethod(typeInst, methodName, mExpectingType, paramTypes, wantStatic); autoComplete->FixitAddMethod(typeInst, methodName, mExpectingType, paramTypes, wantStatic);
} }
} }
}
if (methodName.IsEmpty()) if (methodName.IsEmpty())
{ {