Skip to content

[PrintAsObjC] Special-case <os/object.h> types, like Dispatch. #6544

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

Merged

Conversation

jrose-apple
Copy link
Contributor

These have historically been defined as protocols in Objective-C (under a pile of macros), but when imported into Swift they're classes instead. Reverse this bit of magic by hard-coding the prefix "OS_" and the header <os/object.h>, and emitting the classic foo_bar_t-style type names.

rdar://problem/29790636

These have historically been defined as protocols in Objective-C
(under a pile of macros), but when imported into Swift they're classes
instead. Reverse this bit of magic by hard-coding the prefix "OS_" and
the header <os/object.h>, and emitting the classic 'foo_bar_t'-style
type names.

rdar://problem/29790636
@jrose-apple jrose-apple force-pushed the PrintAsObjC-os-object-types branch from 50867e1 to e5f0a7b Compare January 4, 2017 03:50
@jrose-apple
Copy link
Contributor Author

@milseman Can you confirm that this makes sense? (And ask any necessary questions.)

@swift-ci Please smoke test

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. How was this (not) working before, did we just never hit this case?

// CHECK-LABEL: @interface Test : NSObject{{$}}
public class Test : NSObject {
// CHECK-NEXT: - (void)thank:(dispatch_queue_t _Nonnull)queue;
public func thank(_ queue: DispatchQueue) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@jrose-apple
Copy link
Contributor Author

I have to assume no one ever called any of the methods they exposed to Objective-C that involved Dispatch types. Or that people have worked around it in some other way.

@jrose-apple jrose-apple merged commit b1c793e into swiftlang:master Jan 4, 2017
@jrose-apple jrose-apple deleted the PrintAsObjC-os-object-types branch January 4, 2017 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants