Fixes nullability fix-it for id<SomeProtocol>. With this change
nullability specifier is inserted after ">" instead of between
"id" and "<".
rdar://problem/34260995
Paths
| Differential D38327
[Sema] Put nullability fix-it after the end of the pointer. ClosedPublic Authored by vsapsai on Sep 27 2017, 12:33 PM.
Details Summary Fixes nullability fix-it for id<SomeProtocol>. With this change rdar://problem/34260995
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Sep 27 2017, 12:37 PM Comment Actions To preempt some of review feedback here are attempted and rejected approaches:
./test.h:14:3: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) id<SomeProtocol> thingies; ^
./test.h:14:3: note: insert '_Nullable' if the pointer may be null id<SomeProtocol> thingies; ^ _Nullable compared to suggested ./test.h:14:18: note: insert '_Nullable' if the pointer may be null id<SomeProtocol> thingies; ^ _Nullable I don't expect developers to know that they should match whitespace preceding _Nullable to calculate where in the line it should be inserted. And I think developers shouldn't care about it. So put the cursor where you expect the text to be inserted. Closed by commit rL314473: [Sema] Put nullability fix-it after the end of the pointer. (authored by vsapsai). · Explain WhySep 28 2017, 4:20 PM This revision was automatically updated to reflect the committed changes. Comment Actions
Thanks for the quick review, Jordan.
Revision Contents
Diff 117076 cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/FixIt/Inputs/nullability-objc.h
cfe/trunk/test/FixIt/nullability.mm
cfe/trunk/test/SemaObjCXX/Inputs/nullability-consistency-2.h
|