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-3203] Never return function is not representable in ObjC #45791

Closed
rintaro mannequin opened this issue Nov 14, 2016 · 3 comments
Closed

[SR-3203] Never return function is not representable in ObjC #45791

rintaro mannequin opened this issue Nov 14, 2016 · 3 comments

Comments

@rintaro
Copy link
Mannequin

@rintaro rintaro mannequin commented Nov 14, 2016

Previous ID SR-3203
Radar None
Original Reporter @rintaro
Type Bug
Status Resolved
Resolution Done
Environment

Xcode Version 8.1 (8B62)
Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.0Regression
Assignee @slavapestov
Priority Medium

md5: 60c1e6db25cf28a3cede4cc08fa409cd

Issue Description:

In Swift2.3,

class Foo: NSObject {
    @objc @noreturn func die() {
        fatalError("die")
    }
}

was represented in Objective-C as

@interface Foo : NSObject
- (void)die;

In Swift3:

class Foo: NSObject {
    @objc func die() -> Never {
        fatalError("die")
    }
}

cannot be compiled as:

test.swift:4:14: error: method cannot be marked @objc because its result type cannot be represented in Objective-C
  @objc func die() -> Never {
             ^
test.swift:4:23: note: non-'@objc' enums cannot be represented in Objective-C
  @objc func die() -> Never {
                      ^~~~~
@rintaro
Copy link
Mannequin Author

@rintaro rintaro mannequin commented Nov 14, 2016

Compiling Swift 2.3 code results compiler crash.
025284bb

@rintaro
Copy link
Mannequin Author

@rintaro rintaro mannequin commented Nov 14, 2016

CC: @slavapestov the original author of SE-0102 implementation.

@slavapestov
Copy link
Member

@slavapestov slavapestov commented Jan 4, 2017

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant