Files
swift-mirror/test/Interpreter/issue-53332.swift

36 lines
983 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %target-run %t/a.out
// REQUIRES: executable_test
// https://github.com/apple/swift/issues/53332
public protocol SupportedPropertyType { }
public protocol TypedSupportedType: SupportedPropertyType where FactoryType.BuildType == Self {
associatedtype FactoryType: TypedSupportedTypeFactory
}
public protocol TypedSupportedTypeFactory {
associatedtype BuildType: SupportedPropertyType
}
public class Factory<BuildType: TypedSupportedType>: TypedSupportedTypeFactory {
}
public struct ContentMode : TypedSupportedType {
public typealias FactoryType = Factory<ContentMode>
}
func bar<T : SupportedPropertyType>(_: T.Type) {}
func baz<T : TypedSupportedType>(_ t: T.Type) {
bar(t)
}
// This used to recurse infinitely because the base witness table
// for 'ContentMode : SupportedPropertyType' was incorrectly
// minimized away.
baz(ContentMode.self)