|
10 | 10 | // RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -emit-module \
|
11 | 11 | // RUN: -enable-experimental-feature NoncopyableGenerics \
|
12 | 12 | // RUN: -enable-experimental-feature NonescapableTypes \
|
| 13 | +// RUN: -enable-experimental-feature BorrowingSwitch \ |
13 | 14 | // RUN: -o %t/Swiftskell.swiftmodule \
|
14 | 15 | // RUN: -emit-module-interface-path %t/Swiftskell.swiftinterface \
|
15 | 16 | // RUN: %S/../Inputs/Swiftskell.swift
|
@@ -150,42 +151,29 @@ import NoncopyableGenerics_Misc
|
150 | 151 |
|
151 | 152 | import Swiftskell
|
152 | 153 |
|
153 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
154 |
| -// CHECK-NEXT: public protocol Show : ~Copyable { |
| 154 | +// CHECK-DAG: public protocol Show : ~Copyable { |
155 | 155 |
|
156 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
157 |
| -// CHECK-NEXT: public func print(_ s: borrowing some Show & ~Copyable) |
| 156 | +// CHECK-DAG: public func print(_ s: borrowing some Show & ~Copyable) |
158 | 157 |
|
159 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
160 |
| -// CHECK-NEXT: public protocol Eq : ~Copyable { |
| 158 | +// CHECK-DAG: public protocol Eq : ~Copyable { |
161 | 159 |
|
162 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
163 |
| -// CHECK-NEXT: extension Swiftskell.Eq where Self : ~Copyable { |
| 160 | +// CHECK-DAG: extension Swiftskell.Eq where Self : ~Copyable { |
164 | 161 |
|
165 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
166 |
| -// CHECK-NEXT: public protocol Generator : ~Copyable { |
167 |
| -// CHECK-NEXT: associatedtype Element : ~Copyable |
168 |
| - |
169 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
170 |
| -// CHECK-NEXT: public struct Vector<T> where T : ~Copyable { |
| 162 | +// CHECK-DAG: public enum Either<Success, Failure> where Failure : Swift.Error, Success : ~Copyable { |
171 | 163 |
|
172 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
173 |
| -// CHECK-NEXT: public enum Maybe<Value> where Value : ~Copyable { |
| 164 | + /// This one is position dependent so we can ensure the associated type was printed correctly. |
| 165 | +// CHECK: public protocol Generator : ~Copyable { |
| 166 | +// CHECK-NEXT: associatedtype Element : ~Copyable |
174 | 167 |
|
175 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
176 |
| -// CHECK-NEXT: extension Swiftskell.Maybe : Swiftskell.Show where Value : ~Copyable { |
| 168 | +// CHECK-DAG: public struct Vector<T> where T : ~Copyable { |
177 | 169 |
|
178 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
179 |
| -// CHECK-NEXT: extension Swiftskell.Maybe : Swiftskell.Eq where Value : Swiftskell.Eq, Value : ~Copyable { |
| 170 | +// CHECK-DAG: public enum Maybe<Value> : ~Copyable where Value : ~Copyable { |
180 | 171 |
|
181 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
182 |
| -// CHECK-NEXT: public func maybe<A, B>(_ defaultVal: B, _ fn: (consuming A) -> B) -> (consuming Swiftskell.Maybe<A>) -> B where A : ~Copyable |
| 172 | +// CHECK-DAG: extension Swiftskell.Maybe : Swiftskell.Show where Value : Swiftskell.Show, Value : ~Copyable { |
183 | 173 |
|
184 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
185 |
| -// CHECK-NEXT: @inlinable public func fromMaybe<A>(_ defaultVal: A) -> (Swiftskell.Maybe<A>) -> A { |
| 174 | +// CHECK-DAG: extension Swiftskell.Maybe : Swiftskell.Eq where Value : Swiftskell.Eq, Value : ~Copyable { |
186 | 175 |
|
187 |
| -// CHECK: #if compiler(>=5.3) && $NoncopyableGenerics |
188 |
| -// CHECK-NEXT: public func isJust<A>(_ m: borrowing Swiftskell.Maybe<A>) -> Swift.Bool where A : ~Copyable |
| 176 | +// CHECK-DAG: public func isJust<A>(_ m: borrowing Swiftskell.Maybe<A>) -> Swift.Bool where A : ~Copyable |
189 | 177 |
|
190 | 178 |
|
191 | 179 | struct FileDescriptor: ~Copyable, Eq, Show {
|
|
0 commit comments