Skip to content

Fix more null refs in Api Analyzers #10375

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
May 21, 2019

Conversation

pranavkm
Copy link
Contributor

  • Make attributes used by analyzer public
  • Compile analyzer tests against ref assemblies
  • Turn on Nullable reference types and harden some null-checks

 * Make attributes used by analyzer public
 * Compile analyzer tests against ref assemblies
 * Turn on Nullable reference types and harden some null-checks
@Eilon Eilon added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label May 20, 2019
Copy link
Contributor Author

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

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

🆙 📅

return false;
}


Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is aquaman sad?

Copy link
Member

Choose a reason for hiding this comment

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

Thanos collected the one ring and now aquaman has to leave Hogwarts. Poor aquaman 😢

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll clean up the extra new lines in a follow up.

return false;
}


Copy link
Member

Choose a reason for hiding this comment

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

return _document;
}

var context = nullableContext.Value;
Copy link
Member

Choose a reason for hiding this comment

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

FYI this shouldn't be needed. The flow analysis should do the right thing after it sees the null check at L48.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

error CS1061: 'AddResponseTypeAttributeCodeFixAction.CodeActionContext?' does not contain a definition for 'SymbolCache' and no accessible extension method 'SymbolCache' accepting a first argument of type 'AddResponseTypeAttributeCodeFixAction.CodeActionContext?' could be found

Doesn't seem to work if I remove it. Perhaps because it's a value type.

@pranavkm pranavkm merged commit 26b5323 into master May 21, 2019
@pranavkm pranavkm deleted the prkrishn/fix-more-analyzer-null-refs branch May 21, 2019 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants