diff --git a/validation-test/compiler_crashers_2_fixed/rdar54394068.swift b/validation-test/compiler_crashers_2_fixed/rdar54394068.swift new file mode 100644 index 0000000000000..6863a22e28cf5 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/rdar54394068.swift @@ -0,0 +1,55 @@ +// RUN: %target-swift-frontend -typecheck -verify %s + +protocol A { + associatedtype BType: B where BType.AType == Self + associatedtype CType: C where CType.AType == Self + + var b: BType { get } + var c: CType { get set } + + func bGetter() -> BType + mutating func cSetter(_ newC: CType) + + subscript (b: BType) -> CType { get set } +} + +protocol B { + associatedtype AType: A +} + +protocol C { + associatedtype AType: A +} + +struct AImpl: A { + typealias BType = BImpl + typealias CType = CImpl + + let b: BImpl + var c: CImpl + + func bGetter() -> BImpl { + return b + } + + mutating func cSetter(_ newC: CImpl) { + c = newC + } + + subscript(b: BImpl) -> CImpl { + get { + return c + } + set { + c = newValue + } + } +} + +struct BImpl: B { + typealias AType = AImpl +} + +struct CImpl: C { + typealias AType = AImpl +} diff --git a/validation-test/compiler_crashers_2_fixed/sr7002.swift b/validation-test/compiler_crashers_2_fixed/sr7002.swift new file mode 100644 index 0000000000000..72b3c6d092350 --- /dev/null +++ b/validation-test/compiler_crashers_2_fixed/sr7002.swift @@ -0,0 +1,8 @@ +// RUN: not %target-swift-frontend -typecheck %s + +struct Foo: OptionSet { + let rawValue: Int + static let none = Foo(rawValue: 1 << 0) +} + +extension Foo: ExpressibleByIntegerLiteral { }