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-6456] Generated Swift interface for ObjC methods uses @objc names instead of Swift names #49006

Open
swift-ci opened this issue Nov 22, 2017 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-6456
Radar None
Original Reporter nzhuk (JIRA User)
Type Bug
Environment

Xcode Version 9.1 (9B55)
Apple Swift version 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)
Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 1
Component/s Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: ffe0f335c9dfb9db2dc05f28bb7810cf

Issue Description:

Swift interface generator seems to be using ObjC type names when generating Swift interfaces for ObjC methods which have parameters which have been defined in Swift and have custom ObjC names.

ClassA.swift

import Foundation

@objc(PREFIXClassA) class ClassA: NSObject { }

ClassC.h

#import <Foundation/Foundation.h>

@class PREFIXClassA;

@interface ClassC : NSObject
- (instancetype)initWithObjA:(PREFIXClassA *)swiftObjA;
@end

Generated Interface (Swift 4), Current

import Foundation

open class ClassC : NSObject {

    public init!(objA swiftObjA: PREFIXClassA!)
}

Generated Interface (Swift 4), Expected

import Foundation

open class ClassC : NSObject {

    public init!(objA swiftObjA: ClassA!)
}
@belkadan
Copy link
Contributor

@nkcsgexi, who owns generated interfaces for C headers?

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants