Avatar
Avatar
koher
@swift-5.5.3 protocol P { func foo() -> Int? } struct S: P { func foo() -> Int { 42 } }
exit status: 1 with stderr:<stdin>:5:8: error: type 'S' does not conform to protocol 'P' struct S: P { ^ <stdin>:6:10: note: candidate has non-matching type '() -> Int' func foo() -> Int { 42 } ^ <stdin>:2:10: note: protocol requires function 'foo()' with type '() -> Int?'; do you want to add a stub? func foo() -> Int? ^