1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +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

@ -15196,19 +15196,11 @@ BfTypedValue BfExprEvaluator::MakeCallableTarget(BfAstNode* targetSrc, BfTypedVa
{
auto underlying = target.mType->GetUnderlyingType();
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)
{
auto pointerType = (BfPointerType*)target.mType;
target = mModule->LoadValue(target);
target.mType = pointerType->mElementType;
target.mType = underlying;
target.mKind = BfTypedValueKind_Addr;
}
}