Skip to content

ILLink CodeFixer tests are failing #88278

@vitek-karas

Description

@vitek-karas

For example the UncoditionalSuppressMessageCodeFixTests.FixInCtor is failing with:

    Context: Iterative code fix application
content of '/0/Test0.cs' did not match. Diff shown with expected as baseline:
 
 using System;
 using System.Diagnostics.CodeAnalysis;
 
 public class C
 {
     [RequiresUnreferencedCodeAttribute("message")]
     public int M1() => 0;
 
     [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
+    [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
     public C () => M1();
 }

Expected: True
Actual:   False

  Stack Trace: 
XUnitVerifier.Fail(String message) line 87
IVerifierExtensions.EqualOrDiff(IVerifier verifier, String expected, String actual, String message) line 67
CodeFixTest`1.VerifyProjectAsync(ProjectState newState, Project project, IVerifier verifier, CancellationToken cancellationToken) line 531
CodeFixTest`1.VerifyFixAsync(String language, ImmutableArray`1 analyzers, ImmutableArray`1 codeFixProviders, SolutionState oldState, SolutionState newState, Int32 numberOfIterations, Func`10 getFixedProject, IVerifier verifier, CancellationToken cancellationToken) line 509
CodeFixTest`1.VerifyFixAsync(SolutionState testState, SolutionState fixedState, SolutionState batchFixedState, IVerifier verifier, CancellationToken cancellationToken) line 471
CodeFixTest`1.RunImplAsync(CancellationToken cancellationToken) line 310
AnalyzerTest`1.RunAsync(CancellationToken cancellationToken) line 188

But the underlying issue seems to be that the analyzer is reporting two warnings where it should be reporting only one.
I don't know when this started to happen.

Metadata

Metadata

Assignees

Labels

area-Tools-ILLink.NET linker development as well as trimming analyzers

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions