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

Fixed autocomplete generic extension regression

This commit is contained in:
Brian Fiete 2022-06-11 05:44:34 -07:00
parent 35a81b7bbe
commit 4f978c5053

View file

@ -8889,9 +8889,11 @@ BfGenericParamInstance* BfModule::GetGenericTypeParamInstance(int genericParamId
if (genericTypeInst->mGenericTypeInfo->mGenericExtensionInfo != NULL)
{
bool isAutocomplete = (mCompiler->mResolvePassData != NULL) && (mCompiler->mResolvePassData->mAutoComplete != NULL);
auto activeTypeDef = GetActiveTypeDef(NULL, true);
if ((activeTypeDef->mTypeDeclaration != genericTypeInst->mTypeDef->mTypeDeclaration) && (activeTypeDef->IsExtension()) &&
(genericTypeInst->mTypeDef->ContainsPartial(activeTypeDef)))
((genericTypeInst->mTypeDef->ContainsPartial(activeTypeDef)) || (isAutocomplete)))
{
BfTypeDef* lookupTypeDef = activeTypeDef;
while (lookupTypeDef->mNestDepth > genericTypeInst->mTypeDef->mNestDepth)
@ -8904,7 +8906,7 @@ BfGenericParamInstance* BfModule::GetGenericTypeParamInstance(int genericParamId
}
else
{
if ((mCompiler->mResolvePassData == NULL) || (mCompiler->mResolvePassData->mAutoComplete == NULL))
if (!isAutocomplete)
{
FatalError("Invalid GetGenericParamInstance with extension");
}