Skip to content

Commit f25545b

Browse files
committed
Add a module interface test
1 parent b35ac50 commit f25545b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name ValueGeneric
3+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name ValueGeneric
4+
// RUN: %FileCheck %s < %t.swiftinterface
5+
6+
// CHECK: public struct Vector<Element, let N : Swift.Int>
7+
public struct Vector<Element, let N: Int> {
8+
// CHECK-LABEL: public var count: Swift.Int {
9+
// CHECK-NEXT: get {
10+
// CHECK-NEXT: N
11+
// CHECK-NEXT: }
12+
// CHECK-NEXT: }
13+
@inlinable
14+
public var count: Int {
15+
N
16+
}
17+
}
18+
19+
// CHECK: public func usesGenericVector<let N : Swift.Int>(_: ValueGeneric.Vector<Swift.Int, N>)
20+
public func usesGenericVector<let N: Int>(_: Vector<Int, N>) {}
21+
22+
// CHECK: public func usesConcreteVector(_: ValueGeneric.Vector<Swift.Int, 2>)
23+
public func usesConcreteVector(_: Vector<Int, 2>) {}
24+
25+
// CHECK: public func usesNegativeVector(_: ValueGeneric.Vector<Swift.String, -10>)
26+
public func usesNegativeVector(_: Vector<String, -10>) {}

0 commit comments

Comments
 (0)