Avatar
Avatar
kntk
@swift-5.3.3 @swift-5.10 struct A { static var value: A? { A() } } extension Optional { static func value(_ a: Bool) { } } let a: A? = .value (edited)
exit status: 1 with <stdin>:8:14: error: value of optional type 'A?' must be unwrapped to a value of type 'A' let a: A? = .value ^ <stdin>:8:14: note: coalesce using '??' to provide a default when the optional value contains 'nil' let a: A? = .value ^ ?? <#default value#> <stdin>:8:14: note: force-unwrap using '!' to abort execution if the optional value contains 'nil' let a: A? = .value ^ ! (edited)