mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed attempted static lookup in enum underlying type
This commit is contained in:
parent
053919d99e
commit
f56667ff61
2 changed files with 14 additions and 6 deletions
|
@ -3323,8 +3323,13 @@ BfTypedValue BfExprEvaluator::LookupIdentifier(BfAstNode* refNode, const StringI
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!thisValue.HasType())
|
if (!thisValue.HasType())
|
||||||
|
{
|
||||||
thisValue = BfTypedValue(mModule->mCurTypeInstance);
|
thisValue = BfTypedValue(mModule->mCurTypeInstance);
|
||||||
BfTypedValue result = LookupField(identifierNode, thisValue, findName, BfLookupFieldFlag_IsImplicitThis);
|
}
|
||||||
|
|
||||||
|
BfTypedValue result;
|
||||||
|
if (thisValue.HasType())
|
||||||
|
result = LookupField(identifierNode, thisValue, findName, BfLookupFieldFlag_IsImplicitThis);
|
||||||
if (mPropDef != NULL)
|
if (mPropDef != NULL)
|
||||||
{
|
{
|
||||||
if (forcedIFaceLookup)
|
if (forcedIFaceLookup)
|
||||||
|
@ -8173,7 +8178,7 @@ void BfExprEvaluator::LookupQualifiedStaticField(BfAstNode* nameNode, BfIdentifi
|
||||||
BfType* type = NULL;
|
BfType* type = NULL;
|
||||||
{
|
{
|
||||||
SetAndRestoreValue<bool> prevIgnoreErrors(mModule->mIgnoreErrors, true);
|
SetAndRestoreValue<bool> prevIgnoreErrors(mModule->mIgnoreErrors, true);
|
||||||
type = mModule->ResolveTypeRef(nameLeft, NULL, BfPopulateType_Data, BfResolveTypeRefFlag_AllowRef);
|
type = mModule->ResolveTypeRef(nameLeft, NULL, BfPopulateType_Declaration, BfResolveTypeRefFlag_AllowRef);
|
||||||
}
|
}
|
||||||
if (type != NULL)
|
if (type != NULL)
|
||||||
{
|
{
|
||||||
|
@ -16672,7 +16677,9 @@ void BfExprEvaluator::DoMemberReference(BfMemberReferenceExpression* memberRefEx
|
||||||
if (!thisValue)
|
if (!thisValue)
|
||||||
{
|
{
|
||||||
if (auto targetIdentifier = BfNodeDynCast<BfIdentifierNode>(exprTarget))
|
if (auto targetIdentifier = BfNodeDynCast<BfIdentifierNode>(exprTarget))
|
||||||
thisValue = BfTypedValue(mModule->ResolveTypeRef(targetIdentifier, NULL));
|
{
|
||||||
|
thisValue = BfTypedValue(mModule->ResolveTypeRef(targetIdentifier, NULL, BfPopulateType_Declaration));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!thisValue.HasType())
|
if (!thisValue.HasType())
|
||||||
|
|
|
@ -1613,6 +1613,7 @@ bool BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
for (auto baseTypeRef : typeDef->mBaseTypes)
|
for (auto baseTypeRef : typeDef->mBaseTypes)
|
||||||
{
|
{
|
||||||
SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, baseTypeRef);
|
SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, baseTypeRef);
|
||||||
|
SetAndRestoreValue<BfTypeDefineState> prevDefineState(typeInstance->mDefineState, BfTypeDefineState_ResolvingBaseType);
|
||||||
SetAndRestoreValue<bool> prevIgnoreError(mIgnoreErrors, true);
|
SetAndRestoreValue<bool> prevIgnoreError(mIgnoreErrors, true);
|
||||||
SetAndRestoreValue<bool> prevSkipTypeProtectionChecks(typeInstance->mSkipTypeProtectionChecks, true);
|
SetAndRestoreValue<bool> prevSkipTypeProtectionChecks(typeInstance->mSkipTypeProtectionChecks, true);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue