maca88 / AsyncGenerator

Generating async c# code using Roslyn
MIT License
47 stars 16 forks source link

Init properties crash AsyncGenerator #168

Closed hazzik closed 2 years ago

hazzik commented 2 years ago
crit: AsyncGenerator.CommandLine[0]
      One or more errors occurred. (Sequence contains no matching element)
      System.AggregateException: One or more errors occurred. (Sequence contains no matching element)
       ---> System.InvalidOperationException: Sequence contains no matching element
         at System.Linq.ThrowHelper.ThrowNoMatchException()
         at AsyncGenerator.Internal.PropertyData..ctor(TypeData typeData, IPropertySymbol symbol, PropertyDeclarationSyntax node) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\Internal\PropertyData.cs:line 16
         at AsyncGenerator.Internal.TypeData.<>c__DisplayClass53_0.<GetPropertyData>b__0(PropertyDeclarationSyntax syntax) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\Internal\TypeData.cs:line 161
         at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
         at AsyncGenerator.Internal.TypeData.GetPropertyData(PropertyDeclarationSyntax node, SemanticModel semanticModel, Boolean create) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\Internal\TypeData.cs:line 161
         at AsyncGenerator.Internal.DocumentData.GetNodeData(SyntaxNode node, Boolean create, NamespaceData namespaceData, TypeData typeData, BaseMethodData baseMethodData) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\Internal\DocumentData.cs:line 234
         at AsyncGenerator.Analyzation.Internal.ProjectAnalyzer.PreAnalyzeDocumentData(DocumentData documentData) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\Analyzation\Internal\ProjectAnalyzer.PreAnalyze.cs:line 97
         at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
      --- End of stack trace from previous location ---
         at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
         at System.Threading.Tasks.TaskReplicator.Replica.Execute()
         --- End of inner exception stack trace ---
         at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
         at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
      --- End of stack trace from previous location ---
         at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException)
         at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
         at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](TSource[] array, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
         at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
         at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
         at AsyncGenerator.Analyzation.Internal.ProjectAnalyzer.Analyze(CancellationToken cancellationToken) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\Analyzation\Internal\ProjectAnalyzer.cs:line 81
         at AsyncGenerator.AsyncCodeGenerator.GenerateProject(ProjectData projectData, ILoggerFactory loggerFactory, ILogger logger, CancellationToken cancellationToken) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\AsyncCodeGenerator.cs:line 152
         at AsyncGenerator.AsyncCodeGenerator.GenerateAsync(AsyncCodeConfiguration configuration, CancellationToken cancellationToken) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator\AsyncCodeGenerator.cs:line 84
         at AsyncGenerator.CommandLine.Program.Main(String[] args) in C:\Workspace\Git\AsyncGenerator\Source\AsyncGenerator.CommandLine\Program.cs:line 51

See here: https://github.com/nhibernate/nhibernate-core/actions/runs/3331727343/jobs/5511802640

maca88 commented 2 years ago

Fixed with version 0.21.1 that contains #169.