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
Fix issue 19700: Obj-C wrong code overloading selectors and extern(D) #9402
Fix issue 19700: Obj-C wrong code overloading selectors and extern(D) #9402
Conversation
The issue is that if an Objective-C class contains at least one method with a body it will be considered an internally defined class. This means that for a declaration for a class that is supposed to be defined externally it won't look for this class externally when linking. Basically the internally defined class has taken precedence over the externally defined class. When some of the methods don't have a body a runtime exception will occur in the Objective-C runtime when they're called. The fix is to require `extern (Objective-C) extern` for externally defined classes. For internally defined classes, `extern (Objective-C)` is used.
Thanks for your pull request and interest in making D better, @jacob-carlborg! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "stable + dmd#9402" |
Doc update: dlang/dlang.org#2594. |
Buildkite failure is unrelated. Docs have the same problem as the dlang.org PR |
I was really hoping to get this PR included in the release, to avoid having to go through a deprecation cycle for a newly added feature. What do I need to do? |
IDK @wilzbach @MartinNowak ? |
Thanks. |
@wilzbach don't forget the dlang.org PR |
Sorry, this didn't work too well with the release schedule. It was now merged after the release has been tagged (and the PR was created after the release candidate). Please check that the necessary changes are all included on stable for 2.085.1, I guess the changelog fixups will be missing. |
For the record, the tools/changed program should have long been updated to purge local changelogs right away when aggregating them and thus allowing edits of the preview changelogs in dlang.org/changelog. |
This is a breaking change. |
Yeah, I know it was tight, but no release had been announced so I took a chance. Would it hurt creating a new release candidate and then retag the release? |
Too late, sorry. Beta and release dates are fixed since about a year, see D release schedule. |
I do have a life outside of D. If there's a lot of work to create a release the process is broken. It should be one click/push to create a release. |
I have asked for feedback on this issue long before the original implementation was done (long before the beta was started) but received sparse or none feedback at all. The issue this PR solves came in very late. I did communicate with Sebastian. I don't know all the exact channels or procedures to use. |
The issue is that if an Objective-C class contains at least one method with a body it will be considered an internally defined class. This means that for a declaration for a class that is supposed to be defined externally it won't look for this class externally when linking. Basically the internally defined class has taken precedence over the externally defined class. When some of the methods don't have a body a runtime exception will occur in the Objective-C runtime when they're called.
The fix is to require
extern (Objective-C) extern
for externally defined classes. For internally defined classes,extern (Objective-C)
is used.