File: internal-extension.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (57 lines) | stat: -rw-r--r-- 2,124 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// REQUIRES: VENDOR=apple



// RUN: %empty-directory(%t.mod)
// RUN: %empty-directory(%t.sdk)
// RUN: %empty-directory(%t.module-cache)
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -emit-module -o %t.mod/cake.swiftmodule %S/Inputs/cake.swift -parse-as-library -I %S/Inputs/ClangCake %clang-importer-sdk-nosource
// RUN: %target-swift-frontend -disable-objc-attr-requires-foundation-module -emit-module -o %t.mod/main.swiftmodule %s -parse-as-library -I %t.mod -I %S/Inputs/ClangCake %clang-importer-sdk-nosource
// RUN: %api-digester -dump-sdk -module main -o %t.dump.json -module-cache-path %t.module-cache -swift-only -I %t.mod -I %S/Inputs/ClangCake %clang-importer-sdk-nosource
// RUN: %FileCheck %s < %t.dump.json

import cake

// CHECK: publicSymbol
public func publicSymbol() {}

internal protocol InternalProto {}
public protocol PublicProto {}

// This internal extension doesn't declare any new members on S1, so it
// shouldn't show up at all in the output.
// CHECK-NOT: S1
internal extension S1 {
  var x: Int { return 4 }
}

// There should only be one conformance declared: the conformance of C0 to
// PublicProto. InternalProto should not show up in the list.
// CHECK:      "name": "C0",
// CHECK:      "conformances": [
// CHECK-NEXT: {
// CHECK-NEXT:   "kind": "Conformance",
// CHECK-NEXT:   "name": "Copyable",
// CHECK-NEXT:   "printedName": "Copyable",
// CHECK-NEXT:   "usr": "s:s8CopyableP",
// CHECK-NEXT:   "mangledName": "$ss8CopyableP"
// CHECK-NEXT: },
// CHECK-NEXT: {
// CHECK-NEXT:   "kind": "Conformance",
// CHECK-NEXT:   "name": "Escapable",
// CHECK-NEXT:   "printedName": "Escapable",
// CHECK-NEXT:   "usr": "s:s9EscapableP",
// CHECK-NEXT:   "mangledName": "$ss9EscapableP"
// CHECK-NEXT: },
// CHECK-NEXT:   {
// CHECK-NEXT:     "kind": "Conformance",
// CHECK-NEXT:     "name": "PublicProto",
// CHECK-NEXT:     "printedName": "PublicProto",
// CHECK-NEXT:     "usr": "s:4main11PublicProtoP",
// CHECK-NEXT:     "mangledName": "$s4main11PublicProtoP"
// CHECK-NEXT:   }
// CHECK-NEXT: ]
extension C0: InternalProto {
}
extension C0: PublicProto {
}