Skip to content

Commit d59f01d

Browse files
committed
Add regression test for a fixed crasher
This test case was also posted by a developer in https://bugs.swift.org/browse/SR-11153, but it appears to be a different problem that was fixed in Swift 5.2.
1 parent fce1f2c commit d59f01d

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
protocol Snapshotting {
2+
associatedtype NativeType: NativeInserting where NativeType.SnapshotType == Self
3+
associatedtype ChangeType: SnapshotChange where ChangeType.SnapshotType == Self
4+
}
5+
6+
protocol NativeInserting {
7+
associatedtype SnapshotType : Snapshotting where SnapshotType.NativeType == Self
8+
}
9+
10+
protocol SnapshotProperties : OptionSet where RawValue == Int {
11+
static var all: Self { get }
12+
}
13+
14+
protocol SnapshotChange {
15+
associatedtype SnapshotType : Snapshotting where SnapshotType.ChangeType == Self
16+
associatedtype PropertiesType : SnapshotProperties
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// RUN: %target-swift-frontend -emit-ir -primary-file %S/Inputs/sr11153_2_other.swift -primary-file %s
2+
// RUN: %target-swift-frontend -emit-ir %S/Inputs/sr11153_2_other.swift %s
3+
4+
class WatchRegistry {
5+
func single<S: Snapshotting>(objectType: S.Type) throws -> Watch<S>
6+
{
7+
return try Watch<S>.singleObject(objectType: S.self, properties: S.ChangeType.PropertiesType.all)
8+
}
9+
}
10+
11+
class Watch<SnapshotType : Snapshotting> {
12+
static func singleObject(objectType: SnapshotType.Type, properties: SnapshotType.ChangeType.PropertiesType) throws -> Watch<SnapshotType> {
13+
fatalError()
14+
}
15+
}

0 commit comments

Comments
 (0)