Skip to content

Commit bdd08ac

Browse files
committed
ModuleInterface: Adopt swiftinterface verification lit substitutions in inherited-generic-parameters.swift. This revealed that function decls without explicit parameter names can be printed into swiftinterfaces with duplicate synthesized names so update the test to avoid that bug.
1 parent 83ed2dc commit bdd08ac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/ModuleInterface/inherited-generic-parameters.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// RUN: %empty-directory(%t)
22

3-
// RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
3+
// RUN: %target-swift-emit-module-interface(%t/main.swiftinterface) %s
4+
// RUN: %target-swift-typecheck-module-from-interface(%t/main.swiftinterface)
45
// RUN: %FileCheck %s < %t/main.swiftinterface
56

67
// RUN: %target-swift-frontend -emit-module -module-name main -primary-file %s -emit-module-path %t/main~partial.swiftmodule -enable-library-evolution
78

89
// RUN: %target-swift-frontend -merge-modules %t/main~partial.swiftmodule -emit-module-path %t/main.swiftmodule -emit-module-interface-path %t/main.swiftinterface -enable-library-evolution
10+
// RUN: %target-swift-typecheck-module-from-interface(%t/main.swiftinterface)
911
// RUN: %FileCheck %s < %t/main.swiftinterface
1012

1113
// This test makes sure that we substitute uses of the superclass's generic
@@ -16,8 +18,8 @@ public class Base<In, Out> {
1618
// CHECK-NEXT: public init(x: @escaping (In) -> Out)
1719
public init(x: @escaping (In) -> Out) {}
1820

19-
// CHECK-NEXT: public init<A>(_: A, _: A)
20-
public init<A>(_: A, _: A) {}
21+
// CHECK-NEXT: public init<A>(_ a1: A, _ a2: A)
22+
public init<A>(_ a1: A, _ a2: A) {}
2123

2224
// CHECK-NEXT: public init<C>(_: C) where C : main.Base<In, Out>
2325
public init<C>(_: C) where C : Base<In, Out> {}
@@ -27,7 +29,7 @@ public class Base<In, Out> {
2729
// CHECK: public class Derived<T> : {{(main.)?}}Base<T, T> {
2830
public class Derived<T> : Base<T, T> {
2931
// CHECK-NEXT: override public init(x: @escaping (T) -> T)
30-
// CHECK-NEXT: override public init<A>(_ argument: A, _ argument: A)
32+
// CHECK-NEXT: override public init<A>(_ a1: A, _ a2: A)
3133
// CHECK-NEXT: override public init<C>(_ argument: C) where C : main.Base<T, T>
3234
// CHECK-NEXT: {{(@objc )?}}deinit
3335
// CHECK-NEXT: }

0 commit comments

Comments
 (0)