1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed issues with some decltype statements in type alias decl

This commit is contained in:
Brian Fiete 2021-11-01 07:56:45 -07:00
parent 2af4468b4d
commit 9030d86562
2 changed files with 7 additions and 2 deletions

View file

@ -2197,7 +2197,7 @@ void BfModule::LocalVariableDone(BfLocalVariable* localVar, bool isMethodExit)
bool deferFullAnalysis = mCurMethodState->GetRootMethodState()->mLocalMethodCache.size() != 0; bool deferFullAnalysis = mCurMethodState->GetRootMethodState()->mLocalMethodCache.size() != 0;
// We may have init blocks that we aren't processing here... // We may have init blocks that we aren't processing here...
if ((mCurMethodInstance->mIsAutocompleteMethod) && (mCurMethodInstance->mMethodDef->mMethodType == BfMethodType_Ctor)) if ((mCurMethodInstance != NULL) && (mCurMethodInstance->mIsAutocompleteMethod) && (mCurMethodInstance->mMethodDef->mMethodType == BfMethodType_Ctor))
deferFullAnalysis = true; deferFullAnalysis = true;
//bool deferFullAnalysis = true; //bool deferFullAnalysis = true;
@ -14571,6 +14571,8 @@ BfTypeOptions* BfModule::GetTypeOptions()
{ {
if ((mCurMethodState != NULL) && (mCurMethodState->mMethodTypeOptions != NULL)) if ((mCurMethodState != NULL) && (mCurMethodState->mMethodTypeOptions != NULL))
return mCurMethodState->mMethodTypeOptions; return mCurMethodState->mMethodTypeOptions;
if (mCurMethodInstance == NULL)
return NULL;
return mSystem->GetTypeOptions(mCurTypeInstance->mTypeOptionsIdx); return mSystem->GetTypeOptions(mCurTypeInstance->mTypeOptionsIdx);
} }
@ -15123,7 +15125,7 @@ void BfModule::EmitDefaultReturn()
} }
else else
{ {
if (mCurMethodInstance->mReturnType->IsVar()) if ((mCurMethodInstance == NULL) || (mCurMethodInstance->mReturnType->IsVar()))
{ {
// Ignore // Ignore
} }

View file

@ -2523,6 +2523,9 @@ void BfModule::DoPopulateType_TypeAlias(BfTypeInstance* typeAlias)
auto typeAliasDecl = (BfTypeAliasDeclaration*)typeDef->mTypeDeclaration; auto typeAliasDecl = (BfTypeAliasDeclaration*)typeDef->mTypeDeclaration;
BfType* aliasToType = NULL; BfType* aliasToType = NULL;
if (typeAlias->mBaseType == NULL)
typeAlias->mBaseType = ResolveTypeDef(mCompiler->mValueTypeTypeDef)->ToTypeInstance();
typeAlias->mDefineState = BfTypeDefineState_ResolvingBaseType; typeAlias->mDefineState = BfTypeDefineState_ResolvingBaseType;
BfTypeState typeState(mCurTypeInstance, mContext->mCurTypeState); BfTypeState typeState(mCurTypeInstance, mContext->mCurTypeState);
typeState.mPopulateType = BfPopulateType_Data; typeState.mPopulateType = BfPopulateType_Data;