Version Used: 16.2.0 (debug build will assert so you can easily see the problem)
Steps to Reproduce:
- Create a new console application.
- Before a semicolon in one of the using directives at the top of the file, type a
[.
Expected Behavior: no asserts
Actual Behavior: the compiler asserts during incremental parse. IDE will crash from there.
This is one bug found by digging through a bug bucket of 16.2 crashes.
Assert:
---------------------------
Assertion Failed: Abort=Quit, Retry=Debug, Ignore=Continue
---------------------------
at Microsoft.CodeAnalysis.SyntaxTreeExtensions.VerifySource(SyntaxTree tree, IEnumerable`1 changes)
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChanges(SourceText newText, IReadOnlyList`1 changes)
at Microsoft.CodeAnalysis.CSharp.CSharpSyntaxTree.WithChangedText(SourceText newText)
at Microsoft.CodeAnalysis.DocumentState.IncrementallyParse(TextAndVersion newTextAndVersion, TreeAndVersion oldTreeAndVersion, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.DocumentState.<IncrementallyParseTreeAsync>d__15.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.CodeAnalysis.DocumentState.IncrementallyParseTreeAsync(ValueSource`1 oldTreeSource, ValueSource`1 newTextSource, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.DocumentState.<>c__DisplayClass14_0.<CreateLazyIncrementallyParsedTree>b__0(CancellationToken c)
at Roslyn.Utilities.AsyncLazy`1.StartAsynchronousComputation(AsynchronousComputationToStart computationToStart, Request requestToCompleteSynchronously, CancellationToken callerCancellationToken)
at Roslyn.Utilities.AsyncLazy`1.GetValueAsync(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.DocumentState.<GetSyntaxTreeAsync>d__42.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
at Microsoft.CodeAnalysis.DocumentState.GetSyntaxTreeAsync(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Document.GetSyntaxTreeAsync(CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Host.BackgroundParser.<>c__DisplayClass20_0.<ParseDocumentAsync>b__0()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
Version Used: 16.2.0 (debug build will assert so you can easily see the problem)
Steps to Reproduce:
[.Expected Behavior: no asserts
Actual Behavior: the compiler asserts during incremental parse. IDE will crash from there.
This is one bug found by digging through a bug bucket of 16.2 crashes.
Assert: