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

Error on non-consteval properties with 'var' types

This commit is contained in:
Brian Fiete 2023-12-31 06:13:54 -05:00
parent ecc38960f3
commit 3ae310e9a8

View file

@ -23904,6 +23904,12 @@ void BfModule::DoMethodDeclaration(BfMethodDeclaration* methodDeclaration, bool
{
SetAndRestoreValue<bool> prevIngoreErrors(mIgnoreErrors, mIgnoreErrors || (methodDef->GetPropertyDeclaration() != NULL));
if (methodDef->mReturnTypeRef->IsA<BfVarTypeReference>())
{
// An invalid 'var' error would not have been caught in the original property type pass
mIgnoreErrors = false;
}
BfResolveTypeRefFlags flags = (BfResolveTypeRefFlags)(BfResolveTypeRefFlag_NoResolveGenericParam | BfResolveTypeRefFlag_AllowRef | BfResolveTypeRefFlag_AllowRefGeneric);
if ((((methodInstance->mComptimeFlags & BfComptimeFlag_ConstEval) != 0) || (methodInstance->mIsAutocompleteMethod))