Skip to content

Commit 48ef630

Browse files
paulirwinclaude
andcommitted
Address Copilot review: pin Net80 refs and fix stale comment
- Skips_StartsWith_CharVariable depends on string.StartsWith(char), which is .NET Core 2.0+. Pin ReferenceAssemblies.Net.Net80 to make the contract explicit and match the precedent set by the 2xxx tests. - The "string first parameter" comment was stale after the helper was renamed to ValueParameterIsString (which skips the receiver for non-reduced extension calls); reword to "string value parameter". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9534121 commit 48ef630

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/Lucene.Net.CodeAnalysis.Dev/LuceneDev6xxx/LuceneDev6001_6002_StringComparisonAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static bool ValueParameterIsString(IMethodSymbol? m)
175175
// Handle ambiguous candidates
176176
if (candidateSymbols.Length > 0)
177177
{
178-
// Check if any candidate is from String or J2N types and takes a string first parameter
178+
// Check if any candidate is from String or J2N types and takes a string value parameter
179179
var relevantCandidates = candidateSymbols
180180
.Where(c => ContainingTypeIsStringOrJ2N(c.ContainingType) && ValueParameterIsString(c))
181181
.ToImmutableArray();

tests/Lucene.Net.CodeAnalysis.Dev.Tests/LuceneDev6xxx/TestLuceneDev6001_6002_StringComparisonAnalyzer.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ public void M()
146146
var test = new InjectableCSharpAnalyzerTest(() => new LuceneDev6001_6002_StringComparisonAnalyzer())
147147
{
148148
TestCode = testCode,
149+
ReferenceAssemblies = ReferenceAssemblies.Net.Net80, // string.StartsWith(char) requires .NET Core 2.0+
149150
ExpectedDiagnostics = { } // StartsWith(char) has no StringComparison overload; no diagnostic
150151
};
151152

0 commit comments

Comments
 (0)