Avatar
Avatar
kntk
@swift-5.3.3 @swift-5.10.1 protocol P { } extension P { static func value(_ a: Bool) { } } struct A: P { var string: String } extension Optional: P where Wrapped: P { } extension A { static var value: A? { A(string: "A") } } let a: A? = .value print(a) (edited)
exit status: 1 with <stdin>:16:14: error: value of optional type 'A?' must be unwrapped to a value of type 'A' let a: A? = .value ^ (edited)
861 bytes