mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Handled some missing system types better
This commit is contained in:
parent
a9c82d4125
commit
9163312712
2 changed files with 14 additions and 3 deletions
|
@ -13833,6 +13833,9 @@ void BfExprEvaluator::CreateObject(BfObjectCreateExpression* objCreateExpr, BfAs
|
||||||
mModule->Fail("Too many array dimensions, consider using a jagged array.", objCreateExpr);
|
mModule->Fail("Too many array dimensions, consider using a jagged array.", objCreateExpr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arrayType == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (isAppendAlloc)
|
if (isAppendAlloc)
|
||||||
arrayValue = BfTypedValue(mModule->AppendAllocFromType(resultType, BfIRValue(), 0, arraySize, (int)dimLengthVals.size(), isRawArrayAlloc, zeroMemory), arrayType);
|
arrayValue = BfTypedValue(mModule->AppendAllocFromType(resultType, BfIRValue(), 0, arraySize, (int)dimLengthVals.size(), isRawArrayAlloc, zeroMemory), arrayType);
|
||||||
else
|
else
|
||||||
|
|
|
@ -10339,7 +10339,11 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
||||||
if ((mCurTypeInstance == NULL) || (!mCurTypeInstance->IsGenericTypeInstance()))
|
if ((mCurTypeInstance == NULL) || (!mCurTypeInstance->IsGenericTypeInstance()))
|
||||||
wantGeneric = false;
|
wantGeneric = false;
|
||||||
|
|
||||||
auto baseDelegateType = ResolveTypeDef(mCompiler->mDelegateTypeDef)->ToTypeInstance();
|
BfTypeInstance* baseDelegateType = NULL;
|
||||||
|
if (mCompiler->mDelegateTypeDef != NULL)
|
||||||
|
baseDelegateType = ResolveTypeDef(mCompiler->mDelegateTypeDef)->ToTypeInstance();
|
||||||
|
else
|
||||||
|
failed = true;
|
||||||
|
|
||||||
BfDelegateInfo* delegateInfo = NULL;
|
BfDelegateInfo* delegateInfo = NULL;
|
||||||
BfTypeInstance* delegateType = NULL;
|
BfTypeInstance* delegateType = NULL;
|
||||||
|
@ -10386,7 +10390,8 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
||||||
Val128 hashContext;
|
Val128 hashContext;
|
||||||
|
|
||||||
BfTypeDef* typeDef = new BfTypeDef();
|
BfTypeDef* typeDef = new BfTypeDef();
|
||||||
typeDef->mProject = baseDelegateType->mTypeDef->mProject;
|
if (baseDelegateType != NULL)
|
||||||
|
typeDef->mProject = baseDelegateType->mTypeDef->mProject;
|
||||||
typeDef->mSystem = mCompiler->mSystem;
|
typeDef->mSystem = mCompiler->mSystem;
|
||||||
typeDef->mName = mSystem->mEmptyAtom;
|
typeDef->mName = mSystem->mEmptyAtom;
|
||||||
if (delegateTypeRef->mTypeToken->GetToken() == BfToken_Delegate)
|
if (delegateTypeRef->mTypeToken->GetToken() == BfToken_Delegate)
|
||||||
|
@ -10418,9 +10423,12 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
||||||
delegateInfo->mDirectAllocNodes.push_back(directTypeRef);
|
delegateInfo->mDirectAllocNodes.push_back(directTypeRef);
|
||||||
if (typeDef->mIsDelegate)
|
if (typeDef->mIsDelegate)
|
||||||
directTypeRef->Init(delegateType);
|
directTypeRef->Init(delegateType);
|
||||||
|
else if (mCompiler->mFunctionTypeDef == NULL)
|
||||||
|
failed = true;
|
||||||
else
|
else
|
||||||
directTypeRef->Init(ResolveTypeDef(mCompiler->mFunctionTypeDef));
|
directTypeRef->Init(ResolveTypeDef(mCompiler->mFunctionTypeDef));
|
||||||
typeDef->mBaseTypes.push_back(directTypeRef);
|
if (!failed)
|
||||||
|
typeDef->mBaseTypes.push_back(directTypeRef);
|
||||||
|
|
||||||
directTypeRef = BfAstNode::ZeroedAlloc<BfDirectTypeReference>();
|
directTypeRef = BfAstNode::ZeroedAlloc<BfDirectTypeReference>();
|
||||||
delegateInfo->mDirectAllocNodes.push_back(directTypeRef);
|
delegateInfo->mDirectAllocNodes.push_back(directTypeRef);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue