Avatar
Avatar
yutailang0119
@swift-6.0.3 struct Implicit { let foo = "foo" init!() { return nil } } let implicit = Implicit() (implicit.foo ?? "") (edited)
exit status: 1 with <stdin>:10:2: error: value of optional type 'Implicit?' must be unwrapped to refer to member 'foo' of wrapped base type 'Implicit' 8 | 9 | let implicit = Implicit() 10 | (implicit.foo ?? "") | |- error: value of optional type 'Implicit?' must be unwrapped to refer to member 'foo' of wrapped base type 'Implicit' | `- note: chain the optional using '?' to access member 'foo' only for non-'nil' base values 11 | (edited)