This is a big deal for ObjC, where nullability annotations are extensively used. I've also changed "Null" -> "null" and removed "is" as this is the pattern that Sema is using.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I think in the 'null' case it might be better to keep it as "Null passed" or even "Null value passed". This is different than the 'nil' case because the diagnostic is not referring to a literal.
Comment Actions
Looks like Sema uses "null" not only when referring to literals (see below). Also, if we were referring to literals, we would use single quotes, no?
I suggest keeping as is for consistency with the wording that uses nil. I do not see much difference between the two cases..
TestObject * _Nonnull returnsNilObjCInstanceDirectly() { // The first warning is from Sema. The second is from the static analyzer. return nil; // expected-warning {{null returned from function that requires a non-null return value}} // expected-warning@-1 {{nil returned from a function that is expected to return a non-null value}} }
Comment Actions
Looks good.
While you are here, you might consider changing: the checkBind() diagnostic to match the other diagnostics:
"Null assigned to a pointer which is expected to have non-null value" --> "Null assigned to a pointer which is expected to have *a* non-null value"