mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Fixed issues with failed const type expressions
This commit is contained in:
parent
ee4ae8f9ed
commit
ae06346357
2 changed files with 5 additions and 3 deletions
|
@ -9303,6 +9303,9 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
||||||
}
|
}
|
||||||
|
|
||||||
constExprType->mType = GetPrimitiveType(result.mTypeCode);
|
constExprType->mType = GetPrimitiveType(result.mTypeCode);
|
||||||
|
BF_ASSERT(constExprType->mType != NULL);
|
||||||
|
if (constExprType->mType == NULL)
|
||||||
|
constExprType->mType = GetPrimitiveType(BfTypeCode_IntPtr);
|
||||||
constExprType->mValue = result;
|
constExprType->mValue = result;
|
||||||
|
|
||||||
resolvedEntry->mValue = constExprType;
|
resolvedEntry->mValue = constExprType;
|
||||||
|
|
|
@ -2519,10 +2519,9 @@ BfVariant BfResolvedTypeSet::EvaluateToVariant(LookupContext* ctx, BfExpression*
|
||||||
{
|
{
|
||||||
BfConstResolver constResolver(ctx->mModule);
|
BfConstResolver constResolver(ctx->mModule);
|
||||||
BfVariant variant = { BfTypeCode_None };
|
BfVariant variant = { BfTypeCode_None };
|
||||||
constResolver.Evaluate(expr);
|
auto result = constResolver.Resolve(expr);
|
||||||
if (constResolver.mResult)
|
if (result)
|
||||||
{
|
{
|
||||||
auto result = constResolver.mResult;
|
|
||||||
if (result.mKind == BfTypedValueKind_GenericConstValue)
|
if (result.mKind == BfTypedValueKind_GenericConstValue)
|
||||||
{
|
{
|
||||||
constGenericParam = result.mType;
|
constGenericParam = result.mType;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue