Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analyzers don't handle out of order named parameters #153

Closed
tpodolak opened this issue Dec 20, 2020 · 0 comments · Fixed by #193
Closed

Analyzers don't handle out of order named parameters #153

tpodolak opened this issue Dec 20, 2020 · 0 comments · Fixed by #193
Labels
bug Something isn't working
Milestone

Comments

@tpodolak
Copy link
Member

All analyzers dont handle correctly out of order named parameters. For instance, for following piece of code

namespace TestProject6
{
    public class FooTests
    {
        public interface IFoo
        {
            int Foo();
        }

        public void Foo()
        {
            var substitute = Substitute.For<IFoo>();

            SubstituteExtensions.Returns(returnThis: 1, value: substitute.Foo());
        }
    }
}

NS1000 warning is reported as analyzer "think" that we want to setup 1 to return substitute

 SomeTest.cs(17, 54): [NS1000] Member 1 can not be intercepted. Only interface members and virtual, overriding, and abstract members can be intercepted.

In order to fix this, it is necessary to start inferring substituted member with either Operation API or SemanticModel

@tpodolak tpodolak added the bug Something isn't working label Dec 20, 2020
tpodolak added a commit that referenced this issue Dec 20, 2020
tpodolak added a commit that referenced this issue Dec 20, 2020
tpodolak added a commit that referenced this issue Dec 20, 2020
tpodolak added a commit that referenced this issue Dec 20, 2020
tpodolak added a commit that referenced this issue Mar 7, 2021
tpodolak added a commit that referenced this issue Mar 7, 2021
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 11, 2022
tpodolak added a commit that referenced this issue Sep 30, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Oct 2, 2022
tpodolak added a commit that referenced this issue Nov 17, 2022
…age-with-args

Gh 153 - handle out of order parameters when analyzing NSubstitute usages
@tpodolak tpodolak added this to the 1.0.16 milestone Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant