Test: run the complete analyzer suite in syntax probes#1904
Open
Jim8y wants to merge 8 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master-n3 #1904 +/- ##
==========================================
Coverage 84.30% 84.30%
==========================================
Files 308 308
Lines 28370 28370
Branches 4005 4005
==========================================
Hits 23917 23917
Misses 3457 3457
Partials 996 996 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Jim8y
marked this pull request as ready for review
July 18, 2026 12:23
ajara87
previously approved these changes
Jul 18, 2026
shargon
reviewed
Jul 19, 2026
ajara87
reviewed
Jul 20, 2026
| GetLoadableAnalyzerTypes() | ||
| .Where(type => !type.IsAbstract && typeof(DiagnosticAnalyzer).IsAssignableFrom(type)) | ||
| .OrderBy(type => type.FullName, StringComparer.Ordinal) | ||
| .Select(type => (DiagnosticAnalyzer)Activator.CreateInstance(type)!) |
Member
There was a problem hiding this comment.
Suggested change
| .Select(type => (DiagnosticAnalyzer)Activator.CreateInstance(type)!) | |
| .Select(type => | |
| { | |
| var instance = Activator.CreateInstance(type) | |
| ?? throw new InvalidOperationException($"Could not instantiate analyzer {type.FullName}. Ensure it has a public parameterless constructor."); | |
| return (DiagnosticAnalyzer)instance; | |
| }) |
Activator.CreateInstance(type)! suppresses nullability warnings but it can still return null at runtime (e.g., no accessible parameterless constructor). Add an explicit null check and throw a clear error message
shargon
approved these changes
Jul 20, 2026
Wi1l-B0t
approved these changes
Jul 20, 2026
ajara87
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The probe harness only ran
UnsupportedSyntaxAnalyzer. Unsupported APIs and type restrictions handled by other analyzers could therefore be missed by the compatibility suite.Validation
dotnet test tests/Neo.Compiler.CSharp.UnitTests/Neo.Compiler.CSharp.UnitTests.csproj --filter FullyQualifiedName~SyntaxTests --no-restore(139 passed)dotnet format --verify-no-changesPart of #1841.