Skip to content

Commit 3bf6543

Browse files
author
Karl Wagner
committed
Add Serialization test for nested protocols
1 parent 479819b commit 3bf6543

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
public struct Outer {
2+
public protocol Inner {
3+
func foo()
4+
}
5+
}
6+
7+
extension Outer {
8+
public protocol InnerInExtension {
9+
func bar()
10+
}
11+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -emit-module -module-name nestedprotocolsource -emit-module-path %t/nestedprotocolsource.swiftmodule -primary-file %S/Inputs/nested-protocols.swift -enable-experimental-feature NestedProtocols
3+
// RUN: %target-swift-frontend -emit-sil %s -I %t | Filecheck %s
4+
5+
import nestedprotocolsource
6+
7+
// CHECK: usesNested<A>(_:)
8+
// CHECK-NEXT: sil @$s4main10usesNestedyyx20nestedprotocolsource5OuterV5InnerRzlF :
9+
public func usesNested(_ x: some Outer.Inner) {}
10+
11+
// CHECK: usesNestedInExtension<A>(_:)
12+
// CHECK-NEXT: sil @$s4main21usesNestedInExtensionyyx20nestedprotocolsource5OuterV05InnerdE0RzlF :
13+
public func usesNestedInExtension(_ x: some Outer.InnerInExtension) {}

0 commit comments

Comments
 (0)