Procházet zdrojové kódy

Error on non-consteval properties with 'var' types

Brian Fiete před 1 rokem
rodič
revize
3ae310e9a8
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      IDEHelper/Compiler/BfModule.cpp

+ 6 - 0
IDEHelper/Compiler/BfModule.cpp

@@ -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))