Avatar
@swift-5.3.3 protocol MutableCollection { associatedtype Element mutating func append(_ element: Element) } protocol _LinkedList: MutableCollection { init(_: Self) } extension _LinkedList { mutating func append(_ element: Element) { self = .init(self) } } final class LinkedList<Element>: _LinkedList { typealias Element = Element init() {} init(_: LinkedList<Element>) {} } var list: LinkedList<Int> = .init() print(ObjectIdentifier(list)) list.append(42) print(ObjectIdentifier(list))