2
0
Эх сурвалжийг харах

Fixed typeState issue with exterior nodes

Brian Fiete 5 жил өмнө
parent
commit
b09364cd34

+ 2 - 2
IDEHelper/Compiler/BfCompiler.cpp

@@ -3695,11 +3695,11 @@ void BfCompiler::ProcessAutocompleteTempType()
 	SetAndRestoreValue<BfMethodState*> prevMethodState(module->mCurMethodState, NULL);
 	SetAndRestoreValue<BfMethodState*> prevMethodState(module->mCurMethodState, NULL);
 	SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(module->mCurTypeInstance, NULL);
 	SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(module->mCurTypeInstance, NULL);
 	SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(module->mCurMethodInstance, NULL);
 	SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(module->mCurMethodInstance, NULL);
+	SetAndRestoreValue<BfTypeState*> prevTypeState(module->mContext->mCurTypeState, NULL);
 
 
 	// >>> VisitExteriorIdentifiers
 	// >>> VisitExteriorIdentifiers
 	mResolvePassData->mAutoComplete->SetModule(module);
 	mResolvePassData->mAutoComplete->SetModule(module);
 	{		
 	{		
-		SetAndRestoreValue<BfTypeState*> prevTypeState(module->mContext->mCurTypeState, NULL);
 		BP_ZONE("VisitExteriorIdentifiers");		
 		BP_ZONE("VisitExteriorIdentifiers");		
 		VisitAutocompleteExteriorIdentifiers();
 		VisitAutocompleteExteriorIdentifiers();
 	}	
 	}	
@@ -3738,7 +3738,7 @@ void BfCompiler::ProcessAutocompleteTempType()
 
 
 	BfTypeState typeState;
 	BfTypeState typeState;
 	typeState.mCurTypeDef = tempTypeDef;
 	typeState.mCurTypeDef = tempTypeDef;
-	SetAndRestoreValue<BfTypeState*> prevTypeState(module->mContext->mCurTypeState, &typeState);	
+	module->mContext->mCurTypeState = &typeState;
 
 
 	BfStaticSearch* staticSearch = NULL;
 	BfStaticSearch* staticSearch = NULL;
 	if (mResolvePassData->mStaticSearchMap.TryAdd(tempTypeDef, NULL, &staticSearch))
 	if (mResolvePassData->mStaticSearchMap.TryAdd(tempTypeDef, NULL, &staticSearch))