Skip to content

Update borrowing syntax in lifetime_dependence_optional.swift #73028

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

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions test/SILOptimizer/lifetime_dependence_optional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// REQUIRES: asserts
// REQUIRES: swift_in_compiler

// REQUIRES: rdar126415070

// Simply test that it is possible for a module to define a pseudo-Optional type without triggering any compiler errors.

public protocol ExpressibleByNilLiteral: ~Copyable & ~Escapable {
Expand Down Expand Up @@ -61,7 +59,7 @@ extension Nillable where Wrapped: ~Copyable {
_ transform: (borrowing Wrapped) throws(E) -> U
) throws(E) -> U? {
switch self {
case .some(_borrowing y):
case .some(borrowing y):
return .some(try transform(y))
case .none:
return .none
Expand All @@ -85,7 +83,7 @@ extension Nillable where Wrapped: ~Copyable {
_ transform: (borrowing Wrapped) throws(E) -> U?
) throws(E) -> U? {
switch self {
case .some(_borrowing y):
case .some(borrowing y):
return try transform(y)
case .none:
return .none
Expand Down