mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Rather than checking the underlying ObjectiveC decl, use the presence of `OptionalAttr` to determine if a requirement is optional instead. This is already added by the importer when necessary. An added benefit here is that this also works for optional requirements defined in Swift (ie. `@objc optional ...`).
14 lines
510 B
Swift
14 lines
510 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift %s -module-name RequirementOf -emit-module -emit-module-path %t/
|
|
// RUN: %target-swift-symbolgraph-extract -module-name RequirementOf -I %t -pretty-print -output-dir %t
|
|
// RUN: %FileCheck %s --input-file %t/RequirementOf.symbols.json
|
|
|
|
public protocol P {
|
|
var x: Int { get }
|
|
}
|
|
|
|
// CHECK: "kind": "requirementOf"
|
|
// CHECK-NEXT: "source": "s:13RequirementOf1PP1xSivp"
|
|
// CHECK-NEXT: "target": "s:13RequirementOf1PP"
|
|
// CHECK-NOT: defaultImplementationOf
|