Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0124-issue-48395.swift
Slava Pestov e65290c2bd Sema: Associated type inference skips witnesses that might trigger a request cycle
This implements a structural walk over the TypeRepr to catch
situations where we attempt to infer `A` from `func f(_: A)`,
which references the concrete `A` that will be synthesized
in the conforming type.

Fixes:
- rdar://34956654 / https://github.com/apple/swift/issues/48680
- rdar://38913692 / https://github.com/apple/swift/issues/49066
- rdar://56672411
- https://github.com/apple/swift/issues/50010
- rdar://81587765 / https://github.com/apple/swift/issues/57355
- rdar://117442510
2023-11-14 12:08:59 -05:00

19 lines
408 B
Swift

// RUN: %target-swift-frontend -emit-ir %s
// https://github.com/apple/swift/issues/48395
public struct DefaultAssociatedType {
}
protocol Protocol {
associatedtype AssociatedType = DefaultAssociatedType
init(object: AssociatedType)
}
public final class Conformance: Protocol {
private let object: AssociatedType
public init(object: AssociatedType) {
self.object = object
}
}