[swift-evolution] [Review] SE-0102: Remove @noreturn attribute and introduce an empty NoReturn type

Ben Rimmington me at benrimmington.com
Tue Jun 21 13:01:54 CDT 2016


<https://github.com/apple/swift-evolution/blob/master/proposals/0102-noreturn-bottom-type.md>

Alternative names:

func infiniteLoop() -> _ { // Use an underscore instead?
    while true {}
}

func infiniteLoop() -> Unreachable {
    while true {}
}

func infiniteLoop() -> Unreachable<Void> {
    while true {}
}

Issues:

* Clang and Swift 2.2 allow non-returning functions to have a non-void return type.

* [LibraryEvolution.rst] @noreturn is a versioned attribute, so how will this proposal affect that design?

<https://github.com/apple/swift/blob/master/docs/LibraryEvolution.rst>

-- Ben



More information about the swift-evolution mailing list