Skip to content

Commit f36c6d7

Browse files
author
Max Moiseev
committed
[stdlib] enabling improved diagnostics for .Some and .None in pattern matching
1 parent 35471ab commit f36c6d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/Optional.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,11 @@ public func ?? <T> (optional: T?, defaultValue: @autoclosure () throws -> T?)
518518
extension Optional {
519519
@available(*, unavailable, renamed: "none")
520520
public static var None: Optional<Wrapped> {
521-
Builtin.unreachable()
521+
return .none
522522
}
523523
@available(*, unavailable, renamed: "some")
524-
public static func Some(_: Wrapped) -> Optional<Wrapped> {
525-
Builtin.unreachable()
524+
public static func Some(x: Wrapped) -> Optional<Wrapped> {
525+
return .some(x)
526526
}
527527

528528
}

0 commit comments

Comments
 (0)