Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9789] Use "pretty" nullability in generated ObjC headers #52214

Open
belkadan opened this issue Jan 29, 2019 · 4 comments
Open

[SR-9789] Use "pretty" nullability in generated ObjC headers #52214

belkadan opened this issue Jan 29, 2019 · 4 comments
Assignees
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement PrintAsClang Area → compiler: The PrintAsClang library

Comments

@belkadan
Copy link
Contributor

Previous ID SR-9789
Radar None
Original Reporter @belkadan
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, PrintAsObjC, StarterBug
Assignee @adellibovi
Priority Medium

md5: 0bc925759fd7590c0a91c67c7a5de68f

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

@belkadan
Copy link
Contributor Author

Part of rdar://problem/47493396. I think this is StarterBug-able: find all the places where we're using the getObjectTypeAndOptionality helper and see which ones are places where we could print the nullability separately using NullabilityPrintKind::ContextSensitive.

@adellibovi
Copy link
Contributor

hi @belkadan, I would like to take this one, can I assign it to myself? 🙂

@belkadan
Copy link
Contributor Author

belkadan commented Feb 7, 2019

Go for it! Feel free to comment here if you have questions, or open a partial PR even if you don't have it fully working.

@belkadan
Copy link
Contributor Author

@adellibovi, still working on this one?

(I'm checking in on all the StarterBugs that haven't been touched in over a month; it's totally fine if you just haven't had time but still want to keep it.)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself good first issue Good for newcomers improvement PrintAsClang Area → compiler: The PrintAsClang library
Projects
None yet
Development

No branches or pull requests

2 participants