Skip to content

Commit 7567a15

Browse files
authored
[test] Add test for deserialization of generic protocol witnesses (#17141)
This failed in Swift 4.1 because of a problem with Substitutions, but that whole model's been ripped out and redone in Swift 4.2. https://bugs.swift.org/browse/SR-7978
1 parent a6ba767 commit 7567a15

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-build-swift -emit-module-path %t/Lib.swiftmodule %s -module-name Lib
3+
// RUN: echo 'import Lib; _ = MyClass(with: "test", and: 341)' | %target-build-swift -I %t -typecheck -
4+
5+
public protocol MyProtocol {
6+
var string: String { get }
7+
var int: Int { get }
8+
9+
init(with string: String, and int: Int)
10+
11+
func doSomething<T, U>(with this: T, for string: String, expecting: U.Type) throws -> U
12+
func doSomething<T>(with this: T, for string: String) throws
13+
}
14+
15+
public class MyClass: MyProtocol {
16+
public var string: String
17+
public var int: Int
18+
19+
public required init(with string: String, and int: Int) {
20+
self.string = string
21+
self.int = int
22+
}
23+
24+
public func doSomething<T>(with this: T, for string: String) throws {}
25+
public func doSomething<T, U>(with this: T, for string: String, expecting: U.Type) throws -> U {
26+
fatalError()
27+
}
28+
}

0 commit comments

Comments
 (0)