Avatar
Avatar
omochimetaru
@swift-main protocol AP { var a: Int { get } } struct A: AP { var a: Int = 0 } @dynamicMemberLookup struct B: AP { var a: A subscript<T>(dynamicMember keyPath: KeyPath<A, T>) -> T { a[keyPath: keyPath] } }
swiftNightly BOT 9/6/2025 1:06 AM
exit status 1 with stderr:<stdin>:10:8: error: type 'B' does not conform to protocol 'AP' 1 | protocol AP { 2 | var a: Int { get } | `- note: protocol requires property 'a' with type 'Int' 3 | } 4 | : 8 | 9 | @dynamicMemberLookup 10 | struct B: AP { | |- error: type 'B' does not conform to protocol 'AP' | `- note: add stubs for conformance 11 | var a: A | `- note: candidate has non-matching type 'A' 12 | 13 | subscript<T>(dynamicMember keyPath: KeyPath<A, T>) -> T { a[keyPath: keyPath] }