You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My repro steps are rather simple. I just copied local method into a for() loop. Nothing special was about this method (it just borrows some local vars and input arguments from it's parent (int, ref struct, string[]).
System.InvalidOperationException : Unexpected false
at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition,String message)
at Microsoft.CodeAnalysis.ExtractMethod.ExtractMethodMatrix.GetVariableStyle(Boolean captured,Boolean dataFlowIn,Boolean dataFlowOut,Boolean alwaysAssigned,Boolean variableDeclared,Boolean readInside,Boolean writtenInside,Boolean readOutside,Boolean writtenOutside,Boolean unsafeAddressTaken)
at Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.Analyzer.GetVariableStyle(Dictionary`2 symbolMap,ISymbol symbol,SemanticModel model,ITypeSymbol type,Boolean captured,Boolean dataFlowIn,Boolean dataFlowOut,Boolean alwaysAssigned,Boolean variableDeclared,Boolean readInside,Boolean writtenInside,Boolean readOutside,Boolean writtenOutside,Boolean unsafeAddressTaken)
at Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.Analyzer.GenerateVariableInfoMap(SemanticModel model,DataFlowAnalysis dataFlowAnalysisData,Dictionary`2 symbolMap)
at async Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.Analyzer.AnalyzeAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.ExtractMethodAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.ExtractMethod.AbstractExtractMethodService`3.ExtractMethodAsync[TValidator,TExtractor,TResult](<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.GetCodeActionAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unknown Parameters>)
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
The text was updated successfully, but these errors were encountered:
Unfortunately this code is long gone. Crash was occurring repeatedly few times until I've pressed "Enable and Ignore". It happened after copy pasting a function that was a class member into a for loop so for a moment there were 2 methods with the same name and a delegate using one of those functions. It looked like something this:
for( int i = 0; i < names.Length; i++ )
{
void OnInsertSelectValue( ref Item hotItem )
{
var getVariable = MultiInputMathOperationNode.Create( contextBrowser.mousePosition );
contextBrowser.AddChild( getVariable );
}
var inputSimpleItemAdd = new SimpleItem();
inputSimpleItemAdd.onSelect = OnInsertSelectValue; // note delegate here
mathFolder.AddChild( inputSimpleItemAdd );
}
void OnInsertSelectValue( ref Item hotItem )
{
var getVariable = MultiInputMathOperationNode.Create( contextBrowser.mousePosition );
contextBrowser.AddChild( getVariable );
}
Version Used:
VS2017 RTM
My repro steps are rather simple. I just copied local method into a for() loop. Nothing special was about this method (it just borrows some local vars and input arguments from it's parent (int, ref struct, string[]).
The text was updated successfully, but these errors were encountered: