Uploaded image for project: 'Swift'
  1. Swift
  2. SR-9789

Use "pretty" nullability in generated ObjC headers

    XMLWordPrintable

    Details

      Description

      Objective-C supports two "pretty" forms for nullability qualifiers: within the parentheses of a method's parameters or return type:

      - (id _Nullable)computate:(int * _Nonnull)values;
      
      - (nullable id)computate:(nonnull int *)values;
      

      And in the property attributes list for a property:

      @property id _Nullable owner;
      
      @property (nullable) id owner;
      

      PrintAsObjC should adopt these where valid; right now it only uses them in hardcoded cases for instancetype.

        Attachments

          Activity

            People

            Assignee:
            adellibovi Alfredo Delli Bovi
            Reporter:
            jrose Jordan Rose
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: