SergeyTeplyakov / ErrorProne.NET

Set of roslyn-based analyzers for catching common C# errors (inspired by Google's error-prone)
MIT License
869 stars 43 forks source link

Analyzer throws an exception with message 'Syntax node is not within syntax tree' #277

Open rotanov opened 5 months ago

rotanov commented 5 months ago

I have a .NET8 project, the analyzer throws an exception:

warning: AD0001: Analyzer 'ErrorProne.NET.StructAnalyzers.MakeStructMemberReadOnlyAnalyzer' threw an exception of type 'System.ArgumentException' with message 'Syntax node is not within syntax tree'.

I tried 0.4.0-beta.1 and 0.6.1-beta.1.

I understand that's not enough information to get to the cause. Is there any way to debug it locally?

eludias commented 4 months ago

Same here.

Most .NET 8.0 projects are fine, except for the one which uses ref readonly parameters introduced in C#12, which give 'Syntax node is not within syntax tree'.

Selmar commented 2 months ago

Identical when using .NET Framework 4.8.