mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Fixed constraints on generic delegates
This commit is contained in:
parent
b722614501
commit
6302416e40
2 changed files with 18 additions and 3 deletions
|
@ -8445,12 +8445,18 @@ void BfCompiler::GenerateAutocompleteInfo()
|
||||||
if (checkMethodInstance->GetNumGenericParams() == 0)
|
if (checkMethodInstance->GetNumGenericParams() == 0)
|
||||||
checkMethodInstance = methodEntry.mCurMethodInstance;
|
checkMethodInstance = methodEntry.mCurMethodInstance;
|
||||||
|
|
||||||
|
bool handled = false;
|
||||||
if (genericParamType->mGenericParamIdx < checkMethodInstance->GetNumGenericParams())
|
if (genericParamType->mGenericParamIdx < checkMethodInstance->GetNumGenericParams())
|
||||||
{
|
{
|
||||||
auto genericParamInstance = checkMethodInstance->mMethodInfoEx->mGenericParams[genericParamType->mGenericParamIdx];
|
auto genericParamInstance = checkMethodInstance->mMethodInfoEx->mGenericParams[genericParamType->mGenericParamIdx];
|
||||||
methodText += genericParamInstance->GetGenericParamDef()->mName;
|
auto genericParamDef = genericParamInstance->GetGenericParamDef();
|
||||||
|
if (genericParamDef != NULL)
|
||||||
|
{
|
||||||
|
methodText += genericParamDef->mName;
|
||||||
|
handled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
if (!handled)
|
||||||
{
|
{
|
||||||
methodText += StrFormat("@M%d", genericParamType->mGenericParamIdx);
|
methodText += StrFormat("@M%d", genericParamType->mGenericParamIdx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8866,7 +8866,16 @@ BfAstNode* BfReducer::CreateTopLevelObject(BfTokenNode* tokenNode, BfAttributeDi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ParseMethod(methodDecl, ¶ms, &commas))
|
bool failed = ParseMethod(methodDecl, ¶ms, &commas);
|
||||||
|
|
||||||
|
if (methodDecl->mGenericConstraintsDeclaration != NULL)
|
||||||
|
{
|
||||||
|
typeDeclaration->mGenericConstraintsDeclaration = methodDecl->mGenericConstraintsDeclaration;
|
||||||
|
typeDeclaration->SetSrcEnd(methodDecl->GetSrcEnd());
|
||||||
|
methodDecl->mGenericConstraintsDeclaration = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (failed)
|
||||||
return typeDeclaration;
|
return typeDeclaration;
|
||||||
|
|
||||||
if (methodDecl->mEndSemicolon == NULL)
|
if (methodDecl->mEndSemicolon == NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue