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

Handled generic depth limitation for pointers, delegates, tuples, arrays

This commit is contained in:
Brian Fiete 2022-02-08 10:33:20 -05:00
parent dcafa5f9ca
commit ceb400d573
5 changed files with 74 additions and 42 deletions

View file

@ -578,7 +578,7 @@ bool BfCompiler::IsTypeUsed(BfType* checkType, BfProject* curProject)
if (checkType->IsPointer()) if (checkType->IsPointer())
return IsTypeUsed(((BfPointerType*)checkType)->mElementType, curProject); return IsTypeUsed(((BfPointerType*)checkType)->mElementType, curProject);
if (checkType->IsRef()) if (checkType->IsRef())
return IsTypeUsed(((BfPointerType*)checkType)->mElementType, curProject); return IsTypeUsed(((BfRefType*)checkType)->mElementType, curProject);
return true; return true;
} }

View file

@ -15196,19 +15196,11 @@ BfTypedValue BfExprEvaluator::MakeCallableTarget(BfAstNode* targetSrc, BfTypedVa
{ {
auto underlying = target.mType->GetUnderlyingType(); auto underlying = target.mType->GetUnderlyingType();
bool underlyingIsStruct = underlying->IsStruct(); bool underlyingIsStruct = underlying->IsStruct();
// if (underlying->IsGenericParam())
// {
// auto genericParam = mModule->GetGenericParamInstance((BfGenericParamType*)underlying);
// if (((genericParam->mTypeConstraint != NULL) && (genericParam->mTypeConstraint->IsValueType())) ||
// ((genericParam->mGenericParamFlags & (BfGenericParamFlag_Struct)) != 0))
// underlyingIsStruct = true;
// }
if (underlyingIsStruct) if (underlyingIsStruct)
{ {
auto pointerType = (BfPointerType*)target.mType;
target = mModule->LoadValue(target); target = mModule->LoadValue(target);
target.mType = pointerType->mElementType; target.mType = underlying;
target.mKind = BfTypedValueKind_Addr; target.mKind = BfTypedValueKind_Addr;
} }
} }

View file

@ -7930,7 +7930,7 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
auto baseType = (BfTypeInstance*)ResolveTypeDef(mContext->mCompiler->mValueTypeTypeDef); auto baseType = (BfTypeInstance*)ResolveTypeDef(mContext->mCompiler->mValueTypeTypeDef);
BfTypeInstance* tupleType = NULL; BfTupleType* tupleType = NULL;
if (wantGeneric) if (wantGeneric)
{ {
Array<BfType*> genericArgs; Array<BfType*> genericArgs;
@ -7950,6 +7950,7 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
auto actualTupleType = mContext->mTupleTypePool.Get(); auto actualTupleType = mContext->mTupleTypePool.Get();
delete actualTupleType->mGenericTypeInfo; delete actualTupleType->mGenericTypeInfo;
actualTupleType->mGenericDepth = 0;
actualTupleType->mGenericTypeInfo = new BfGenericTypeInfo(); actualTupleType->mGenericTypeInfo = new BfGenericTypeInfo();
actualTupleType->mGenericTypeInfo->mIsUnspecialized = false; actualTupleType->mGenericTypeInfo->mIsUnspecialized = false;
actualTupleType->mGenericTypeInfo->mIsUnspecializedVariation = false; actualTupleType->mGenericTypeInfo->mIsUnspecializedVariation = false;
@ -8005,6 +8006,7 @@ BfType* BfModule::ResolveGenericType(BfType* unspecializedType, BfTypeVector* ty
fieldInstance->mFieldIdx = fieldIdx; fieldInstance->mFieldIdx = fieldIdx;
fieldInstance->SetResolvedType(fieldTypes[fieldIdx]); fieldInstance->SetResolvedType(fieldTypes[fieldIdx]);
fieldInstance->mOwner = tupleType; fieldInstance->mOwner = tupleType;
tupleType->mGenericDepth = BF_MAX(tupleType->mGenericDepth, fieldInstance->mResolvedType->GetGenericDepth() + 1);
} }
bool failed = false; bool failed = false;
@ -10556,6 +10558,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
arrayType->mElementType = elementType; arrayType->mElementType = elementType;
arrayType->mElementCount = elementCount; arrayType->mElementCount = elementCount;
arrayType->mWantsGCMarking = false; // Fill in in InitType arrayType->mWantsGCMarking = false; // Fill in in InitType
arrayType->mGenericDepth = elementType->GetGenericDepth() + 1;
resolvedEntry->mValue = arrayType; resolvedEntry->mValue = arrayType;
BF_ASSERT(BfResolvedTypeSet::Hash(arrayType, &lookupCtx) == resolvedEntry->mHash); BF_ASSERT(BfResolvedTypeSet::Hash(arrayType, &lookupCtx) == resolvedEntry->mHash);
@ -10724,11 +10727,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
{ {
auto genericArg = genericArgs[genericParamIdx + startDefGenericParamIdx]; auto genericArg = genericArgs[genericParamIdx + startDefGenericParamIdx];
if (auto genericGenericArg = genericArg->ToGenericTypeInstance()) genericTypeInst->mGenericTypeInfo->mMaxGenericDepth = BF_MAX(genericTypeInst->mGenericTypeInfo->mMaxGenericDepth, genericArg->GetGenericDepth() + 1);
{
genericTypeInst->mGenericTypeInfo->mMaxGenericDepth = BF_MAX(genericTypeInst->mGenericTypeInfo->mMaxGenericDepth, genericGenericArg->mGenericTypeInfo->mMaxGenericDepth + 1);
}
genericTypeInst->mGenericTypeInfo->mTypeGenericArguments.push_back(genericArg); genericTypeInst->mGenericTypeInfo->mTypeGenericArguments.push_back(genericArg);
genericTypeInst->mGenericTypeInfo->mTypeGenericArgumentRefs.push_back(genericArgRef); genericTypeInst->mGenericTypeInfo->mTypeGenericArgumentRefs.push_back(genericArgRef);
@ -10814,7 +10813,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
wantGeneric = false; wantGeneric = false;
auto baseType = (BfTypeInstance*)ResolveTypeDef(mContext->mCompiler->mValueTypeTypeDef, BfPopulateType_Identity); auto baseType = (BfTypeInstance*)ResolveTypeDef(mContext->mCompiler->mValueTypeTypeDef, BfPopulateType_Identity);
BfTypeInstance* tupleType = NULL; BfTupleType* tupleType = NULL;
if (wantGeneric) if (wantGeneric)
{ {
BfTupleType* actualTupleType = new BfTupleType(); BfTupleType* actualTupleType = new BfTupleType();
@ -10873,6 +10872,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
fieldInstance->SetResolvedType(types[fieldIdx]); fieldInstance->SetResolvedType(types[fieldIdx]);
BF_ASSERT(!types[fieldIdx]->IsVar()); BF_ASSERT(!types[fieldIdx]->IsVar());
fieldInstance->mOwner = tupleType; fieldInstance->mOwner = tupleType;
tupleType->mGenericDepth = BF_MAX(tupleType->mGenericDepth, fieldInstance->mResolvedType->GetGenericDepth() + 1);
} }
resolvedEntry->mValue = tupleType; resolvedEntry->mValue = tupleType;
@ -10928,6 +10928,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
return ResolveTypeResult(typeRef, elementType, populateType, resolveFlags); return ResolveTypeResult(typeRef, elementType, populateType, resolveFlags);
} }
pointerType->mGenericDepth = elementType->GetGenericDepth() + 1;
pointerType->mElementType = elementType; pointerType->mElementType = elementType;
pointerType->mContext = mContext; pointerType->mContext = mContext;
resolvedEntry->mValue = pointerType; resolvedEntry->mValue = pointerType;
@ -11070,7 +11071,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
failed = true; failed = true;
BfDelegateInfo* delegateInfo = NULL; BfDelegateInfo* delegateInfo = NULL;
BfTypeInstance* delegateType = NULL; BfDelegateType* delegateType = NULL;
if (wantGeneric) if (wantGeneric)
{ {
BfDelegateType* genericTypeInst = new BfDelegateType(); BfDelegateType* genericTypeInst = new BfDelegateType();
@ -11164,6 +11165,8 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
delegateInfo->mHasExplicitThis = functionThisType != NULL; delegateInfo->mHasExplicitThis = functionThisType != NULL;
delegateInfo->mHasVarArgs = hasVarArgs; delegateInfo->mHasVarArgs = hasVarArgs;
delegateType->mGenericDepth = BF_MAX(delegateType->mGenericDepth, returnType->GetGenericDepth() + 1);
auto hashVal = mContext->mResolvedTypes.Hash(typeRef, &lookupCtx); auto hashVal = mContext->mResolvedTypes.Hash(typeRef, &lookupCtx);
//int paramSrcOfs = (functionThisType != NULL) ? 1 : 0; //int paramSrcOfs = (functionThisType != NULL) ? 1 : 0;
@ -11195,6 +11198,8 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
methodDef->mParams.push_back(paramDef); methodDef->mParams.push_back(paramDef);
delegateInfo->mParams.Add(paramType); delegateInfo->mParams.Add(paramType);
delegateType->mGenericDepth = BF_MAX(delegateType->mGenericDepth, paramType->GetGenericDepth() + 1);
} }
if (delegateInfo->mHasVarArgs) if (delegateInfo->mHasVarArgs)

View file

@ -2706,6 +2706,7 @@ BfTupleType::BfTupleType()
mTypeDef = NULL; mTypeDef = NULL;
mIsUnspecializedType = false; mIsUnspecializedType = false;
mIsUnspecializedTypeVariation = false; mIsUnspecializedTypeVariation = false;
mGenericDepth = 0;
} }
BfTupleType::~BfTupleType() BfTupleType::~BfTupleType()
@ -2974,7 +2975,7 @@ int BfResolvedTypeSet::DoHash(BfType* type, LookupContext* ctx, bool allowRef, i
auto delegateInfo = type->GetDelegateInfo(); auto delegateInfo = type->GetDelegateInfo();
hashVal = ((hashVal ^ (Hash(delegateInfo->mReturnType, ctx, BfHashFlag_None, hashSeed))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, Hash(delegateInfo->mReturnType, ctx, BfHashFlag_None, hashSeed + 1));
auto methodDef = typeInst->mTypeDef->mMethods[0]; auto methodDef = typeInst->mTypeDef->mMethods[0];
BF_ASSERT(methodDef->mName == "Invoke"); BF_ASSERT(methodDef->mName == "Invoke");
@ -2988,14 +2989,14 @@ int BfResolvedTypeSet::DoHash(BfType* type, LookupContext* ctx, bool allowRef, i
for (int paramIdx = 0; paramIdx < delegateInfo->mParams.size(); paramIdx++) for (int paramIdx = 0; paramIdx < delegateInfo->mParams.size(); paramIdx++)
{ {
// Parse attributes? // Parse attributes?
hashVal = ((hashVal ^ (Hash(delegateInfo->mParams[paramIdx], ctx, BfHashFlag_None, hashSeed))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, Hash(delegateInfo->mParams[paramIdx], ctx, BfHashFlag_None, hashSeed + 1));
String paramName = methodDef->mParams[paramIdx]->mName; String paramName = methodDef->mParams[paramIdx]->mName;
int nameHash = (int)Hash64(paramName.c_str(), (int)paramName.length()); int nameHash = (int)Hash64(paramName.c_str(), (int)paramName.length());
hashVal = ((hashVal ^ (nameHash)) << 5) - hashVal; hashVal = HASH_MIX(hashVal, nameHash);
} }
if (delegateInfo->mHasVarArgs) if (delegateInfo->mHasVarArgs)
hashVal = ((hashVal ^ HASH_DOTDOTDOT) << 5) - hashVal; hashVal = HASH_MIX(hashVal, HASH_DOTDOTDOT);
return hashVal; return hashVal;
} }
@ -3023,7 +3024,8 @@ int BfResolvedTypeSet::DoHash(BfType* type, LookupContext* ctx, bool allowRef, i
BfFieldInstance* fieldInstance = &tupleType->mFieldInstances[fieldIdx]; BfFieldInstance* fieldInstance = &tupleType->mFieldInstances[fieldIdx];
auto fieldType = fieldInstance->mResolvedType; auto fieldType = fieldInstance->mResolvedType;
hashVal = ((hashVal ^ (Hash(fieldType, ctx, BfHashFlag_None, hashSeed))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, Hash(fieldType, ctx, BfHashFlag_None, hashSeed + 1));
BfFieldDef* fieldDef = NULL; BfFieldDef* fieldDef = NULL;
if (tupleType->mTypeDef != NULL) if (tupleType->mTypeDef != NULL)
fieldDef = fieldInstance->GetFieldDef(); fieldDef = fieldInstance->GetFieldDef();
@ -3038,7 +3040,7 @@ int BfResolvedTypeSet::DoHash(BfType* type, LookupContext* ctx, bool allowRef, i
{ {
nameHash = (int)Hash64(fieldDef->mName.c_str(), (int)fieldDef->mName.length()); nameHash = (int)Hash64(fieldDef->mName.c_str(), (int)fieldDef->mName.length());
} }
hashVal = ((hashVal ^ (nameHash)) << 5) - hashVal; hashVal = HASH_MIX(hashVal, nameHash);
} }
} }
else if (type->IsGenericTypeInstance()) else if (type->IsGenericTypeInstance())
@ -3355,7 +3357,7 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
for (int fieldIdx = 0; fieldIdx < (int)tupleTypeRef->mFieldTypes.size(); fieldIdx++) for (int fieldIdx = 0; fieldIdx < (int)tupleTypeRef->mFieldTypes.size(); fieldIdx++)
{ {
BfTypeReference* fieldType = tupleTypeRef->mFieldTypes[fieldIdx]; BfTypeReference* fieldType = tupleTypeRef->mFieldTypes[fieldIdx];
hashVal = ((hashVal ^ (Hash(fieldType, ctx, BfHashFlag_None, hashSeed))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, Hash(fieldType, ctx, BfHashFlag_None, hashSeed + 1));
int nameHash = 0; int nameHash = 0;
BfIdentifierNode* fieldName = NULL; BfIdentifierNode* fieldName = NULL;
@ -3372,7 +3374,7 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
sprintf(nameStr, "%d", fieldIdx); sprintf(nameStr, "%d", fieldIdx);
nameHash = (int)Hash64(nameStr, strlen(nameStr)); nameHash = (int)Hash64(nameStr, strlen(nameStr));
} }
hashVal = ((hashVal ^ (nameHash)) << 5) - hashVal; hashVal = HASH_MIX(hashVal, nameHash);
} }
return hashVal; return hashVal;
@ -3594,7 +3596,7 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
{ {
int hashVal = HASH_DELEGATE; int hashVal = HASH_DELEGATE;
if (delegateTypeRef->mReturnType != NULL) if (delegateTypeRef->mReturnType != NULL)
hashVal = ((hashVal ^ (Hash(delegateTypeRef->mReturnType, ctx, BfHashFlag_AllowRef, hashSeed))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, Hash(delegateTypeRef->mReturnType, ctx, BfHashFlag_AllowRef, hashSeed + 1));
else else
ctx->mFailed = true; ctx->mFailed = true;
@ -3621,15 +3623,15 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
{ {
if (dotTypeRef->mDotToken->mToken == BfToken_DotDotDot) if (dotTypeRef->mDotToken->mToken == BfToken_DotDotDot)
{ {
hashVal = ((hashVal ^ HASH_DOTDOTDOT) << 5) - hashVal; hashVal = HASH_MIX(hashVal, HASH_DOTDOTDOT);
continue; continue;
} }
} }
} }
if (fieldType != NULL) if (fieldType != NULL)
hashVal = ((hashVal ^ (Hash(fieldType, ctx, (BfHashFlags)(BfHashFlag_AllowRef), hashSeed))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, Hash(fieldType, ctx, (BfHashFlags)(BfHashFlag_AllowRef), hashSeed + 1));
hashVal = ((hashVal ^ (HashNode(param->mNameNode))) << 5) - hashVal; hashVal = HASH_MIX(hashVal, HashNode(param->mNameNode));
isFirstParam = true; isFirstParam = true;
} }

