-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Allow @objc(Name) on enums #618
Conversation
// FIXME: @objc(Renamed) enums should work | ||
// XFAIL: * | ||
|
||
// RUN: %target-swift-frontend -emit-sil %s -import-objc-header %S/Inputs/enum-objc.h -verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if this sort of test is the right way to do this, but I was using the test/ClangModules/enum-new.swift
test as a prototype.
Thanks for working on this! |
@@ -0,0 +1,12 @@ | |||
// FIXME: @objc(Renamed) enums should work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, you should be able to add the flag -enable-swift-name-lookup-tables to this test to get it working now. The Swift name lookup tables aren't on by default just yet, but they address this problem already.
6863263
to
409597d
Compare
I've updated the PR as per feedback. Tests are now part of the relevant commits, the enum constant prefix bit was pulled out into #743, and I've added relevant code to the resolve-cross-language test. A couple of the tests have |
Looks great. Thank you! I merged #743 just now. Do you want to fix these tests first or just do a follow-up? |
I'll fix the tests now. |
409597d
to
1dc44b2
Compare
@jrose-apple Rebased and updated to remove the FIXMEs. |
Aren't these commits in the wrong order? Ideally every commit should be build-and-testable on its own, although I suppose that matters less in a merge. |
@jrose-apple GitHub bug, it's showing the commits in the wrong order. If you look at the branch they're ordered Sema, PrintObjC, ClangImporter. This bug can occur when rewriting commits, because it's sorting based on AuthorDate instead of actual topographical order or CommitDate. |
Weird, okay. Doing one more check on my machine, then I'll merge. ("It's not that I don't trust you…") |
Yeah, it's annoying. I filed a support ticket over a year ago about this, and they still haven't fixed it :/ |
Allow @objc(Name) on enums. rdar://problem/21930334
[DO NOT MERGE] Update swift-argument-parser
This implements support for
A new macro for the generated header is defined called
SWIFT_ENUM_NAMED
and the above declaration looks likeSince
swift_name
doesn't actually work properly yet when importing Obj-C enums, there's an XFAILed test that tests the clang importer here.This does NOT cover support for
@objc(Name)
on the individualcase
declarations.