mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-12 13:24:09 +02:00
Allow typeof(Self) in static section
This commit is contained in:
parent
88711eae69
commit
0d837d23cb
3 changed files with 4 additions and 3 deletions
|
@ -10264,7 +10264,7 @@ void BfExprEvaluator::Visit(BfTypeOfExpression* typeOfExpr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
type = ResolveTypeRef(typeOfExpr->mTypeRef, BfPopulateType_Identity);
|
type = ResolveTypeRef(typeOfExpr->mTypeRef, BfPopulateType_Identity, BfResolveTypeRefFlag_AllowGlobalsSelf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == NULL)
|
if (type == NULL)
|
||||||
|
|
|
@ -9375,7 +9375,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
|
||||||
if (selfType != NULL)
|
if (selfType != NULL)
|
||||||
{
|
{
|
||||||
auto selfTypeInst = selfType->ToTypeInstance();
|
auto selfTypeInst = selfType->ToTypeInstance();
|
||||||
if ((selfTypeInst != NULL) && (selfTypeInst->mTypeDef->IsGlobalsContainer()))
|
if ((selfTypeInst != NULL) && (selfTypeInst->mTypeDef->IsGlobalsContainer()) && ((resolveFlags & BfResolveTypeRefFlag_AllowGlobalsSelf) == 0))
|
||||||
selfType = NULL;
|
selfType = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,8 @@ enum BfResolveTypeRefFlags
|
||||||
BfResolveTypeRefFlag_DisallowComptime = 0x1000,
|
BfResolveTypeRefFlag_DisallowComptime = 0x1000,
|
||||||
BfResolveTypeRefFlag_AllowDotDotDot = 0x2000,
|
BfResolveTypeRefFlag_AllowDotDotDot = 0x2000,
|
||||||
BfResolveTypeRefFlag_AllowGlobalContainer = 0x4000,
|
BfResolveTypeRefFlag_AllowGlobalContainer = 0x4000,
|
||||||
BfResolveTypeRefFlag_AllowInferredSizedArray = 0x8000
|
BfResolveTypeRefFlag_AllowInferredSizedArray = 0x8000,
|
||||||
|
BfResolveTypeRefFlag_AllowGlobalsSelf = 0x10000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum BfTypeNameFlags : uint16
|
enum BfTypeNameFlags : uint16
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue