Files
swift-mirror/validation-test/compiler_crashers_2_fixed/sr8968.swift
Slava Pestov 07f8f551ed Add a regression test for SR-8968
Also rdar://problem/45217645.
2019-11-01 18:55:16 -04:00

47 lines
1.2 KiB
Swift

// RUN: %target-swift-frontend -typecheck %s
class OFMAttachment : NativeInserting {
typealias SnapshotType = Message.Attachment
}
protocol Snapshotting {
associatedtype NativeType: NativeInserting where NativeType.SnapshotType == Self
associatedtype RecordType: SnapshotRecord where RecordType.SnapshotType == Self
associatedtype ChangeType: SnapshotChange where ChangeType.SnapshotType == Self
static var baseMessageName: String { get }
}
protocol NativeInserting {
associatedtype SnapshotType : Snapshotting where SnapshotType.NativeType == Self
}
protocol SnapshotRecord {
associatedtype SnapshotType : Snapshotting where SnapshotType.RecordType == Self
}
protocol SnapshotChange {
associatedtype SnapshotType : Snapshotting where SnapshotType.ChangeType == Self
}
struct Message {
enum Attachment : Snapshotting {
static var baseMessageName: String = "attachment"
typealias NativeType = OFMAttachment
typealias RecordType = Record
typealias ChangeType = Change
struct Record : SnapshotRecord {
typealias SnapshotType = Message.Attachment
}
struct Change : SnapshotChange {
typealias SnapshotType = Message.Attachment
}
}
}