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
I get the following error in the Error List after installing ErrorProne.NET. I believe this is because it can't parse the primary constructor syntax of record structs.
Severity Code Project Description File Line Suppression State
Warning AD0001 BasketManagement Analyzer 'ErrorProne.NET.StructAnalyzers.MakeStructReadOnlyAnalyzer' threw an exception of type 'System.InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax'.'.
Exception occurred with following context:
Compilation: BasketManagement
ISymbol: ItemGroup (NamedType)
System.InvalidCastException: Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.ParameterSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.BasePropertyDeclarationSyntax'.
at ErrorProne.NET.Extensions.SyntaxNodeExtensions.<>c.<MarkedWithReadOnlyModifier>b__4_0(SyntaxReference p) in C:\Sources\GitHub\ErrorProne.NET\src\ErrorProne.NET.Core\SyntaxNodeExtensions.cs:line 50
at System.Linq.Enumerable.SelectArrayIterator`2.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at ErrorProne.NET.Extensions.SyntaxNodeExtensions.MarkedWithReadOnlyModifier(IPropertySymbol property) in C:\Sources\GitHub\ErrorProne.NET\src\ErrorProne.NET.Core\SyntaxNodeExtensions.cs:line 48
at ErrorProne.NET.StructAnalyzers.ReadOnlyAnalyzer.IsReadonly(ISymbol member) in C:\Sources\GitHub\ErrorProne.NET\src\ErrorProne.NET.StructAnalyzers\ReadOnlyAnalyzer.cs:line 61
at ErrorProne.NET.StructAnalyzers.ReadOnlyAnalyzer.<>c__DisplayClass1_0.<StructCanBeReadOnly>b__4(<>f__AnonymousType0`2 m) in C:\Sources\GitHub\ErrorProne.NET\src\ErrorProne.NET.StructAnalyzers\ReadOnlyAnalyzer.cs:line 48
at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate)
at ErrorProne.NET.StructAnalyzers.ReadOnlyAnalyzer.StructCanBeReadOnly(INamedTypeSymbol namedTypeSymbol, SemanticModel semanticModel) in C:\Sources\GitHub\ErrorProne.NET\src\ErrorProne.NET.StructAnalyzers\ReadOnlyAnalyzer.cs:line 48
at ErrorProne.NET.StructAnalyzers.MakeStructReadOnlyAnalyzer.AnalyzeStructDeclaration(SymbolAnalysisContext context) in C:\Sources\GitHub\ErrorProne.NET\src\ErrorProne.NET.StructAnalyzers\MakeStructReadOnlyAnalyzer.cs:line 45
at Microsoft.CodeAnalysis.Diagnostics.AnalyzerExecutor.ExecuteAndCatchIfThrows_NoLock[TArg](DiagnosticAnalyzer analyzer, Action`1 analyze, TArg argument, Nullable`1 info, CancellationToken cancellationToken)
The record struct in question is defined like this:
public sealed record struct ItemGroup(int Amount, PlatonicItem Item);
The text was updated successfully, but these errors were encountered:
I get the following error in the Error List after installing ErrorProne.NET. I believe this is because it can't parse the primary constructor syntax of record structs.
The record struct in question is defined like this:
public sealed record struct ItemGroup(int Amount, PlatonicItem Item);
The text was updated successfully, but these errors were encountered: