Skip to content

Commit dcc1bae

Browse files
committed
Update test to remove dependency on Foundation.
Using APIs from Foundation and the standard library can be a source of pain and can create fragile tests due to API changes. This reduces the test case to pure swift and eliminates the use of the standard library APIs.
1 parent 01fb8cf commit dcc1bae

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

test/NameBinding/InheritedConformance.swift

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,17 @@
44
// RUN: %target-swift-frontend -parse -primary-file %t/main.swift -emit-reference-dependencies-path - > %t.swiftdeps
55

66
// SR-1267, SR-1270
7-
import Foundation
7+
class TypeType<T> { }
8+
protocol ProtocolType {}
89

9-
class TypeType<T where T: NSString> {
10-
func call(notification: NSNotification?) {
11-
let set = NSOrderedSet()
12-
if let objects = set.array as? [T] {
13-
let _ = (notification?.userInfo?["great_key"] as? NSSet).flatMap { updatedObjects in
14-
return updatedObjects.filter({ element in
15-
guard let element = element as? T
16-
where objects.index(of: element) != nil
17-
else {
18-
return false
19-
}
20-
return true
21-
})
22-
} ?? []
23-
}
10+
struct StructType<T> { }
11+
extension StructType where T : ProtocolType {
12+
func testCase<T>() -> TypeType<T> {
13+
return TypeType<T>()
2414
}
15+
}
16+
17+
class TestView : ProtocolType {}
18+
extension StructType where T : TestView {
19+
var typeType : TypeType<T> { return testCase() }
2520
}

0 commit comments

Comments
 (0)