Skip to content

Fix nullref in ComponentsAnalyzer #18608

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

Merged
merged 2 commits into from
Jan 28, 2020
Merged

Fix nullref in ComponentsAnalyzer #18608

merged 2 commits into from
Jan 28, 2020

Conversation

BrennanConroy
Copy link
Member

Nullref was always there, but consuming a newer SDK/roslyn bits causes this to fail builds.

@@ -30,6 +30,9 @@
-->
<IsStableBuild>false</IsStableBuild>
<IsStableBuild Condition=" '$(DotNetFinalVersionKind)' == 'release' ">true</IsStableBuild>

<!-- Workaround issue with ComponentsAnalyzer throwing for interfaces -->
<DisableImplicitComponentsAnalyzers>true</DisableImplicitComponentsAnalyzers>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we file a follow up to undo this?

{
throw new NotImplementedException();
}

/*MMReturnType*/private Renderer GetRenderer() => _field;

public interface ITestInterface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @rynowak \ @SteveSandersonMS \ @mkArtakMSFT :

type.BaseType for interface types is null: https://github.com/dotnet/aspnetcore/pull/18608/files#diff-f7300f2c3fe64cdbb8f5dfd7854b0b56R85. This causes the call to VisitDeclarationSymbol to null-ref. It looks like the compiler was swallowing this in the past, but they now are presented as warnings. We were able to author the unit test to trivially cause this to fail. Should we consider patching this?

@BrennanConroy BrennanConroy added the analyzer Indicates an issue which is related to analyzer experience label Jan 28, 2020
@BrennanConroy BrennanConroy added this to the 5.0.0-preview1 milestone Jan 28, 2020
@BrennanConroy BrennanConroy merged commit 5473500 into master Jan 28, 2020
@BrennanConroy BrennanConroy deleted the brecon/analyzer branch January 28, 2020 02:10
@rynowak
Copy link
Member

rynowak commented Feb 7, 2020

Yeah I would suggest patching this. Do we have a bug for it?

@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer Indicates an issue which is related to analyzer experience area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants