Page MenuHomePhabricator

[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.

Closed by commit rGfe61bc1a0b5a: [clang-format] Improve identification of C# nullables (authored by Jonathan Coe <jbcoe@google.com>). · Explain WhyMar 4 2020, 10:40 AM
This revision was automatically updated to reflect the committed changes.