mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fix generic binding in generic mixins
This commit is contained in:
parent
627b0381f8
commit
51eaa6276f
3 changed files with 47 additions and 4 deletions
|
@ -5206,7 +5206,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
auto resolvedFieldType = fieldInstance->GetResolvedType();
|
||||
if ((!typeInstance->IsBoxed()) && (fieldDef != NULL))
|
||||
{
|
||||
if ((fieldDef->mUsingProtection != BfProtection_Hidden) && (!resolvedFieldType->IsGenericParam()) && (!resolvedFieldType->IsObject()))
|
||||
if ((fieldDef->mUsingProtection != BfProtection_Hidden) && (!resolvedFieldType->IsGenericParam()) && (!resolvedFieldType->IsObject()) && (!resolvedFieldType->IsStruct()))
|
||||
Warn(0, StrFormat("Field type '%s' is not applicable for 'using'", TypeToString(resolvedFieldType).c_str()), fieldDef->GetFieldDeclaration()->mConstSpecifier);
|
||||
|
||||
if (fieldInstance->mIsEnumPayloadCase)
|
||||
|
@ -9315,12 +9315,16 @@ BfGenericParamInstance* BfModule::GetGenericParamInstance(BfGenericParamType* ty
|
|||
{
|
||||
if (type->mGenericParamKind == BfGenericParamKind_Method)
|
||||
{
|
||||
if ((mCurMethodInstance == NULL) || (mCurMethodInstance->mMethodInfoEx == NULL) || (type->mGenericParamIdx >= mCurMethodInstance->mMethodInfoEx->mGenericParams.mSize))
|
||||
auto curGenericMethodInstance = mCurMethodInstance;
|
||||
if ((mCurMethodState != NULL) && (mCurMethodState->mMixinState != NULL))
|
||||
curGenericMethodInstance = mCurMethodState->mMixinState->mMixinMethodInstance;
|
||||
|
||||
if ((curGenericMethodInstance == NULL) || (curGenericMethodInstance->mMethodInfoEx == NULL) || (type->mGenericParamIdx >= curGenericMethodInstance->mMethodInfoEx->mGenericParams.mSize))
|
||||
{
|
||||
FatalError("Invalid GetGenericParamInstance method generic param");
|
||||
return NULL;
|
||||
}
|
||||
return mCurMethodInstance->mMethodInfoEx->mGenericParams[type->mGenericParamIdx];
|
||||
return curGenericMethodInstance->mMethodInfoEx->mGenericParams[type->mGenericParamIdx];
|
||||
}
|
||||
|
||||
return GetGenericTypeParamInstance(type->mGenericParamIdx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue