mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed 'new' method specifier in extensions for generic types
This commit is contained in:
parent
fc66c7757b
commit
7093476126
1 changed files with 10 additions and 6 deletions
|
@ -22367,8 +22367,13 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto checkMethodInstance = typeInstance->mMethodInstanceGroups[checkMethod->mIdx].mDefault;
|
auto checkMethodInstance = typeInstance->mMethodInstanceGroups[checkMethod->mIdx].mDefault;
|
||||||
|
if (checkMethodInstance == NULL)
|
||||||
|
{
|
||||||
|
if ((methodDef->mIsNew) && (methodDef->mDeclaringType->IsExtension()) && (!checkMethod->mDeclaringType->IsExtension()))
|
||||||
|
checkMethodInstance = GetRawMethodInstanceAtIdx(typeInstance, checkMethod->mIdx);
|
||||||
if (checkMethodInstance == NULL)
|
if (checkMethodInstance == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (((checkMethodInstance->mChainType == BfMethodChainType_None) || (checkMethodInstance->mChainType == BfMethodChainType_ChainHead)) &&
|
if (((checkMethodInstance->mChainType == BfMethodChainType_None) || (checkMethodInstance->mChainType == BfMethodChainType_ChainHead)) &&
|
||||||
(checkMethodInstance->GetExplicitInterface() == methodInstance->GetExplicitInterface()) &&
|
(checkMethodInstance->GetExplicitInterface() == methodInstance->GetExplicitInterface()) &&
|
||||||
|
@ -22436,7 +22441,9 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
||||||
if ((methodDef->mMethodType == BfMethodType_Ctor) && (methodDef->mIsStatic))
|
if ((methodDef->mMethodType == BfMethodType_Ctor) && (methodDef->mIsStatic))
|
||||||
silentlyAllow = true;
|
silentlyAllow = true;
|
||||||
else if (methodDef->mIsNew)
|
else if (methodDef->mIsNew)
|
||||||
|
{
|
||||||
silentlyAllow = true;
|
silentlyAllow = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
extensionWarn = true;
|
extensionWarn = true;
|
||||||
}
|
}
|
||||||
|
@ -22478,8 +22485,6 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
||||||
auto baseType = typeInstance->mBaseType;
|
auto baseType = typeInstance->mBaseType;
|
||||||
while (baseType != NULL)
|
while (baseType != NULL)
|
||||||
{
|
{
|
||||||
//for (int checkMethodIdx = 0; checkMethodIdx < (int) baseType->mTypeDef->mMethods.size(); checkMethodIdx++)
|
|
||||||
|
|
||||||
auto baseTypeDef = baseType->mTypeDef;
|
auto baseTypeDef = baseType->mTypeDef;
|
||||||
baseTypeDef->PopulateMemberSets();
|
baseTypeDef->PopulateMemberSets();
|
||||||
BfMethodDef* checkMethod = NULL;
|
BfMethodDef* checkMethod = NULL;
|
||||||
|
@ -22533,8 +22538,7 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
|
||||||
baseType = baseType->mBaseType;
|
baseType = baseType->mBaseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((methodDef->mIsNew) && (!foundHiddenMethod) && (!mCurTypeInstance->IsSpecializedType()))
|
||||||
if ((methodDef->mIsNew) && (!foundHiddenMethod))
|
|
||||||
{
|
{
|
||||||
auto propertyDeclaration = methodDef->GetPropertyDeclaration();
|
auto propertyDeclaration = methodDef->GetPropertyDeclaration();
|
||||||
auto tokenNode = (propertyDeclaration != NULL) ? propertyDeclaration->mNewSpecifier :
|
auto tokenNode = (propertyDeclaration != NULL) ? propertyDeclaration->mNewSpecifier :
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue