mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Disallowing generic arguments on ctors/dtors
This commit is contained in:
parent
81e9438823
commit
c4544f67d3
1 changed files with 14 additions and 1 deletions
|
@ -584,7 +584,20 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
|
|||
int outerGenericSize = 0;
|
||||
if (outerMethodDef != NULL)
|
||||
outerGenericSize = (int)outerMethodDef->mGenericParams.size();
|
||||
|
||||
if ((methodDef->mMethodType == BfMethodType_Normal) ||
|
||||
(methodDef->mMethodType == BfMethodType_Operator) ||
|
||||
(methodDef->mMethodType == BfMethodType_Mixin))
|
||||
{
|
||||
ParseGenericParams(methodDeclaration->mGenericParams, methodDeclaration->mGenericConstraintsDeclaration, methodDef->mGenericParams, &methodDef->mExternalConstraints, outerGenericSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (methodDeclaration->mGenericParams != NULL)
|
||||
Fail("Generic parameters are only allowed on normal methods", methodDeclaration->mGenericParams);
|
||||
if (methodDeclaration->mGenericConstraintsDeclaration != NULL)
|
||||
Fail("Generic constraints are only allowed on normal methods", methodDeclaration->mGenericConstraintsDeclaration);
|
||||
}
|
||||
|
||||
bool didDefaultsError = false;
|
||||
bool hadParams = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue