Files
swift-mirror/validation-test/compiler_crashers_2/sr11232.swift
Arnold Schwaighofer 031dead69c Try to fix failure of this test on noasserts builds of the compiler
This test failed on the oss-swift_tools-R_stdlib-RD_test-simulator bot.

rdar://54707188
2019-08-26 08:19:26 -07:00

29 lines
660 B
Swift

// RUN: not --crash %target-swift-emit-silgen %s
// REQUIRES: asserts
protocol Pub {
associatedtype Other
associatedtype Failure: Error
}
class AnyPub<Other, Failure: Error> {}
extension Pub {
func erase() -> AnyPub<Other, Failure> {
return AnyPub<Other, Failure>()
}
}
protocol ObsObj : Pub {
associatedtype NeverPub : Pub where Self.NeverPub.Failure == Never
}
class Subject<Other, Failure: Error> : Pub {}
extension Pub where Other: ObsObj, Other.NeverPub: Subject<Int, Error> {
static func f() -> AnyPub<Other.NeverPub.Other, Other.NeverPub.Failure> {
return Subject<Other.NeverPub.Other, Other.NeverPub.Failure>().erase()
}
}