View file

@ -524,6 +524,7 @@ public:
virtual BfTypeInstance* ToGenericTypeInstance() { return NULL; } virtual BfTypeInstance* ToGenericTypeInstance() { return NULL; }
virtual BfPrimitiveType* ToPrimitiveType() { return NULL; } virtual BfPrimitiveType* ToPrimitiveType() { return NULL; }
virtual bool IsDependendType() { return false; } virtual bool IsDependendType() { return false; }
virtual int GetGenericDepth() { return 0; }
virtual bool IsTypeInstance() { return false; } virtual bool IsTypeInstance() { return false; }
virtual bool IsGenericTypeInstance() { return false; } virtual bool IsGenericTypeInstance() { return false; }
virtual bool IsUnspecializedType() { return false; } virtual bool IsUnspecializedType() { return false; }
@ -616,6 +617,20 @@ public:
virtual void ReportMemory(MemReporter* memReporter); virtual void ReportMemory(MemReporter* memReporter);
}; };
class BfElementedType : public BfType
{
public:
int mGenericDepth;
public:
BfElementedType()
{
mGenericDepth = 0;
}
virtual int GetGenericDepth() override { return mGenericDepth; }
};
// This is explicitly used for generics // This is explicitly used for generics
typedef SizedArray<BfType*, 2> BfTypeVector; typedef SizedArray<BfType*, 2> BfTypeVector;
typedef SizedArray<BfTypeReference*, 2> BfTypeRefVector; typedef SizedArray<BfTypeReference*, 2> BfTypeRefVector;
@ -2029,6 +2044,7 @@ public:
virtual bool GetLoweredType(BfTypeUsage typeUsage, BfTypeCode* outTypeCode = NULL, BfTypeCode* outTypeCode2 = NULL) override; virtual bool GetLoweredType(BfTypeUsage typeUsage, BfTypeCode* outTypeCode = NULL, BfTypeCode* outTypeCode2 = NULL) override;
BfGenericTypeInfo* GetGenericTypeInfo() { return mGenericTypeInfo; } BfGenericTypeInfo* GetGenericTypeInfo() { return mGenericTypeInfo; }
virtual int GetGenericDepth() { return (mGenericTypeInfo != NULL) ? mGenericTypeInfo->mMaxGenericDepth : 0; }
virtual BfTypeInstance* ToGenericTypeInstance() override { return (mGenericTypeInfo != NULL) ? this : NULL; } virtual BfTypeInstance* ToGenericTypeInstance() override { return (mGenericTypeInfo != NULL) ? this : NULL; }
virtual bool IsGenericTypeInstance() override { return mGenericTypeInfo != NULL; } virtual bool IsGenericTypeInstance() override { return mGenericTypeInfo != NULL; }
@ -2205,12 +2221,14 @@ public:
BfDelegateInfo mDelegateInfo; BfDelegateInfo mDelegateInfo;
bool mIsUnspecializedType; bool mIsUnspecializedType;
bool mIsUnspecializedTypeVariation; bool mIsUnspecializedTypeVariation;
int mGenericDepth;
public: public:
BfDelegateType() BfDelegateType()
{ {
mIsUnspecializedType = false; mIsUnspecializedType = false;
mIsUnspecializedTypeVariation = false; mIsUnspecializedTypeVariation = false;
mGenericDepth = 0;
} }
~BfDelegateType(); ~BfDelegateType();
@ -2228,6 +2246,7 @@ public:
virtual bool IsUnspecializedTypeVariation() override { return mIsUnspecializedTypeVariation; } virtual bool IsUnspecializedTypeVariation() override { return mIsUnspecializedTypeVariation; }
virtual BfDelegateInfo* GetDelegateInfo() override { return &mDelegateInfo; } virtual BfDelegateInfo* GetDelegateInfo() override { return &mDelegateInfo; }
virtual int GetGenericDepth() override { return mGenericDepth; }
}; };
class BfTupleType : public BfTypeInstance class BfTupleType : public BfTypeInstance
@ -2238,6 +2257,7 @@ public:
BfSource* mSource; BfSource* mSource;
bool mIsUnspecializedType; bool mIsUnspecializedType;
bool mIsUnspecializedTypeVariation; bool mIsUnspecializedTypeVariation;
int mGenericDepth;
public: public:
BfTupleType(); BfTupleType();
@ -2252,6 +2272,8 @@ public:
virtual bool IsUnspecializedType() override { return mIsUnspecializedType; } virtual bool IsUnspecializedType() override { return mIsUnspecializedType; }
virtual bool IsUnspecializedTypeVariation() override { return mIsUnspecializedTypeVariation; } virtual bool IsUnspecializedTypeVariation() override { return mIsUnspecializedTypeVariation; }
virtual int GetGenericDepth() override { return mGenericDepth; }
}; };
class BfConcreteInterfaceType : public BfType class BfConcreteInterfaceType : public BfType
@ -2266,7 +2288,7 @@ public:
virtual bool IsUnspecializedTypeVariation() override { return mInterface->IsUnspecializedTypeVariation(); } virtual bool IsUnspecializedTypeVariation() override { return mInterface->IsUnspecializedTypeVariation(); }
}; };
class BfPointerType : public BfType class BfPointerType : public BfElementedType
{ {
public: public:
BfType* mElementType; BfType* mElementType;
@ -2395,9 +2417,18 @@ class BfSizedArrayType : public BfDependedType
public: public:
BfType* mElementType; BfType* mElementType;
intptr mElementCount; intptr mElementCount;
int mGenericDepth;
bool mWantsGCMarking; bool mWantsGCMarking;
public: public:
BfSizedArrayType()
{
mElementType = NULL;
mElementCount = 0;
mGenericDepth = 0;
mWantsGCMarking = false;
}
virtual bool NeedsExplicitAlignment() override { return mElementType->NeedsExplicitAlignment(); } virtual bool NeedsExplicitAlignment() override { return mElementType->NeedsExplicitAlignment(); }
virtual bool IsSizedArray() override { return true; } virtual bool IsSizedArray() override { return true; }
@ -2417,6 +2448,8 @@ public:
virtual bool IsUnspecializedTypeVariation() override { return mElementType->IsUnspecializedTypeVariation(); } virtual bool IsUnspecializedTypeVariation() override { return mElementType->IsUnspecializedTypeVariation(); }
virtual bool CanBeValuelessType() override { return true; } virtual bool CanBeValuelessType() override { return true; }
virtual bool WantsGCMarking() override { BF_ASSERT(mDefineState >= BfTypeDefineState_Defined); return mWantsGCMarking; } virtual bool WantsGCMarking() override { BF_ASSERT(mDefineState >= BfTypeDefineState_Defined); return mWantsGCMarking; }
virtual int GetGenericDepth() override { return mGenericDepth; }
// Leave the default "zero sized" definition // Leave the default "zero sized" definition
//virtual bool IsValuelessType() override { return mElementType->IsValuelessType(); } //virtual bool IsValuelessType() override { return mElementType->IsValuelessType(); }
}; };
@ -2727,7 +2760,7 @@ public:
else if (checkType->IsPointer()) else if (checkType->IsPointer())
GetProjectList(((BfPointerType*)checkType)->mElementType, projectList, immutableLength); GetProjectList(((BfPointerType*)checkType)->mElementType, projectList, immutableLength);
else if (checkType->IsRef()) else if (checkType->IsRef())
GetProjectList(((BfPointerType*)checkType)->mElementType, projectList, immutableLength); GetProjectList(((BfRefType*)checkType)->mElementType, projectList, immutableLength);
else if (checkType->IsSizedArray()) else if (checkType->IsSizedArray())
GetProjectList(((BfSizedArrayType*)checkType)->mElementType, projectList, immutableLength); GetProjectList(((BfSizedArrayType*)checkType)->mElementType, projectList, immutableLength);
else if (checkType->IsMethodRef()) else if (checkType->IsMethodRef())