forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExtractDesugared.swift
22 lines (16 loc) · 813 Bytes
/
ExtractDesugared.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// RUN: %empty-directory(%t)
// RUN: echo "[MyProto]" > %t/protocols.json
// RUN: %target-swift-frontend -typecheck -emit-const-values-path %t/ExtractLiterals.swiftconstvalues -const-gather-protocols-file %t/protocols.json -primary-file %s
// RUN: cat %t/ExtractLiterals.swiftconstvalues 2>&1 | %FileCheck %s
protocolMyProto{}
publicstructCommonSugars:MyProto{
letcane:[String]=["foo","bar"]
letcorn:[String:Int]=["foo":1,"bar":2]
letdemerara:Bool?=nil
}
// CHECK: "label": "cane",
// CHECK-NEXT: "type": "Swift.Array<Swift.String>",
// CHECK: "label": "corn",
// CHECK-NEXT: "type": "Swift.Dictionary<Swift.String, Swift.Int>",
// CHECK: "label": "demerara",
// CHECK-NEXT: "type": "Swift.Optional<Swift.Bool>",