Files
swift-mirror/test/SymbolGraph/Relationships/RequirementOf.swift
Ben Barham 6aa3e0fd00 [SymbolGraph] Determine optional requirement by presence of OptionalAttr
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 ...`).
2021-09-25 11:50:53 +10:00

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