forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtractArchetype.swift
36 lines (31 loc) · 1.14 KB
/
ExtractArchetype.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
// RUN: %empty-directory(%t)
// RUN: echo "[MyProto]" > %t/protocols.json
// RUN: %target-swift-frontend -typecheck -emit-const-values-path %t/ExtractEnums.swiftconstvalues -const-gather-protocols-file %t/protocols.json -primary-file %s
// RUN: cat %t/ExtractEnums.swiftconstvalues 2>&1 | %FileCheck %s
protocolMyProto{}
publicstructFoo{
init(bar:Any){
}
}
publicstructArchetypalConformance<T>:MyProto{
letbaz:Foo=Foo(bar:T.self)
publicinit(){}
}
// CHECK: [
// CHECK-NEXT: {
// CHECK-NEXT: "typeName": "ExtractArchetype.ArchetypalConformance<T>"
// CHECK: "valueKind": "InitCall",
// CHECK-NEXT: "value": {
// CHECK-NEXT: "type": "ExtractArchetype.Foo",
// CHECK-NEXT: "arguments": [
// CHECK-NEXT: {
// CHECK-NEXT: "label": "bar",
// CHECK-NEXT: "type": "Any",
// CHECK-NEXT: "valueKind": "Type",
// CHECK-NEXT: "value": {
// CHECK-NEXT: "type": "T",
// CHECK-NEXT: "mangledName": "x"
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
// CHECK-NEXT: }