Refine diagnostic: attribute 'nonnull' applies to both functions and methods.