TUnit icon indicating copy to clipboard operation
TUnit copied to clipboard

RIDER, TUnit0001: Attribute argument types 'T' don't match method parameter types 'T'

Open TheRumle opened this issue 9 months ago • 2 comments

When project is initially build I get the following Roslyn analyeser error.

Image

The error occured here:


    [Test]
    [EntityServiceInterfaceGenerator]
    [DisplayName("Generates valid syntax tree for $serviceInterface")]
    public async Task WhenGivenValidSourceCode_ProducesValidSyntaxTree(ServiceInterfaceSourceCode serviceInterface)
    {...}

The attribute definition can is as follows:

public sealed class EntityServiceInterfaceGeneratorAttribute : DataSourceGeneratorAttribute<ServiceInterfaceSourceCode>
{
    /// <inheritdoc />
    public override IEnumerable<Func<ServiceInterfaceSourceCode>> GenerateDataSources(
        DataGeneratorMetadata dataGeneratorMetadata)
        => TestEntities.Valid.SelectMany(TestBehaviours.GetServiceInterfaceSourceCodeFor).SelectFunc();
}

This happens with all my DataSourceGeneratorAttribute implementations. I can still build the project and run tests, but the red squiggly lines are hurting my eyes. Cleaning and rebuilding the project does not work. Neither does restarting analysers and generators. Invalidating caches does work. I have already created an issue with Rider, but I am unsure if this is on your side or theirs.

TheRumle avatar May 26 '25 19:05 TheRumle

This'll be a problem with my analyser logic. I'll try and take a look later this week

thomhurst avatar May 26 '25 19:05 thomhurst

Actually you say:

Invalidating caches does work

Maybe it is a rider issue then

thomhurst avatar May 27 '25 08:05 thomhurst

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jun 27 '25 00:06 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jul 03 '25 00:07 github-actions[bot]