mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
20 lines
828 B
Swift
20 lines
828 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// We used to crash -- https://github.com/apple/swift/issues/69318
|
|
|
|
public protocol View {
|
|
associatedtype NodeChildren: ViewGraphNodeChildren
|
|
}
|
|
|
|
public protocol ViewGraphNodeChildren {
|
|
associatedtype ParentView: View where ParentView.NodeChildren == Self
|
|
// expected-note@-1 {{protocol requires nested type 'ParentView'; add nested type 'ParentView' for conformance}}
|
|
}
|
|
|
|
public protocol ChildlessView: View where NodeChildren == EmptyViewGraphNodeChildren<Self> {}
|
|
// expected-error@-1 {{circular reference}}
|
|
|
|
public struct EmptyViewGraphNodeChildren<ParentView: ChildlessView>: ViewGraphNodeChildren {}
|
|
// expected-note@-1 3{{through reference here}}
|
|
// expected-error@-2 {{type 'EmptyViewGraphNodeChildren<ParentView>' does not conform to protocol 'ViewGraphNodeChildren'}}
|