Avatar
Avatar
ジュニア
@swift-main protocol P { func foo() -> Int? } struct S: P { func foo() -> Int { 0 } }
swiftNightly BOT 10/31/2025 1:38 PM
exit status 1 with stderr:<stdin>:5:8: error: type 'S' does not conform to protocol 'P' 1 | protocol P { 2 | func foo() -> Int? | `- note: protocol requires function 'foo()' with type '() -> Int?' 3 | } 4 | 5 | struct S: P { | |- error: type 'S' does not conform to protocol 'P' | `- note: add stubs for conformance 6 | func foo() -> Int { 0 } | `- note: candidate has non-matching type '() -> Int' 7 | } 8 |