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

Make the analyzer that warns about ISymbol derivations warn about IOperation as well. #863

Closed
srivatsn opened this issue Feb 22, 2016 · 9 comments · Fixed by dotnet/roslyn#11246
Milestone

Comments

@srivatsn
Copy link
Contributor

Analyzer package

Microsoft.CodeAnalysis.Analyzers

Analyzer

DoNotDerviceFromISymbol

Extend this analyzer to warn about IOperation as well.

@srivatsn srivatsn added Bug The product is not behaving according to its current intended design Area-MicrosoftCodeAnalysisAnalyzers labels Feb 22, 2016
@srivatsn srivatsn added this to the 1.2 milestone Feb 22, 2016
@srivatsn srivatsn added Feature Request and removed Bug The product is not behaving according to its current intended design labels Feb 22, 2016
@srivatsn srivatsn modified the milestones: 1.3, 1.2 Mar 11, 2016
@srivatsn srivatsn modified the milestones: 1.2, 1.3 Apr 6, 2016
@bkoelman
Copy link
Contributor

An analyzer with that name does not exist. The closest I could find is https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/Core/InternalImplementationOnlyAnalyzer.cs.

I have tried to add a test next to https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/Test/InternalImplementationOnlyTests.cs#L177, but it fails because IOperation does not have the [InternalImplementationOnly] marker like ISymbol does.

        [Fact]
        public void CSharp_VerifyIOperation()
        {
            var source = @"
public class Foo : Microsoft.CodeAnalysis.IOperation { }
public class Bar : Microsoft.CodeAnalysis.Semantics.IInvocationExpression { }
";
            DiagnosticResult[] expected = new[] { GetCSharpExpectedDiagnostic(2, 14, "Foo", "IOperation"), GetBasicExpectedDiagnostic(5, 14, "Bar", "IInvocationExpression") };

            // Verify that IOperation is not implementable.
            VerifyCSharp(source, addLanguageSpecificCodeAnalysisReference: true, expected: expected);
        }

Is there any reason why the marker is missing on IOperation?

@bkoelman
Copy link
Contributor

Please reopen this issue. We should add the unittest above, once the roslyn bits are available.

@mavasani mavasani reopened this May 13, 2016
@mavasani mavasani removed their assignment May 13, 2016
@mavasani mavasani reopened this May 13, 2016
@bkoelman
Copy link
Contributor

@nguerrera can you please reopen?

@nguerrera nguerrera reopened this May 13, 2016
@nguerrera
Copy link
Contributor

I don't understand how I closed it.

@bkoelman
Copy link
Contributor

Me neither :)

@nguerrera
Copy link
Contributor

Lol. It seems pushing a commit to any repo in GitHub with 'fix org/repo#NNN' will close the issue in another repo. I expect this will get closed a lot as folks take dotnet/roslyn@701404c in to their forks. :(

@mavasani
Copy link
Contributor

We should probably just file another issue to track this :)

@bkoelman
Copy link
Contributor

I was thinking the same, just created #999.

@srivatsn
Copy link
Contributor Author

Closing this issue since the remaining work is tracked by #999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants