-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathBasicExtension.swift
41 lines (31 loc) · 1.38 KB
/
BasicExtension.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name BasicExtension -emit-module -emit-module-path %t/
// RUN: %target-swift-symbolgraph-extract -module-name BasicExtension -I %t -pretty-print -output-dir %t
// RUN: %FileCheck %s --input-file %t/BasicExtension@Swift.symbols.json --check-prefix EXTRACT
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -module-name BasicExtension -emit-module -emit-module-path %t/ -emit-symbol-graph -emit-symbol-graph-dir %t
// RUN: %FileCheck %s --input-file %t/BasicExtension@Swift.symbols.json --check-prefix BUILD
extension String {
/// Return something.
public var something: String {
return "something"
}
}
// EXTRACT: module
// EXTRACT-NEXT: "name": "BasicExtension"
// BUILD: module
// BUILD: "name":"BasicExtension"
// EXTRACT: "precise": "s:SS14BasicExtensionE9somethingSSvp"
// BUILD: "precise":"s:SS14BasicExtensionE9somethingSSvp"
// EXTRACT: "kind": "memberOf"
// EXTRACT-NEXT: "source": "s:SS14BasicExtensionE9somethingSSvp"
// EXTRACT-NEXT: "target": "s:SS"
// BUILD: "kind":"memberOf"
// BUILD: "source":"s:SS14BasicExtensionE9somethingSSvp"
// BUILD: "target":"s:SS"
// Extending `String` creates a memberOf relationship above.
// However, it should not be included as a node because `String`
// is owned by the Swift module.
// rdar://58876107
// EXTRACT-NOT: "precise": "s:SS"
// BUILD-NOT: "precise":"s:SS"