This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Improve identification of C# nullables
ClosedPublic

Authored by jbcoe on Mar 4 2020, 6:01 AM.

Details

Summary

Consider ? identifier = and ? identifier; to be nullable within function bodies.

Diff Detail

Event Timeline

jbcoe created this revision.Mar 4 2020, 6:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2020, 6:01 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
krasimir accepted this revision.Mar 4 2020, 7:46 AM

Looks good with 1 suggestion.

clang/lib/Format/TokenAnnotator.cpp
1018

The check for tok::semi here is redundant: in an example like Type? name;, Line.MustBeDeclaration is true and this is not reached.

This revision is now accepted and ready to land.Mar 4 2020, 7:46 AM
jbcoe updated this revision to Diff 248232.Mar 4 2020, 10:08 AM
jbcoe marked an inline comment as done.

Remove duplicate check following review comment.

This revision was automatically updated to reflect the committed changes.