diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0efd6d3a5..9df8cbb1732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4843,8 +4843,8 @@ Swift 2.2 * Array and dictionary literals allow an optional trailing comma: ```swift - var a = [ 1, 2, ] - var d = [ "a": 1, "b": 2, ] + var a = [1, 2,] + var d = ["a": 1, "b": 2,] ``` 2013-10-16 diff --git a/benchmark/single-source/UTF8Decode.swift b/benchmark/single-source/UTF8Decode.swift index e82ffc90681..4a79ea5b323 100644 --- a/benchmark/single-source/UTF8Decode.swift +++ b/benchmark/single-source/UTF8Decode.swift @@ -25,7 +25,7 @@ public func run_UTF8Decode(_ N: Int) { // Most commonly emoji, which are usually mixed with other text. let emoji = "Panda 🐼, Dog 🐶, Cat 🐱, Mouse 🐭." - let strings = [ ascii, russian, japanese, emoji ].map { Array($0.utf8) } + let strings = [ascii, russian, japanese, emoji].map { Array($0.utf8) } func isEmpty(_ result: UnicodeDecodingResult) -> Bool { switch result { diff --git a/benchmark/single-source/unit-tests/ObjectiveCBridging.swift b/benchmark/single-source/unit-tests/ObjectiveCBridging.swift index 648a129435c..4f69f86a215 100644 --- a/benchmark/single-source/unit-tests/ObjectiveCBridging.swift +++ b/benchmark/single-source/unit-tests/ObjectiveCBridging.swift @@ -27,7 +27,7 @@ public func conditionalCast(_ ns: NS) -> T? { // === String === // func createNSString() -> NSString { - return NSString(cString: "NSString that does not fit in tagged pointer", encoding: NSUTF8StringEncoding)! + return NSString(cString: "NSString that does not fit in tagged pointer", encoding: NSUTF8StringEncoding)! } @inline(never) @@ -150,8 +150,8 @@ public func run_ObjectiveCBridgeFromNSArrayAnyObjectForced(_ N: Int) { @inline(never) func testObjectiveCBridgeToNSArray() { - let nativeArray = [ "abcde", "abcde", "abcde", "abcde", "abcde", - "abcde", "abcde", "abcde", "abcde", "abcde"] + let nativeArray = ["abcde", "abcde", "abcde", "abcde", "abcde", + "abcde", "abcde", "abcde", "abcde", "abcde"] var nsString : AnyObject? for _ in 0 ..< 10_000 { @@ -175,10 +175,10 @@ func testObjectiveCBridgeFromNSArrayAnyObjectToString() { var nativeString : String? for _ in 0 ..< 10_000 { if let nativeArray : [String] = conditionalCast(nsArray) { - nativeString = nativeArray[0] + nativeString = nativeArray[0] } } - CheckResults(nativeString != nil && nativeString == "NSString that does not fit in tagged pointer", "Expected results did not match") + CheckResults(nativeString != nil && nativeString == "NSString that does not fit in tagged pointer", "Expected results did not match") } @inline(never) @@ -197,7 +197,7 @@ func testObjectiveCBridgeFromNSArrayAnyObjectToStringForced() { let nativeArray : [String] = forcedCast(nsArray) nativeString = nativeArray[0] } - CheckResults(nativeString != nil && nativeString == "NSString that does not fit in tagged pointer", "Expected results did not match") + CheckResults(nativeString != nil && nativeString == "NSString that does not fit in tagged pointer", "Expected results did not match") } @inline(never) @@ -246,7 +246,7 @@ func testObjectiveCBridgeFromNSDictionaryAnyObject() { nativeInt = forcedCast(nativeDictionary[nsString]) } } - CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") + CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") } @inline(never) @@ -267,7 +267,7 @@ func testObjectiveCBridgeFromNSDictionaryAnyObjectForced() { nativeInt = forcedCast(nativeDictionary[nsString]) } } - CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") + CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") } @inline(never) @@ -279,8 +279,9 @@ public func run_ObjectiveCBridgeFromNSDictionaryAnyObjectForced(_ N: Int) { @inline(never) func testObjectiveCBridgeToNSDictionary() { - let nativeDictionary = [ "abcde1" : 1, "abcde2" : 2, "abcde3" : 3, "abcde4" : 4, "abcde5" : 5, - "abcde6" : 6, "abcde7" : 7, "abcde8" : 8, "abcde9" : 9, "abcde10" : 10] + let nativeDictionary = ["abcde1": 1, "abcde2": 2, "abcde3": 3, "abcde4": 4, + "abcde5": 5, "abcde6": 6, "abcde7": 7, "abcde8": 8, "abcde9": 9, + "abcde10": 10] let key = "abcde1" as NSString var nsNumber : AnyObject? @@ -288,7 +289,7 @@ func testObjectiveCBridgeToNSDictionary() { let nsDict = nativeDictionary as NSDictionary nsNumber = nsDict.object(forKey: key) } - CheckResults(nsNumber != nil && (nsNumber as! Int) == 1, "Expected results did not match") + CheckResults(nsNumber != nil && (nsNumber as! Int) == 1, "Expected results did not match") } @inline(never) @@ -302,7 +303,7 @@ public func run_ObjectiveCBridgeToNSDictionary(_ N: Int) { func testObjectiveCBridgeFromNSDictionaryAnyObjectToString() { let nsDictionary = createNSDictionary() let nsString = NSString(cString: "NSString that does not fit in tagged pointer", encoding: NSUTF8StringEncoding)! - let nativeString = nsString as String + let nativeString = nsString as String var nativeInt : Int? for _ in 0 ..< 10_000 { @@ -310,7 +311,7 @@ func testObjectiveCBridgeFromNSDictionaryAnyObjectToString() { nativeInt = nativeDictionary[nativeString] } } - CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") + CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") } @inline(never) @@ -324,7 +325,7 @@ public func run_ObjectiveCBridgeFromNSDictionaryAnyObjectToString(_ N: Int) { func testObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced() { let nsDictionary = createNSDictionary() let nsString = NSString(cString: "NSString that does not fit in tagged pointer", encoding: NSUTF8StringEncoding)! - let nativeString = nsString as String + let nativeString = nsString as String var nativeInt : Int? for _ in 0 ..< 10_000 { @@ -332,7 +333,7 @@ func testObjectiveCBridgeFromNSDictionaryAnyObjectToStringForced() { nativeInt = nativeDictionary[nativeString] } } - CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") + CheckResults(nativeInt != nil && nativeInt == 1, "Expected results did not match") } @inline(never) @@ -382,7 +383,7 @@ func testObjectiveCBridgeFromNSSetAnyObject() { result = nativeSet.contains(nsString) } } - CheckResults(result != nil && result!, "Expected results did not match") + CheckResults(result != nil && result!, "Expected results did not match") } @inline(never) @@ -403,7 +404,7 @@ func testObjectiveCBridgeFromNSSetAnyObjectForced() { result = nativeSet.contains(nsString) } } - CheckResults(result != nil && result!, "Expected results did not match") + CheckResults(result != nil && result!, "Expected results did not match") } @inline(never) @@ -415,8 +416,8 @@ public func run_ObjectiveCBridgeFromNSSetAnyObjectForced(_ N: Int) { @inline(never) func testObjectiveCBridgeToNSSet() { - let nativeSet = Set([ "abcde1", "abcde2", "abcde3", "abcde4", "abcde5", - "abcde6", "abcde7", "abcde8", "abcde9", "abcde10"]) + let nativeSet = Set(["abcde1", "abcde2", "abcde3", "abcde4", "abcde5", + "abcde6", "abcde7", "abcde8", "abcde9", "abcde10"]) let key = "abcde1" as NSString var nsString : AnyObject? @@ -424,7 +425,7 @@ func testObjectiveCBridgeToNSSet() { let nsDict = nativeSet as NSSet nsString = nsDict.member(key) } - CheckResults(nsString != nil && (nsString as! String) == "abcde1", "Expected results did not match") + CheckResults(nsString != nil && (nsString as! String) == "abcde1", "Expected results did not match") } @inline(never) @@ -437,8 +438,8 @@ public func run_ObjectiveCBridgeToNSSet(_ N: Int) { @inline(never) func testObjectiveCBridgeFromNSSetAnyObjectToString() { let nsString = NSString(cString: "NSString that does not fit in tagged pointer", encoding: NSUTF8StringEncoding)! - let nativeString = nsString as String - let nsSet = createNSSet() + let nativeString = nsString as String + let nsSet = createNSSet() var result : Bool? for _ in 0 ..< 10_000 { @@ -446,7 +447,7 @@ func testObjectiveCBridgeFromNSSetAnyObjectToString() { result = nativeSet.contains(nativeString) } } - CheckResults(result != nil && result!, "Expected results did not match") + CheckResults(result != nil && result!, "Expected results did not match") } @inline(never) @@ -460,7 +461,7 @@ public func run_ObjectiveCBridgeFromNSSetAnyObjectToString(_ N: Int) { func testObjectiveCBridgeFromNSSetAnyObjectToStringForced() { let nsSet = createNSSet() let nsString = NSString(cString: "NSString that does not fit in tagged pointer", encoding: NSUTF8StringEncoding)! - let nativeString = nsString as String + let nativeString = nsString as String var result : Bool? for _ in 0 ..< 10_000 { @@ -468,7 +469,7 @@ func testObjectiveCBridgeFromNSSetAnyObjectToStringForced() { result = nativeSet.contains(nativeString) } } - CheckResults(result != nil && result!, "Expected results did not match") + CheckResults(result != nil && result!, "Expected results did not match") } @inline(never) diff --git a/benchmark/single-source/unit-tests/ObjectiveCBridgingStubs.swift b/benchmark/single-source/unit-tests/ObjectiveCBridgingStubs.swift index 361edc1c1ad..b374e886157 100644 --- a/benchmark/single-source/unit-tests/ObjectiveCBridgingStubs.swift +++ b/benchmark/single-source/unit-tests/ObjectiveCBridgingStubs.swift @@ -75,8 +75,7 @@ public func run_ObjectiveCBridgeStubFromArrayOfNSString(_ N: Int) { func testObjectiveCBridgeStubToArrayOfNSString() { let b = BridgeTester() let str = "hello world" - let arr = [ str, str, str, str, str, - str, str, str, str, str ] + let arr = [str, str, str, str, str, str, str, str, str, str] for _ in 0 ..< 10_000 { b.test(fromArrayOf: arr) } diff --git a/docs/ARCOptimization.rst b/docs/ARCOptimization.rst index 50edba8eaa0..43c5633b8dd 100644 --- a/docs/ARCOptimization.rst +++ b/docs/ARCOptimization.rst @@ -8,7 +8,7 @@ ARC Optimization for Swift .. admonition:: TODO - This is an evolving document on ARC optimization in the swift + This is an evolving document on ARC optimization in the Swift compiler. Please extend it. Terms @@ -332,7 +332,7 @@ is_unique performs depends on the argument type: (Builtin.NativeObject, known native class reference) - Objective-C object types require an additional check that the - dynamic object type uses native swift reference counting: + dynamic object type uses native Swift reference counting: (Builtin.UnknownObject, unknown class reference, class existential) - Bridged object types allow the dynamic object type check to be @@ -342,7 +342,7 @@ is_unique performs depends on the argument type: Any of the above types may also be wrapped in an optional. If the static argument type is optional, then a null check is also performed. -Thus, is_unique only returns true for non-null, native swift object +Thus, is_unique only returns true for non-null, native Swift object references with a strong reference count of one. is_unique_or_pinned has the same semantics as is_unique except that it diff --git a/docs/Android.md b/docs/Android.md index 3d62a670aef..c404ced9a49 100644 --- a/docs/Android.md +++ b/docs/Android.md @@ -52,7 +52,7 @@ To build libiconv and libicu for Android: `git` installed. 2. Clone the [SwiftAndroid/libiconv-libicu-android](https://github.com/SwiftAndroid/libiconv-libicu-android) project. From the command-line, run the following command: - `git@github.com:SwiftAndroid/libiconv-libicu-android.git`. + `git clone git@github.com:SwiftAndroid/libiconv-libicu-android.git`. 3. From the command-line, run `which ndk-build`. Confirm that the path to the `ndk-build` executable in the Android NDK you downloaded is displayed. If not, you may need to add the Android NDK directory to your `PATH`. diff --git a/docs/DebuggingTheCompiler.rst b/docs/DebuggingTheCompiler.rst index 2e239e63272..5a1a988dad9 100644 --- a/docs/DebuggingTheCompiler.rst +++ b/docs/DebuggingTheCompiler.rst @@ -9,13 +9,13 @@ Abstract -------- This document contains some useful information for debugging the -swift compiler and swift compiler output. +Swift compiler and Swift compiler output. Printing the Intermediate Representations ----------------------------------------- The most important thing when debugging the compiler is to examine the IR. -Here is how to dump the IR after the main phases of the swift compiler +Here is how to dump the IR after the main phases of the Swift compiler (assuming you are compiling with optimizations enabled): #. **Parser**. To print the AST after parsing:: @@ -83,7 +83,7 @@ For details see ``PassManager.cpp``. Dumping the SIL and other Data in LLDB `````````````````````````````````````` -When debugging the swift compiler with LLDB (or Xcode, of course), there is +When debugging the Swift compiler with LLDB (or Xcode, of course), there is even a more powerful way to examine the data in the compiler, e.g. the SIL. Following LLVM's dump() convention, many SIL classes (as well as AST classes) provide a dump() function. You can call the dump function with LLDB's @@ -123,7 +123,7 @@ debugging add the front-end option -gsil together with -g. Example:: This writes the SIL after optimizations into a file and generates debug info for it. In the debugger and profiler you can then see the SIL code instead of -the swift source code. +the Swift source code. For details see the SILDebugInfoGenerator pass. To enable SIL debugging and profiling for the Swift standard library, use @@ -141,7 +141,7 @@ Using Breakpoints ````````````````` LLDB has very powerful breakpoints, which can be utilized in many ways to debug -the compiler and swift executables. The examples in this section show the LLDB +the compiler and Swift executables. The examples in this section show the LLDB command lines. In Xcode you can set the breakpoint properties by clicking 'Edit breakpoint'. @@ -236,7 +236,7 @@ generality will be called test.lldb):: c dis -f -TODO: Change this example to apply to the swift compiler instead of to the +TODO: Change this example to apply to the Swift compiler instead of to the stdlib unittests. Then by running ``lldb test -s test.lldb``, lldb will: @@ -256,14 +256,14 @@ needing to retype the various commands perfectly every time. Debugging Swift Executables --------------------------- -One can use the previous tips for debugging the swift compiler with swift +One can use the previous tips for debugging the Swift compiler with Swift executables as well. Here are some additional useful techniques that one can use in Swift executables. Determining the mangled name of a function in LLDB ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -One problem that often comes up when debugging swift code in LLDB is that LLDB +One problem that often comes up when debugging Swift code in LLDB is that LLDB shows the demangled name instead of the mangled name. This can lead to mistakes where due to the length of the mangled names one will look at the wrong function. Using the following command, one can find the mangled name of the diff --git a/docs/DriverParseableOutput.rst b/docs/DriverParseableOutput.rst index 12eac0f3701..a38e0f8235b 100644 --- a/docs/DriverParseableOutput.rst +++ b/docs/DriverParseableOutput.rst @@ -57,7 +57,7 @@ Example:: "kind": "began", "name": "compile", "pid": 12345, - "inputs": [ "/src/foo.swift" ], + "inputs": ["/src/foo.swift"], "outputs": [ { "type": "object", @@ -126,7 +126,7 @@ Example:: { "kind": "skipped", "name": "compile", - "inputs": [ "/src/foo.swift" ], + "inputs": ["/src/foo.swift"], "outputs": [ { "type": "object", @@ -164,4 +164,4 @@ invoking dsymutil to generate a dSYM. Parsers of this format should be resilient in the event of an unknown name, as the driver may emit messages with new names whenever it needs to execute a new -kind of command. \ No newline at end of file +kind of command. diff --git a/docs/Generics.rst b/docs/Generics.rst index f9e3e7e0243..bedafd8b7cf 100644 --- a/docs/Generics.rst +++ b/docs/Generics.rst @@ -204,11 +204,11 @@ interface, e.g. (in Java):: .. @ignore() .. This test just doesn't compile at the moment, but that represents a - bug in swift + bug in Swift and then a class X that wants to be Comparable will inherit from Comparable. This is ugly and has a number of pitfalls; see -http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6479372 . +http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6479372. Scala and Strongtalk have the notion of the 'Self' type, which effectively allows one to refer to the eventual type of 'self' (which we call diff --git a/docs/GitWorkflows.rst b/docs/GitWorkflows.rst index 9f6dc650d4d..64d360b10d3 100644 --- a/docs/GitWorkflows.rst +++ b/docs/GitWorkflows.rst @@ -30,7 +30,7 @@ This document will show how to translate these commands to Git and additionally how to configure Git. It assumes that one is attempting to manipulate a Git repository via bash in a terminal. A lot of information since this is supposed to be a short, actionable guide. For more information, please see the Git crash -course guide for SVN users at +course guide for SVN users at *NOTE* Whenever we say the Swift repository, we mean any repository in the Swift project. @@ -94,7 +94,7 @@ as follows:: This will cause Git to clone the repository at 'repository url' and check out the 'master' branch. The 'master' branch corresponds to 'trunk' in SVN. For more information about branching in Git please see - + Before beginning to commit though, we /must/ perform some default configuration of our repository to match the Swift repository default configuration by diff --git a/docs/HighLevelSILOptimizations.rst b/docs/HighLevelSILOptimizations.rst index 8375a8806e6..7f9213f9f49 100644 --- a/docs/HighLevelSILOptimizations.rst +++ b/docs/HighLevelSILOptimizations.rst @@ -96,7 +96,7 @@ getElement instruction:: Swift optimizations ------------------- -The swift optimizer can access the information that is provided by the +The Swift optimizer can access the information that is provided by the ``@_semantics`` attribute to perform high-level optimizations. In the early stages of the optimization pipeline the optimizer does not inline functions with special semantics in order to allow the early high-level optimization diff --git a/docs/Lexicon.rst b/docs/Lexicon.rst index 2df7f7493c4..8ad3da44561 100644 --- a/docs/Lexicon.rst +++ b/docs/Lexicon.rst @@ -141,10 +141,14 @@ source code, tests, and commit messages. See also the `LLVM lexicon`_. `Whole-Module Optimization `. QoI - "Quality of implementation." Sometimes written in commit messages that - improve the code that implements a particular feature of the compiler. More - often included in FIXMEs or TODOs when the current code functions properly, - but should be cleaned up. Example: "FIXME: QoI could be improved here." + "Quality of implementation." The term is meant to describe not how + well-engineered a particular implementation is, but how much value it + provides to users beyond a sort of minimum expectation. Good diagnostics + are a matter of QoI, as is good unoptimized performance. For example, a + comment like "FIXME: QoI could be improved here" is suggesting that there's + some sort of non-mandatory work that could be done that would improve the + behavior of the compiler--it is not just a general statement that the code + needs to be improved. Radar `Apple's bug-tracking system`__, or an issue reported on that system. diff --git a/docs/Modules.rst b/docs/Modules.rst index bccdad5f8b3..c2380f22895 100644 --- a/docs/Modules.rst +++ b/docs/Modules.rst @@ -415,7 +415,7 @@ Glossary A module whose contents are generated from a C-family header or set of headers. See Clang's Modules__ documentation for more information. - __ http://goto.apple.com/?http://clang.llvm.org/docs/Modules.html + __ http://clang.llvm.org/docs/Modules.html framework A mechanism for library distribution on OS X. Traditionally contains header @@ -440,7 +440,7 @@ Glossary in C++; see Wikipedia__ for some examples. Swift's name mangling scheme is not the same as C++'s but serves a similar purpose. - __ http://goto.apple.com/?http://en.wikipedia.org/wiki/Name_mangling#Name_mangling_in_C.2B.2B + __ https://en.wikipedia.org/wiki/Name_mangling#C.2B.2B module An entity containing the API for a library, to be `imported ` into diff --git a/docs/OptimizationTips.rst b/docs/OptimizationTips.rst index 4fe9e1093f5..ede57514e23 100644 --- a/docs/OptimizationTips.rst +++ b/docs/OptimizationTips.rst @@ -350,7 +350,7 @@ The compiler only automatically specializes generic code if the call site and the callee function are located in the same module. However, the programmer can provide hints to the compiler in the form of @_specialize attributes. For details see -https://github.com/apple/swift/blob/master/docs/Generics.rst#specialization. +:ref:`generics-specialization`. This attribute instructs the compiler to specialize on the specified concrete type list. The compiler inserts type checks and dispatches @@ -386,7 +386,7 @@ about 10 times. Game(10).play -The cost of large swift values +The cost of large Swift values ============================== In Swift, values keep a unique copy of their data. There are several advantages @@ -446,7 +446,7 @@ argument drops from being O(n), depending on the size of the tree to O(1). struct Tree : P { var node : [P?] init() { - node = [ thing ] + node = [thing] } } @@ -501,12 +501,12 @@ The type ``Box`` can replace the array in the code sample above. Unsafe code =========== -Swift classes are always reference counted. The swift compiler inserts code +Swift classes are always reference counted. The Swift compiler inserts code that increments the reference count every time the object is accessed. For example, consider the problem of scanning a linked list that's implemented using classes. Scanning the list is done by moving a reference from one node to the next: ``elem = elem.next``. Every time we move -the reference swift will increment the reference count of the ``next`` object +the reference Swift will increment the reference count of the ``next`` object and decrement the reference count of the previous object. These reference count operations are expensive and unavoidable when using Swift classes. diff --git a/docs/SIL.rst b/docs/SIL.rst index b517f89faaf..7d2ee196ec1 100644 --- a/docs/SIL.rst +++ b/docs/SIL.rst @@ -115,7 +115,7 @@ IR. - **Performance Inlining** - **Reference Counting Optimizations** - **Memory Promotion/Optimizations** -- **High-level domain specific optimizations** The swift compiler implements +- **High-level domain specific optimizations** The Swift compiler implements high-level optimizations on basic Swift containers such as Array or String. Domain specific optimizations require a defined interface between the standard library and the optimizer. More details can be found here: diff --git a/docs/SequencesAndCollections.rst b/docs/SequencesAndCollections.rst index 6628a53c094..03f7c1d4169 100644 --- a/docs/SequencesAndCollections.rst +++ b/docs/SequencesAndCollections.rst @@ -54,7 +54,7 @@ represented by the `SequenceType` protocol:: .. |AnyIterator| replace:: `AnyIterator` - __ http://swiftdoc.org/type/AnyIterator/ + __ http://swiftdoc.org/v3.0/type/AnyIterator/ As you can see, sequence does nothing more than deliver an iterator. To understand the need for iterators, it's important to distinguish @@ -356,7 +356,7 @@ features such as `Comparable` conformance, index subtraction, and addition/subtraction of integers to/from indices. The indices of a `deque -`_ can provide random +`_ can provide random access, as do the indices into `String.UTF16View` (when Foundation is loaded) and, of course, array indices. Many common sorting and selection algorithms, among others, depend on these capabilities. diff --git a/docs/StringDesign.rst b/docs/StringDesign.rst index 751989b7f60..ea2e9cb09d4 100644 --- a/docs/StringDesign.rst +++ b/docs/StringDesign.rst @@ -144,14 +144,14 @@ string usage while discovering its essential properties. ``String`` is a `First-Class Type`__ ------------------------------------ -__ http://en.wikipedia.org/wiki/First-class_citizen +__ https://en.wikipedia.org/wiki/First-class_citizen .. parsed-literal:: |swift| var s = "Yo" `// s:` :emph:`String` `= "Yo"` -Unlike, say, C's ``char*``, the meaning of a swift string is always +Unlike, say, C's ``char*``, the meaning of a Swift string is always unambiguous. Strings are **Efficient** @@ -581,7 +581,7 @@ How Would You Design It? 7. UTF-8 sequences sort in code point order. 8. UTF-8 has no "byte order." - __ http://research.swtch.com/2010/03/utf-8-bits-bytes-and-benefits.html + __ http://research.swtch.com/utf8 * It would be efficient, taking advantage of state-of-the-art optimizations, including: diff --git a/docs/Testing.rst b/docs/Testing.rst index 9160beebb57..a39e66fd138 100644 --- a/docs/Testing.rst +++ b/docs/Testing.rst @@ -33,6 +33,17 @@ The LLVM lit-based testsuite * Buildbots run all tests, on all supported platforms. +Testsuite subsets +----------------- + +The testsuite is split into three subsets: + +* Primary testsuite, located under ``swift/test``. + +* Validation testsuite, located under ``swift/validation-test``. + +* Long tests, which are marked with ``REQUIRES: long_test``. + Running the LLVM lit-based testsuite ------------------------------------ @@ -59,13 +70,21 @@ Besides ``check-swift``, other targets are also available. Here's the full list: Runs tests from the ``${SWIFT_SOURCE_ROOT}/test`` directory. -* ``check-swift-validation`` +* ``check-swift-only_validation`` Runs tests from the ``${SWIFT_SOURCE_ROOT}/validation-test`` directory. +* ``check-swift-validation`` + + Runs the primary and validation tests, without the long tests. + +* ``check-swift-only_long`` + + Runs long tests only. + * ``check-swift-all`` - Runs all tests. + Runs all tests (primary, validation, and long). For every target above, there are variants for different optimizations: @@ -171,7 +190,7 @@ Substitutions that start with ``%target`` configure the compiler for building code for the target that is not the build machine: * ``%target-parse-verify-swift``: parse and type check the current Swift file - for the target platform and verify diagnostics, like ``swift -parse -verify + for the target platform and verify diagnostics, like ``swift -frontend -parse -verify %s``. Use this substitution for testing semantic analysis in the compiler. diff --git a/docs/archive/Objective-CInteroperability.rst b/docs/archive/Objective-CInteroperability.rst index 70efb8bbbfc..5327faddbaf 100644 --- a/docs/archive/Objective-CInteroperability.rst +++ b/docs/archive/Objective-CInteroperability.rst @@ -396,7 +396,7 @@ Attributes for Objective-C Support Maybe eventually [objc] will take an optional argument specifying the Objective-C-equivalent name. -__ http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW6 +__ https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW6 Level 1: Message-passing diff --git a/docs/proposals/archive/MemoryAndConcurrencyModel.rst b/docs/proposals/archive/MemoryAndConcurrencyModel.rst index acbfbb62004..d443be3f687 100644 --- a/docs/proposals/archive/MemoryAndConcurrencyModel.rst +++ b/docs/proposals/archive/MemoryAndConcurrencyModel.rst @@ -94,7 +94,7 @@ definition. These kinds are: Not having mutable shared state also prevents race conditions from turning into safety violations. Here's a description of the go issue which causes them to be unsafe when running multiple threads: - `http://research.swtch.com/2010/02/off-to-races.html`_ + Note that a highly desirable feature of the language is the ability to take an instance of a mutable type and *make it immutable* somehow, allowing it to diff --git a/docs/proposals/archive/UnifiedFunctionSyntax.rst b/docs/proposals/archive/UnifiedFunctionSyntax.rst index fdf522853a8..5bedf175ad8 100644 --- a/docs/proposals/archive/UnifiedFunctionSyntax.rst +++ b/docs/proposals/archive/UnifiedFunctionSyntax.rst @@ -503,4 +503,4 @@ circumstances that affect inclusion or exclusion from the list. | Worth | No | | | +----------------+---------+---------+----------------------------+ -.. _the english club: http://www.englishclub.com/grammar/prepositions-list.htm +.. _the english club: https://www.englishclub.com/grammar/prepositions-list.htm diff --git a/docs/proposals/rejected/ClassConstruction.rst b/docs/proposals/rejected/ClassConstruction.rst index 38a1349c965..b96b3caf1ed 100644 --- a/docs/proposals/rejected/ClassConstruction.rst +++ b/docs/proposals/rejected/ClassConstruction.rst @@ -40,7 +40,7 @@ of its subclasses. This leads to a soundness problem: - (void)print { printf(\ **name**\ ); } // oops @end - mySubclassInstance = [ [Subclass alloc] initSuperClass ] + mySubclassInstance = [[Subclass alloc] initSuperClass] Because there is no way to hide a superclass' ``init`` method from clients, ensuring that subclass instances are properly initialized diff --git a/docs/proposals/valref.rst b/docs/proposals/valref.rst index 49a2a671f85..298831ef7e1 100644 --- a/docs/proposals/valref.rst +++ b/docs/proposals/valref.rst @@ -432,16 +432,16 @@ How This Design Beats Rust/C++/C#/etc. * Simple programs stay simple. Rust has a great low-level memory safety story, but it comes at the expense of ease-of-use. You can't learn - to use that system effectively without confronting three `kinds`__ + to use that system effectively without confronting two `kinds`__ of pointer, `named lifetimes`__, `borrowing managed boxes and rooting`__, etc. By contrast, there's a path to learning swift that postpones the ``val``\ /``ref`` distinction, and that's pretty much *all* one must learn to have a complete understanding of the object model in the "easy" and "safe" zones. -__ http://static.rust-lang.org/doc/tutorial.html#boxes-and-pointers -__ http://static.rust-lang.org/doc/tutorial-borrowed-ptr.html#named-lifetimes -__ http://static.rust-lang.org/doc/tutorial-borrowed-ptr.html#borrowing-managed-boxes-and-rooting +__ https://doc.rust-lang.org/reference.html#pointer-types +__ https://doc.rust-lang.org/book/lifetimes.html +__ https://doc.rust-lang.org/book/box-syntax-and-patterns.html * Simple programs stay safe. C++ offers great control over everything, but the sharp edges are always exposed. This design diff --git a/include/swift/AST/AnyFunctionRef.h b/include/swift/AST/AnyFunctionRef.h index 01455fb3132..3490b8e3865 100644 --- a/include/swift/AST/AnyFunctionRef.h +++ b/include/swift/AST/AnyFunctionRef.h @@ -137,6 +137,26 @@ public: return CE->getType()->castTo()->isNoEscape(); } + bool isObjC() const { + if (auto afd = TheFunction.dyn_cast()) { + return afd->isObjC(); + } + if (TheFunction.dyn_cast()) { + // Closures are never @objc. + return false; + } + llvm_unreachable("unexpected AnyFunctionRef representation"); + } + + SourceLoc getLoc() const { + if (auto afd = TheFunction.dyn_cast()) { + return afd->getLoc(); + } + if (auto ce = TheFunction.dyn_cast()) { + return ce->getLoc(); + } + llvm_unreachable("unexpected AnyFunctionRef representation"); + } }; } // namespace swift diff --git a/include/swift/AST/DiagnosticsParse.def b/include/swift/AST/DiagnosticsParse.def index 4f3a0a52d35..f3f28e7189b 100644 --- a/include/swift/AST/DiagnosticsParse.def +++ b/include/swift/AST/DiagnosticsParse.def @@ -148,8 +148,8 @@ WARNING(lex_editor_placeholder_in_playground,none, NOTE(note_in_decl_extension,none, "in %select{declaration|extension}0 of %1", (bool, Identifier)) -WARNING(line_directive_style_deprecated,none, - "#line directive is deprecated, please use #sourceLocation instead", +ERROR(line_directive_style_deprecated,none, + "#line directive was renamed to #sourceLocation", ()) ERROR(declaration_same_line_without_semi,none, @@ -287,8 +287,6 @@ ERROR(expected_type_in_associatedtype,PointsToFirstBadToken, "expected type in associatedtype declaration", ()) ERROR(associated_type_generic_parameter_list,PointsToFirstBadToken, "associated types may not have a generic parameter list", ()) -ERROR(typealias_generic_list_constraint,PointsToFirstBadToken, - "type parameters may not be constrained in typealias argument list", ()) // Func @@ -741,9 +739,9 @@ ERROR(invalid_label_on_stmt,none, NOTE(discard_result_of_closure,none, "explicitly discard the result of the closure by assigning to '_'", ()) -WARNING(snake_case_deprecated,none, - "%0 is deprecated and will be removed in Swift 3, please use %1", - (StringRef, StringRef)) +ERROR(snake_case_deprecated,none, + "%0 has been replaced with %1 in Swift 3", + (StringRef, StringRef)) // Assignment statement @@ -1081,8 +1079,8 @@ ERROR(expr_selector_expected_rparen,PointsToFirstBadToken, // Attribute-parsing diagnostics //------------------------------------------------------------------------------ -WARNING(replace_equal_with_colon_for_value,none, - "'=' is deprecated in favor of ':' before an attribute argument", ()) +ERROR(replace_equal_with_colon_for_value,none, + "'=' has been replaced with ':' in attribute arguments", ()) ERROR(expected_attribute_name,none, "expected an attribute name", ()) ERROR(unknown_attribute,none, diff --git a/include/swift/AST/DiagnosticsSema.def b/include/swift/AST/DiagnosticsSema.def index 222ef723ceb..1964fae2b5b 100644 --- a/include/swift/AST/DiagnosticsSema.def +++ b/include/swift/AST/DiagnosticsSema.def @@ -1061,8 +1061,10 @@ ERROR(extension_protocol_via_typealias,none, ERROR(extension_anyobject,none, "'AnyObject' protocol cannot be extended", ()) ERROR(objc_generic_extension_using_type_parameter,none, - "Extension of a generic Objective-C class cannot access the class's " - "generic parameters", ()) + "extension of a generic Objective-C class cannot access the class's " + "generic parameters at runtime", ()) +NOTE(objc_generic_extension_using_type_parameter_here,none, + "generic parameter used here", ()) // Protocols ERROR(type_does_not_conform,none, @@ -2057,8 +2059,8 @@ WARNING(store_in_willset,none, "attempting to store to property %0 within its own willSet, which is " "about to be overwritten by the new value", (Identifier)) -WARNING(tuple_splat_use,none, - "passing %0 arguments to a callee as a single tuple value is deprecated", +ERROR(tuple_splat_use,none, + "passing %0 arguments to a callee as a single tuple value has been removed in Swift 3", (unsigned)) @@ -2169,10 +2171,8 @@ NOTE(change_to_mutating,none, (bool)) // For Stmt -WARNING(deprecated_c_style_for_stmt,none, -"C-style for statement is deprecated and will be removed in a future version of Swift", ()) -NOTE(cant_fix_c_style_for_stmt,none, -"C-style for statement can't be automatically fixed to for-in, because the loop variable is modified inside the loop", ()) +ERROR(deprecated_c_style_for_stmt,none, + "C-style for statement has been removed in Swift 3", ()) // ForEach Stmt ERROR(sequence_protocol_broken,none, diff --git a/include/swift/Markup/ASTNodes.def b/include/swift/Markup/ASTNodes.def index b1330bb66ce..2e66562ca95 100644 --- a/include/swift/Markup/ASTNodes.def +++ b/include/swift/Markup/ASTNodes.def @@ -61,6 +61,8 @@ MARKUP_AST_NODE(PrivateExtension, MarkupASTNode) MARKUP_AST_NODE(ExperimentField, PrivateExtension) MARKUP_AST_NODE(ImportantField, PrivateExtension) MARKUP_AST_NODE(InvariantField, PrivateExtension) + MARKUP_AST_NODE(MutatingvariantField, PrivateExtension) + MARKUP_AST_NODE(NonmutatingvariantField, PrivateExtension) MARKUP_AST_NODE(NoteField, PrivateExtension) MARKUP_AST_NODE(PostconditionField, PrivateExtension) MARKUP_AST_NODE(PreconditionField, PrivateExtension) diff --git a/include/swift/Markup/SimpleFields.def b/include/swift/Markup/SimpleFields.def index 6ccd4b52686..1e330786eb7 100644 --- a/include/swift/Markup/SimpleFields.def +++ b/include/swift/Markup/SimpleFields.def @@ -31,6 +31,8 @@ MARKUP_SIMPLE_FIELD(DateField, date, Date) MARKUP_SIMPLE_FIELD(ExperimentField, experiment, Experiment) MARKUP_SIMPLE_FIELD(ImportantField, important, Important) MARKUP_SIMPLE_FIELD(InvariantField, invariant, Invariant) +MARKUP_SIMPLE_FIELD(MutatingvariantField, mutatingvariant, Mutatingvariant) +MARKUP_SIMPLE_FIELD(NonmutatingvariantField, nonmutatingvariant, Nonmutatingvariant) MARKUP_SIMPLE_FIELD(NoteField, note, Note) MARKUP_SIMPLE_FIELD(PostconditionField, postcondition, Postcondition) MARKUP_SIMPLE_FIELD(PreconditionField, precondition, Precondition) diff --git a/include/swift/Reflection/MetadataSource.h b/include/swift/Reflection/MetadataSource.h index 34a799f5311..9e78289024d 100644 --- a/include/swift/Reflection/MetadataSource.h +++ b/include/swift/Reflection/MetadataSource.h @@ -1,4 +1,4 @@ -//===--- MetadataSource.cpp - Swift Metadata Sources for Reflection -------===// +//===--- MetadataSource.h - Swift Metadata Sources for Reflection ---------===// // // This source file is part of the Swift.org open source project // diff --git a/include/swift/Reflection/ReflectionContext.h b/include/swift/Reflection/ReflectionContext.h index 34035133684..ed387ba45bf 100644 --- a/include/swift/Reflection/ReflectionContext.h +++ b/include/swift/Reflection/ReflectionContext.h @@ -22,376 +22,48 @@ #include "swift/Remote/MetadataReader.h" #include "swift/Reflection/Records.h" #include "swift/Reflection/TypeRef.h" +#include "swift/Reflection/TypeRefBuilder.h" #include "swift/SwiftRemoteMirror/SwiftRemoteMirrorTypes.h" #include #include #include -class NodePointer; - namespace swift { namespace reflection { using swift::remote::MemoryReader; using swift::remote::RemoteAddress; -template -class ReflectionSection { - using const_iterator = Iterator; - const void * Begin; - const void * End; - -public: - ReflectionSection(const void * Begin, - const void * End) - : Begin(Begin), End(End) {} - - ReflectionSection(uint64_t Begin, uint64_t End) - : Begin(reinterpret_cast(Begin)), - End(reinterpret_cast(End)) {} - - void *startAddress() { - return const_cast(Begin); - } - - const_iterator begin() const { - return const_iterator(Begin, End); - } - - const_iterator end() const { - return const_iterator(End, End); - } - - size_t size() const { - return (char *)End - (char *)Begin; - } -}; - -/// An implementation of MetadataReader's BuilderType concept for -/// building TypeRefs. -class TypeRefBuilder { -public: - using Type = const TypeRef *; - -private: - std::vector> TypeRefPool; - -public: - template - TypeRefTy *make_typeref(Args... args) { - auto TR = new TypeRefTy(::std::forward(args)...); - TypeRefPool.push_back(std::unique_ptr(TR)); - return TR; - } - - const BuiltinTypeRef *createBuiltinType(const std::string &mangledName) { - return BuiltinTypeRef::create(*this, mangledName); - } - - const NominalTypeRef *createNominalType(const std::string &mangledName, - const TypeRef *parent) { - return NominalTypeRef::create(*this, mangledName, parent); - } - - const BoundGenericTypeRef * - createBoundGenericType(const std::string &mangledName, - const std::vector &args, - const TypeRef *parent) { - return BoundGenericTypeRef::create(*this, mangledName, args, parent); - } - - const TupleTypeRef * - createTupleType(const std::vector &elements, - bool isVariadic) { - return TupleTypeRef::create(*this, elements, isVariadic); - } - - const FunctionTypeRef * - createFunctionType(const std::vector &args, - const std::vector &inOutArgs, - const TypeRef *result, - FunctionTypeFlags flags) { - // FIXME: don't ignore inOutArgs - // FIXME: don't ignore flags - return FunctionTypeRef::create(*this, args, result); - } - - const ProtocolTypeRef *createProtocolType(const std::string &moduleName, - const std::string &protocolName) { - return ProtocolTypeRef::create(*this, moduleName, protocolName); - } - - const ProtocolCompositionTypeRef * - createProtocolCompositionType(const std::vector &protocols) { - for (auto protocol : protocols) { - if (!isa(protocol)) - return nullptr; - } - return ProtocolCompositionTypeRef::create(*this, protocols); - } - - const ExistentialMetatypeTypeRef * - createExistentialMetatypeType(const TypeRef *instance) { - return ExistentialMetatypeTypeRef::create(*this, instance); - } - - const MetatypeTypeRef *createMetatypeType(const TypeRef *instance) { - return MetatypeTypeRef::create(*this, instance); - } - - const GenericTypeParameterTypeRef * - createGenericTypeParameterType(unsigned depth, unsigned index) { - return GenericTypeParameterTypeRef::create(*this, depth, index); - } - - const DependentMemberTypeRef * - createDependentMemberType(const std::string &member, - const TypeRef *base, - const TypeRef *protocol) { - if (!isa(protocol)) - return nullptr; - return DependentMemberTypeRef::create(*this, member, base, protocol); - } - - const UnownedStorageTypeRef *createUnownedStorageType(const TypeRef *base) { - return UnownedStorageTypeRef::create(*this, base); - } - - const UnmanagedStorageTypeRef * - createUnmanagedStorageType(const TypeRef *base) { - return UnmanagedStorageTypeRef::create(*this, base); - } - - const WeakStorageTypeRef *createWeakStorageType(const TypeRef *base) { - return WeakStorageTypeRef::create(*this, base); - } - - const ObjCClassTypeRef *getUnnamedObjCClassType() { - return ObjCClassTypeRef::getUnnamed(); - } - - const ForeignClassTypeRef *getUnnamedForeignClassType() { - return ForeignClassTypeRef::getUnnamed(); - } - - const OpaqueTypeRef *getOpaqueType() { - return OpaqueTypeRef::get(); - } -}; - -using FieldSection = ReflectionSection; -using AssociatedTypeSection = ReflectionSection; -using BuiltinTypeSection = ReflectionSection; -using GenericSection = ReflectionSection; - -struct ReflectionInfo { - std::string ImageName; - FieldSection fieldmd; - AssociatedTypeSection assocty; - BuiltinTypeSection builtin; - GenericSection typeref; - GenericSection reflstr; -}; - - - template class ReflectionContext : public remote::MetadataReader { using super = remote::MetadataReader; public: - using super::decodeMangledType; + using super::getBuilder; using super::readTypeFromMetadata; using typename super::StoredPointer; -private: - - std::vector ReflectionInfos; - - void dumpTypeRef(const std::string &MangledName, - std::ostream &OS, bool printTypeName = false) { - auto TypeName = Demangle::demangleTypeAsString(MangledName); - OS << TypeName << '\n'; - - auto DemangleTree = Demangle::demangleTypeAsNode(MangledName); - auto TR = decodeMangledType(DemangleTree); - if (!TR) { - OS << "!!! Invalid typeref: " << MangledName << '\n'; - return; - } - TR->dump(OS); - OS << '\n'; - } - - const AssociatedTypeDescriptor * - lookupAssociatedTypes(const std::string &MangledTypeName, - const DependentMemberTypeRef *DependentMember) { - // Cache missed - we need to look through all of the assocty sections - // for all images that we've been notified about. - for (auto &Info : ReflectionInfos) { - for (const auto &AssocTyDescriptor : Info.assocty) { - std::string ConformingTypeName(AssocTyDescriptor.ConformingTypeName); - if (ConformingTypeName.compare(MangledTypeName) != 0) - continue; - std::string ProtocolMangledName(AssocTyDescriptor.ProtocolTypeName); - auto DemangledProto = Demangle::demangleTypeAsNode(ProtocolMangledName); - auto TR = decodeMangledType(DemangledProto); - - auto &Conformance = *DependentMember->getProtocol(); - if (auto Protocol = dyn_cast(TR)) { - if (*Protocol != Conformance) - continue; - return &AssocTyDescriptor; - } - } - } - return nullptr; - } - public: explicit ReflectionContext(std::shared_ptr reader) : super(std::move(reader)) {} - ReflectionContext(const ReflectionContext&) = delete; + ReflectionContext(const ReflectionContext &other) = delete; + ReflectionContext &operator=(const ReflectionContext &other) = delete; MemoryReader &getReader() { return *this->Reader; } - void dumpFieldSection(std::ostream &OS) { - for (const auto §ions : ReflectionInfos) { - for (const auto &descriptor : sections.fieldmd) { - auto TypeName - = Demangle::demangleTypeAsString(descriptor.getMangledTypeName()); - OS << TypeName << '\n'; - for (size_t i = 0; i < TypeName.size(); ++i) - OS << '-'; - OS << '\n'; - for (auto &field : descriptor) { - OS << field.getFieldName(); - if (field.hasMangledTypeName()) { - OS << ": "; - dumpTypeRef(field.getMangledTypeName(), OS); - } else { - OS << "\n\n"; - } - } - } - } - } - - void dumpAssociatedTypeSection(std::ostream &OS) { - for (const auto §ions : ReflectionInfos) { - for (const auto &descriptor : sections.assocty) { - auto conformingTypeName = Demangle::demangleTypeAsString( - descriptor.getMangledConformingTypeName()); - auto protocolName = Demangle::demangleTypeAsString( - descriptor.getMangledProtocolTypeName()); - - OS << "- " << conformingTypeName << " : " << protocolName; - OS << '\n'; - - for (const auto &associatedType : descriptor) { - OS << "typealias " << associatedType.getName() << " = "; - dumpTypeRef(associatedType.getMangledSubstitutedTypeName(), OS); - } - } - } - } - - void dumpBuiltinTypeSection(std::ostream &OS) { - for (const auto §ions : ReflectionInfos) { - for (const auto &descriptor : sections.builtin) { - auto typeName = Demangle::demangleTypeAsString( - descriptor.getMangledTypeName()); - - OS << "\n- " << typeName << ":\n"; - OS << "Size: " << descriptor.Size << "\n"; - OS << "Alignment: " << descriptor.Alignment << "\n"; - OS << "Stride: " << descriptor.Stride << "\n"; - OS << "NumExtraInhabitants: " << descriptor.NumExtraInhabitants << "\n"; - } - } - } - void dumpAllSections(std::ostream &OS) { - OS << "FIELDS:\n"; - OS << "=======\n"; - dumpFieldSection(OS); - OS << '\n'; - OS << "ASSOCIATED TYPES:\n"; - OS << "=================\n"; - dumpAssociatedTypeSection(OS); - OS << '\n'; - OS << "BUILTIN TYPES:\n"; - OS << "==============\n"; - dumpBuiltinTypeSection(OS); - OS << '\n'; - } - - const TypeRef * - getDependentMemberTypeRef(const std::string &MangledTypeName, - const DependentMemberTypeRef *DependentMember) { - - if (auto AssocTys = lookupAssociatedTypes(MangledTypeName, DependentMember)) { - for (auto &AssocTy : *AssocTys) { - if (DependentMember->getMember().compare(AssocTy.getName()) != 0) - continue; - - auto SubstitutedTypeName = AssocTy.getMangledSubstitutedTypeName(); - auto Demangled = Demangle::demangleTypeAsNode(SubstitutedTypeName); - return decodeMangledType(Demangled); - } - } - return nullptr; + getBuilder().dumpAllSections(); } std::vector> getFieldTypeRefs(const TypeRef *TR) { - std::string MangledName; - if (auto N = dyn_cast(TR)) - MangledName = N->getMangledName(); - else if (auto BG = dyn_cast(TR)) - MangledName = BG->getMangledName(); - else - return {}; - - auto Subs = TR->getSubstMap(); - - std::vector> Fields; - for (auto Info : ReflectionInfos) { - for (auto &FieldDescriptor : Info.fieldmd) { - auto CandidateMangledName = FieldDescriptor.MangledTypeName.get(); - if (!CandidateMangledName) - continue; - if (MangledName.compare(CandidateMangledName) != 0) - continue; - for (auto &Field : FieldDescriptor) { - auto FieldName = Field.getFieldName(); - - // Empty cases of enums do not have a type - if (!Field.hasMangledTypeName()) { - Fields.push_back({FieldName, nullptr}); - continue; - } - - auto Demangled - = Demangle::demangleTypeAsNode(Field.getMangledTypeName()); - auto Unsubstituted = decodeMangledType(Demangled); - if (!Unsubstituted) - return {}; - - auto Substituted = Unsubstituted->subst(*this, Subs); - if (FieldName.empty()) - FieldName = ""; - Fields.push_back({FieldName, Substituted}); - } - } - } - return Fields; + return getBuilder().getFieldTypeRefs(TR); } std::vector> @@ -401,7 +73,7 @@ public: } void addReflectionInfo(ReflectionInfo I) { - ReflectionInfos.push_back(I); + getBuilder().addReflectionInfo(I); } swift_typeinfo_t getInfoForTypeRef(const TypeRef *TR) { diff --git a/include/swift/Reflection/TypeRef.h b/include/swift/Reflection/TypeRef.h index 04dae3a7f7e..1347d0ea6ce 100644 --- a/include/swift/Reflection/TypeRef.h +++ b/include/swift/Reflection/TypeRef.h @@ -26,11 +26,6 @@ namespace swift { namespace reflection { -template -class ReflectionContext; - -struct ReflectionInfo; - using llvm::cast; using llvm::dyn_cast; @@ -41,6 +36,7 @@ enum class TypeRefKind { }; class TypeRef; +class TypeRefBuilder; using DepthAndIndex = std::pair; using GenericArgumentMap = llvm::DenseMap; @@ -59,9 +55,8 @@ public: bool isConcrete() const; - template const TypeRef * - subst(ReflectionContext &RC, GenericArgumentMap Subs) const; + subst(TypeRefBuilder &Builder, GenericArgumentMap Subs) const; GenericArgumentMap getSubstMap() const; @@ -520,139 +515,6 @@ public: } }; -template -class TypeRefSubstitution - : public TypeRefVisitor, const TypeRef *> { - using StoredPointer = typename Runtime::StoredPointer; - ReflectionContext &RC; - GenericArgumentMap Substitutions; -public: - using TypeRefVisitor, const TypeRef *>::visit; - TypeRefSubstitution(ReflectionContext &RC, - GenericArgumentMap Substitutions) - : RC(RC), - Substitutions(Substitutions) {} - - const TypeRef *visitBuiltinTypeRef(const BuiltinTypeRef *B) { - return B; - } - - const TypeRef *visitNominalTypeRef(const NominalTypeRef *N) { - return N; - } - - const TypeRef *visitBoundGenericTypeRef(const BoundGenericTypeRef *BG) { - std::vector GenericParams; - for (auto Param : BG->getGenericParams()) - GenericParams.push_back(visit(Param)); - return BoundGenericTypeRef::create(RC.Builder, BG->getMangledName(), - GenericParams); - } - - const TypeRef *visitTupleTypeRef(const TupleTypeRef *T) { - std::vector Elements; - for (auto Element : T->getElements()) { - Elements.push_back(visit(Element)); - } - return TupleTypeRef::create(RC.Builder, Elements); - } - - const TypeRef *visitFunctionTypeRef(const FunctionTypeRef *F) { - std::vector SubstitutedArguments; - for (auto Argument : F->getArguments()) - SubstitutedArguments.push_back(visit(Argument)); - - auto SubstitutedResult = visit(F->getResult()); - - return FunctionTypeRef::create(RC.Builder, SubstitutedArguments, - SubstitutedResult); - } - - const TypeRef *visitProtocolTypeRef(const ProtocolTypeRef *P) { - return P; - } - - const TypeRef * - visitProtocolCompositionTypeRef(const ProtocolCompositionTypeRef *PC) { - return PC; - } - - const TypeRef *visitMetatypeTypeRef(const MetatypeTypeRef *M) { - return MetatypeTypeRef::create(RC.Builder, visit(M->getInstanceType())); - } - - const TypeRef * - visitExistentialMetatypeTypeRef(const ExistentialMetatypeTypeRef *EM) { - assert(EM->getInstanceType()->isConcrete()); - return EM; - } - - const TypeRef * - visitGenericTypeParameterTypeRef(const GenericTypeParameterTypeRef *GTP) { - auto found = Substitutions.find({GTP->getDepth(), GTP->getIndex()}); - assert(found != Substitutions.end()); - assert(found->second->isConcrete()); - return found->second; - } - - const TypeRef *visitDependentMemberTypeRef(const DependentMemberTypeRef *DM) { - auto SubstBase = visit(DM->getBase()); - - const TypeRef *TypeWitness; - - switch (SubstBase->getKind()) { - case TypeRefKind::Nominal: { - auto Nominal = cast(SubstBase); - TypeWitness = RC.getDependentMemberTypeRef(Nominal->getMangledName(), DM); - break; - } - case TypeRefKind::BoundGeneric: { - auto BG = cast(SubstBase); - TypeWitness = RC.getDependentMemberTypeRef(BG->getMangledName(), DM); - break; - } - default: - assert(false && "Unknown base type"); - } - - assert(TypeWitness); - return TypeWitness->subst(RC, SubstBase->getSubstMap()); - } - - const TypeRef *visitForeignClassTypeRef(const ForeignClassTypeRef *F) { - return F; - } - - const TypeRef *visitObjCClassTypeRef(const ObjCClassTypeRef *OC) { - return OC; - } - - const TypeRef *visitUnownedStorageTypeRef(const UnownedStorageTypeRef *US) { - return UnownedStorageTypeRef::create(RC.Builder, visit(US->getType())); - } - - const TypeRef *visitWeakStorageTypeRef(const WeakStorageTypeRef *WS) { - return WeakStorageTypeRef::create(RC.Builder, visit(WS->getType())); - } - - const TypeRef * - visitUnmanagedStorageTypeRef(const UnmanagedStorageTypeRef *US) { - return UnmanagedStorageTypeRef::create(RC.Builder, visit(US->getType())); - } - - const TypeRef *visitOpaqueTypeRef(const OpaqueTypeRef *Op) { - return Op; - } -}; - -template -const TypeRef * -TypeRef::subst(ReflectionContext &RC, GenericArgumentMap Subs) const { - const TypeRef *Result = TypeRefSubstitution(RC, Subs).visit(this); - assert(Result->isConcrete()); - return Result; -} - } // end namespace reflection } // end namespace swift diff --git a/include/swift/Reflection/TypeRefBuilder.h b/include/swift/Reflection/TypeRefBuilder.h new file mode 100644 index 00000000000..55489a8f7e3 --- /dev/null +++ b/include/swift/Reflection/TypeRefBuilder.h @@ -0,0 +1,244 @@ +//===--- TypeRefBuilder.h - Swift Type Reference Builder --------*- C++ -*-===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// +// +// Implements utilities for constructing TypeRefs and looking up field and +// enum case types. +// +//===----------------------------------------------------------------------===// + +#ifndef SWIFT_REFLECTION_TYPEREFBUILDER_H +#define SWIFT_REFLECTION_TYPEREFBUILDER_H + +#include "swift/Remote/MetadataReader.h" +#include "swift/Reflection/Records.h" +#include "swift/Reflection/TypeRef.h" + +#include +#include +#include + +class NodePointer; + +namespace swift { +namespace reflection { + +template +class ReflectionSection { + using const_iterator = Iterator; + const void * Begin; + const void * End; + +public: + ReflectionSection(const void * Begin, + const void * End) + : Begin(Begin), End(End) {} + + ReflectionSection(uint64_t Begin, uint64_t End) + : Begin(reinterpret_cast(Begin)), + End(reinterpret_cast(End)) {} + + void *startAddress() { + return const_cast(Begin); + } + + const_iterator begin() const { + return const_iterator(Begin, End); + } + + const_iterator end() const { + return const_iterator(End, End); + } + + size_t size() const { + return (char *)End - (char *)Begin; + } +}; + +using FieldSection = ReflectionSection; +using AssociatedTypeSection = ReflectionSection; +using BuiltinTypeSection = ReflectionSection; +using GenericSection = ReflectionSection; + +struct ReflectionInfo { + std::string ImageName; + FieldSection fieldmd; + AssociatedTypeSection assocty; + BuiltinTypeSection builtin; + GenericSection typeref; + GenericSection reflstr; +}; + +/// An implementation of MetadataReader's BuilderType concept for +/// building TypeRefs, and parsing field metadata from any images +/// it has been made aware of. +/// +/// Note that the TypeRefBuilder owns the memory for all TypeRefs +/// it vends. +class TypeRefBuilder { +public: + using Type = const TypeRef *; + + TypeRefBuilder() {} + + TypeRefBuilder(const TypeRefBuilder &other) = delete; + TypeRefBuilder &operator=(const TypeRefBuilder &other) = delete; + +private: + std::vector> TypeRefPool; + +public: + template + TypeRefTy *make_typeref(Args... args) { + auto TR = new TypeRefTy(::std::forward(args)...); + TypeRefPool.push_back(std::unique_ptr(TR)); + return TR; + } + + /// + /// Factory methods for all TypeRef kinds + /// + + const BuiltinTypeRef *createBuiltinType(const std::string &mangledName) { + return BuiltinTypeRef::create(*this, mangledName); + } + + const NominalTypeRef *createNominalType(const std::string &mangledName, + const TypeRef *parent) { + return NominalTypeRef::create(*this, mangledName, parent); + } + + const BoundGenericTypeRef * + createBoundGenericType(const std::string &mangledName, + const std::vector &args, + const TypeRef *parent) { + return BoundGenericTypeRef::create(*this, mangledName, args, parent); + } + + const TupleTypeRef * + createTupleType(const std::vector &elements, + bool isVariadic) { + return TupleTypeRef::create(*this, elements, isVariadic); + } + + const FunctionTypeRef * + createFunctionType(const std::vector &args, + const std::vector &inOutArgs, + const TypeRef *result, + FunctionTypeFlags flags) { + // FIXME: don't ignore inOutArgs + // FIXME: don't ignore flags + return FunctionTypeRef::create(*this, args, result); + } + + const ProtocolTypeRef *createProtocolType(const std::string &moduleName, + const std::string &protocolName) { + return ProtocolTypeRef::create(*this, moduleName, protocolName); + } + + const ProtocolCompositionTypeRef * + createProtocolCompositionType(const std::vector &protocols) { + for (auto protocol : protocols) { + if (!isa(protocol)) + return nullptr; + } + return ProtocolCompositionTypeRef::create(*this, protocols); + } + + const ExistentialMetatypeTypeRef * + createExistentialMetatypeType(const TypeRef *instance) { + return ExistentialMetatypeTypeRef::create(*this, instance); + } + + const MetatypeTypeRef *createMetatypeType(const TypeRef *instance) { + return MetatypeTypeRef::create(*this, instance); + } + + const GenericTypeParameterTypeRef * + createGenericTypeParameterType(unsigned depth, unsigned index) { + return GenericTypeParameterTypeRef::create(*this, depth, index); + } + + const DependentMemberTypeRef * + createDependentMemberType(const std::string &member, + const TypeRef *base, + const TypeRef *protocol) { + if (!isa(protocol)) + return nullptr; + return DependentMemberTypeRef::create(*this, member, base, protocol); + } + + const UnownedStorageTypeRef *createUnownedStorageType(const TypeRef *base) { + return UnownedStorageTypeRef::create(*this, base); + } + + const UnmanagedStorageTypeRef * + createUnmanagedStorageType(const TypeRef *base) { + return UnmanagedStorageTypeRef::create(*this, base); + } + + const WeakStorageTypeRef *createWeakStorageType(const TypeRef *base) { + return WeakStorageTypeRef::create(*this, base); + } + + const ObjCClassTypeRef *getUnnamedObjCClassType() { + return ObjCClassTypeRef::getUnnamed(); + } + + const ForeignClassTypeRef *getUnnamedForeignClassType() { + return ForeignClassTypeRef::getUnnamed(); + } + + const OpaqueTypeRef *getOpaqueType() { + return OpaqueTypeRef::get(); + } + + /// + /// Parsing reflection metadata + /// + + void addReflectionInfo(ReflectionInfo I) { + ReflectionInfos.push_back(I); + } + +private: + + std::vector ReflectionInfos; + + const AssociatedTypeDescriptor * + lookupAssociatedTypes(const std::string &MangledTypeName, + const DependentMemberTypeRef *DependentMember); + +public: + const TypeRef * + getDependentMemberTypeRef(const std::string &MangledTypeName, + const DependentMemberTypeRef *DependentMember); + + std::vector> + getFieldTypeRefs(const TypeRef *TR); + + /// + /// Dumping typerefs, field declarations, associated types + /// + + void dumpTypeRef(const std::string &MangledName, + std::ostream &OS, bool printTypeName = false); + void dumpFieldSection(std::ostream &OS); + void dumpAssociatedTypeSection(std::ostream &OS); + void dumpBuiltinTypeSection(std::ostream &OS); + void dumpAllSections(std::ostream &OS); +}; + + +} // end namespace reflection +} // end namespace swift + +#endif // SWIFT_REFLECTION_TYPEREFBUILDER_H diff --git a/include/swift/Remote/MetadataReader.h b/include/swift/Remote/MetadataReader.h index aa5ecb06ea6..12dc0fcd9a7 100644 --- a/include/swift/Remote/MetadataReader.h +++ b/include/swift/Remote/MetadataReader.h @@ -39,52 +39,18 @@ template using SharedProtocolDescriptorRef = std::shared_ptr>; -/// A generic reader of metadata. -/// -/// BuilderType must implement a particular interface which is currently -/// too fluid to allow useful documentation; consult the actual -/// implementations. The chief thing is that it provides several member -/// types which should obey the following constraints: -/// - T() yields a value which is false when contextually converted to bool -/// - a false value signals that an error occurred when building a value -template -class MetadataReader { -public: +/// A utility class for constructing abstract types from +/// a textual mangling. +template +class TypeDecoder { using Type = typename BuilderType::Type; - using StoredPointer = typename Runtime::StoredPointer; - using StoredSize = typename Runtime::StoredSize; + using NodeKind = Demangle::Node::Kind; -private: - std::unordered_map TypeCache; - std::unordered_map> - MetadataCache; + BuilderType &Builder; - std::unordered_map, - StoredPointer>> - NominalTypeDescriptorCache; - -public: - BuilderType Builder; - - std::shared_ptr Reader; - - template - MetadataReader(std::shared_ptr reader, T &&... args) - : Builder(std::forward(args)...), - Reader(std::move(reader)) { - - } - - MetadataReader(const MetadataReader &other) = delete; - MetadataReader &operator=(const MetadataReader &other) = delete; - - /// Clear all of the caches in this reader. - void clear() { - TypeCache.clear(); - MetadataCache.clear(); - NominalTypeDescriptorCache.clear(); - } + public: + explicit TypeDecoder(BuilderType &Builder) + : Builder(Builder) {} /// Given a demangle tree, attempt to turn it into a type. Type decodeMangledType(const Demangle::NodePointer &Node) { @@ -257,11 +223,11 @@ public: return Type(); } } + private: bool decodeMangledNominalType(const Demangle::NodePointer &node, std::string &mangledName, Type &parent) { - using NodeKind = Demangle::Node::Kind; if (node->getKind() == NodeKind::Type) return decodeMangledNominalType(node->getChild(0), mangledName, parent); @@ -286,8 +252,6 @@ private: std::vector &args, std::vector &argsAreInOut, FunctionTypeFlags &flags) { - using NodeKind = Demangle::Node::Kind; - // Look through a couple of sugar nodes. if (node->getKind() == NodeKind::Type || node->getKind() == NodeKind::ArgumentTuple) { @@ -335,8 +299,71 @@ private: // Otherwise, handle the type as a single argument. return decodeSingle(node); } +}; + +template +static inline typename BuilderType::Type +decodeMangledType(BuilderType &Builder, + const Demangle::NodePointer &Node) { + return TypeDecoder(Builder).decodeMangledType(Node); +} + +/// A generic reader of metadata. +/// +/// BuilderType must implement a particular interface which is currently +/// too fluid to allow useful documentation; consult the actual +/// implementations. The chief thing is that it provides several member +/// types which should obey the following constraints: +/// - T() yields a value which is false when contextually converted to bool +/// - a false value signals that an error occurred when building a value +template +class MetadataReader { +public: + using Type = typename BuilderType::Type; + using StoredPointer = typename Runtime::StoredPointer; + using StoredSize = typename Runtime::StoredSize; + +private: + std::unordered_map TypeCache; + std::unordered_map> + MetadataCache; + + std::unordered_map, + StoredPointer>> + NominalTypeDescriptorCache; public: + BuilderType Builder; + + BuilderType &getBuilder() { + return this->Builder; + } + + std::shared_ptr Reader; + + template + MetadataReader(std::shared_ptr reader, T &&... args) + : Builder(std::forward(args)...), + Reader(std::move(reader)) { + + } + + MetadataReader(const MetadataReader &other) = delete; + MetadataReader &operator=(const MetadataReader &other) = delete; + + /// Clear all of the caches in this reader. + void clear() { + TypeCache.clear(); + MetadataCache.clear(); + NominalTypeDescriptorCache.clear(); + } + + /// Given a demangle tree, attempt to turn it into a type. + Type decodeMangledType(const Demangle::NodePointer &Node) { + return swift::remote::decodeMangledType(Builder, Node); + } + /// Given a remote pointer to metadata, attempt to turn it into a type. Type readTypeFromMetadata(StoredPointer MetadataAddress) { auto Cached = TypeCache.find(MetadataAddress); diff --git a/lib/AST/ASTPrinter.cpp b/lib/AST/ASTPrinter.cpp index a82ba9036af..17fae892843 100644 --- a/lib/AST/ASTPrinter.cpp +++ b/lib/AST/ASTPrinter.cpp @@ -2535,16 +2535,6 @@ void PrintAST::printOneParameter(const ParamDecl *param, bool Curried, if (!TheTypeLoc.getTypeRepr() && param->hasType()) TheTypeLoc = TypeLoc::withoutLoc(param->getType()); - auto ContainsFunc = [&] (DeclAttrKind Kind) { - return Options.ExcludeAttrList.end() != std::find(Options.ExcludeAttrList. - begin(), Options.ExcludeAttrList.end(), Kind); - }; - - auto RemoveFunc = [&] (DeclAttrKind Kind) { - Options.ExcludeAttrList.erase(std::find(Options.ExcludeAttrList.begin(), - Options.ExcludeAttrList.end(), Kind)); - }; - // If the parameter is variadic, we will print the "..." after it, but we have // to strip off the added array type. if (param->isVariadic() && TheTypeLoc.getType()) { diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index ed8a07527c7..06147c6a2c4 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1315,7 +1315,9 @@ TypeBase *NameAliasType::getSinglyDesugaredType() { // The type for a generic TypeAliasDecl is an UnboundGenericType. if (TAD->getGenericParams()) - return UnboundGenericType::get(TAD, Type(), TAD->getASTContext()); + return UnboundGenericType::get(TAD, + TAD->getDeclContext()->getDeclaredTypeInContext(), + TAD->getASTContext()); return getDecl()->getUnderlyingType().getPointer(); } @@ -1919,13 +1921,14 @@ bool TypeBase::isPotentiallyBridgedValueType() { } /// Determine whether this is a representable Objective-C object type. -static ForeignRepresentableKind getObjCObjectRepresentable(Type type) { +static ForeignRepresentableKind getObjCObjectRepresentable(Type type, + DeclContext *dc) { // @objc metatypes are representable when their instance type is. if (auto metatype = type->getAs()) { // If the instance type is not representable, the metatype is not // representable. auto instanceType = metatype->getInstanceType(); - if (getObjCObjectRepresentable(instanceType) + if (getObjCObjectRepresentable(instanceType, dc) == ForeignRepresentableKind::None) return ForeignRepresentableKind::None; @@ -1955,6 +1958,14 @@ static ForeignRepresentableKind getObjCObjectRepresentable(Type type) { // Objective-C existential types. if (type->isObjCExistentialType()) return ForeignRepresentableKind::Object; + + // Class-constrained generic parameters, from ObjC generic classes. + if (auto tyContext = dc->getInnermostTypeContext()) + if (auto clas = tyContext->getAsClassOrClassExtensionContext()) + if (clas->hasClangNode()) + if (auto archetype = type->getAs()) + if (archetype->requiresClass()) + return ForeignRepresentableKind::Object; return ForeignRepresentableKind::None; } @@ -1976,7 +1987,7 @@ getForeignRepresentable(Type type, ForeignLanguage language, DeclContext *dc) { // Objective-C object types, including metatypes. if (language == ForeignLanguage::ObjectiveC) { - auto representable = getObjCObjectRepresentable(type); + auto representable = getObjCObjectRepresentable(type, dc); if (representable != ForeignRepresentableKind::None) return { representable, nullptr }; } @@ -2137,7 +2148,7 @@ getForeignRepresentable(Type type, ForeignLanguage language, DeclContext *dc) { pointerElt = objectType; if (language == ForeignLanguage::ObjectiveC && - getObjCObjectRepresentable(pointerElt) + getObjCObjectRepresentable(pointerElt, dc) != ForeignRepresentableKind::None) return { ForeignRepresentableKind::Trivial, nullptr }; diff --git a/lib/IDE/CodeCompletion.cpp b/lib/IDE/CodeCompletion.cpp index 2db140cbc7d..2b7829d1a01 100644 --- a/lib/IDE/CodeCompletion.cpp +++ b/lib/IDE/CodeCompletion.cpp @@ -52,6 +52,8 @@ enum CodeCompletionCommandKind { keyword, recommended, recommendedover, + mutatingvariant, + nonmutatingvariant, }; CodeCompletionCommandKind getCommandKind(StringRef Command) { @@ -61,6 +63,8 @@ CodeCompletionCommandKind getCommandKind(StringRef Command) { CHECK_CASE(keyword); CHECK_CASE(recommended); CHECK_CASE(recommendedover); + CHECK_CASE(mutatingvariant); + CHECK_CASE(nonmutatingvariant); #undef CHECK_CASE return CodeCompletionCommandKind::none; } @@ -74,6 +78,8 @@ StringRef getCommandName(CodeCompletionCommandKind Kind) { CHECK_CASE(keyword) CHECK_CASE(recommended) CHECK_CASE(recommendedover) + CHECK_CASE(mutatingvariant); + CHECK_CASE(nonmutatingvariant); #undef CHECK_CASE llvm_unreachable("Cannot handle this Kind."); } @@ -89,6 +95,8 @@ return true; CHECK_CASE(keyword) CHECK_CASE(recommended) CHECK_CASE(recommendedover) + CHECK_CASE(mutatingvariant); + CHECK_CASE(nonmutatingvariant); #undef CHECK_CASE } while (!Content.empty()); return false; @@ -221,6 +229,12 @@ public: void visitRecommendedoverField(const RecommendedoverField *Field) override { Kind = CodeCompletionCommandKind::recommendedover; } + void visitMutatingvariantField(const MutatingvariantField *Field) override { + Kind = CodeCompletionCommandKind::mutatingvariant; + } + void visitNonmutatingvariantField(const NonmutatingvariantField *Field) override { + Kind = CodeCompletionCommandKind::nonmutatingvariant; + } void visitText(const Text *Text) override { if (Kind == CodeCompletionCommandKind::none) return; @@ -252,6 +266,8 @@ void getSwiftDocKeyword(const Decl* D, CommandWordsPairs &Words) { case ASTNodeKind::KeywordField: case ASTNodeKind::RecommendedField: case ASTNodeKind::RecommendedoverField: + case ASTNodeKind::MutatingvariantField: + case ASTNodeKind::NonmutatingvariantField: Extractor.walk(Part); break; default: diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index a6bece9be47..dbb1a047a9b 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -2952,17 +2952,6 @@ ParserResult Parser::parseDeclTypeAlias(Parser::ParseDeclOptions Flags diagnose(genericParams->getWhereLoc(), diag::associated_type_generic_parameter_list) .highlight(genericParams->getWhereClauseSourceRange()); - } else { - // Reject inheritance clauses. - for (auto *P : genericParams->getParams()) { - if (!P->getInherited().empty()) { - diagnose(P->getInherited().front().getLoc(), - diag::typealias_generic_list_constraint); - - P->setInvalid(); - P->setInherited({}); - } - } } } diff --git a/lib/SILGen/SILGenStmt.cpp b/lib/SILGen/SILGenStmt.cpp index 8bceb091c26..d8d528ecb28 100644 --- a/lib/SILGen/SILGenStmt.cpp +++ b/lib/SILGen/SILGenStmt.cpp @@ -724,68 +724,7 @@ void StmtEmitter::visitRepeatWhileStmt(RepeatWhileStmt *S) { } void StmtEmitter::visitForStmt(ForStmt *S) { - // Enter a new scope. - LexicalScope ForScope(SGF.Cleanups, SGF, CleanupLocation(S)); - - // Emit any local 'var' variables declared in the initializer. - for (auto D : S->getInitializerVarDecls()) { - SGF.visit(D); - } - - if (auto *Initializer = S->getInitializer().getPtrOrNull()) { - SGF.emitIgnoredExpr(Initializer); - } - - // If we ever reach an unreachable point, stop emitting statements. - // This will need revision if we ever add goto. - if (!SGF.B.hasValidInsertionPoint()) return; - - // Create a new basic block and jump into it. - SILBasicBlock *loopBB = createBasicBlock(); - SGF.B.emitBlock(loopBB, S); - - JumpDest endDest = createJumpDest(S->getBody()); - - // Evaluate the condition with the false edge leading directly - // to the continuation block. - Condition Cond = S->getCond().isNonNull() ? - SGF.emitCondition(S->getCond().get(), /*hasFalseCode*/ false) : - Condition(loopBB, 0, 0, S); // Infinite loop. - - // If there's a true edge, emit the body in it. - if (Cond.hasTrue()) { - Cond.enterTrue(SGF); - SGF.emitProfilerIncrement(S->getBody()); - - // Set the destinations for 'break' and 'continue'. - JumpDest incDest = createJumpDest(S->getBody()); - SGF.BreakContinueDestStack.push_back({S, endDest, incDest}); - - visit(S->getBody()); - - SGF.BreakContinueDestStack.pop_back(); - - emitOrDeleteBlock(SGF, incDest, S); - - if (SGF.B.hasValidInsertionPoint() && S->getIncrement().isNonNull()) { - FullExpr Scope(SGF.Cleanups, CleanupLocation(S->getIncrement().get())); - // Ignore the result of the increment expression. - SGF.emitIgnoredExpr(S->getIncrement().get()); - } - - if (SGF.B.hasValidInsertionPoint()) { - // Associate the loop body's closing brace with this branch. - RegularLocation L(S->getBody()); - L.pointToEnd(); - SGF.B.createBranch(L, loopBB); - } - Cond.exitTrue(SGF); - } - - // Complete the conditional execution. - Cond.complete(SGF); - - emitOrDeleteBlock(SGF, endDest, S); + llvm_unreachable("c-style for loop is always a semantic error"); } void StmtEmitter::visitForEachStmt(ForEachStmt *S) { diff --git a/lib/SILOptimizer/PassManager/Passes.cpp b/lib/SILOptimizer/PassManager/Passes.cpp index 6466e7c2a4f..df82e171cb5 100644 --- a/lib/SILOptimizer/PassManager/Passes.cpp +++ b/lib/SILOptimizer/PassManager/Passes.cpp @@ -219,24 +219,24 @@ void AddSSAPasses(SILPassManager &PM, OptimizationLevelKind OpLevel) { // Promote stack allocations to values and eliminate redundant // loads. PM.addMem2Reg(); - PM.addRedundantLoadElimination(); + PM.addPerformanceConstantPropagation(); // Do a round of CFG simplification, followed by peepholes, then // more CFG simplification. - AddSimplifyCFGSILCombine(PM); - PM.addPerformanceConstantPropagation(); - PM.addCSE(); - PM.addSILCombine(); - PM.addJumpThreadSimplifyCFG(); - // Jump threading can expose opportunity for silcombine (enum -> is_enum_tag-> + // Jump threading can expose opportunity for SILCombine (enum -> is_enum_tag-> // cond_br). + PM.addJumpThreadSimplifyCFG(); PM.addSILCombine(); - // Which can expose opportunity for simplifcfg. + // SILCombine can expose further opportunities for SimplifyCFG. PM.addSimplifyCFG(); + PM.addCSE(); + PM.addRedundantLoadElimination(); + // Perform retain/release code motion and run the first ARC optimizer. PM.addCSE(); PM.addDCE(); + PM.addEarlyCodeMotion(); PM.addARCSequenceOpts(); diff --git a/lib/Sema/CSDiag.cpp b/lib/Sema/CSDiag.cpp index 808745f3ffe..7703fe6f016 100644 --- a/lib/Sema/CSDiag.cpp +++ b/lib/Sema/CSDiag.cpp @@ -4209,9 +4209,9 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) { // Get the expression result of type checking the arguments to the call // independently, so we have some idea of what we're working with. // - auto argExpr = typeCheckArgumentChildIndependently(callExpr->getArg(), argType, - calleeInfo, - TCC_AllowUnresolvedTypeVariables); + auto argExpr = typeCheckArgumentChildIndependently(callExpr->getArg(), + argType, calleeInfo, + TCC_AllowUnresolvedTypeVariables); if (!argExpr) return true; // already diagnosed. diff --git a/lib/Sema/MiscDiagnostics.cpp b/lib/Sema/MiscDiagnostics.cpp index 232f9a246b9..83739b494b7 100644 --- a/lib/Sema/MiscDiagnostics.cpp +++ b/lib/Sema/MiscDiagnostics.cpp @@ -973,8 +973,8 @@ public: private: bool diagAvailability(const ValueDecl *D, SourceRange R); - bool diagnoseIncDecDeprecation(const ValueDecl *D, SourceRange R, - const AvailableAttr *Attr); + bool diagnoseIncDecRemoval(const ValueDecl *D, SourceRange R, + const AvailableAttr *Attr); /// Walk an assignment expression, checking for availability. void walkAssignExpr(AssignExpr *E) { @@ -1090,13 +1090,16 @@ bool AvailabilityWalker::diagAvailability(const ValueDecl *D, SourceRange R) { if (!D) return false; + if (auto *attr = AvailableAttr::isUnavailable(D)) + if (diagnoseIncDecRemoval(D, R, attr)) + return true; + if (TC.diagnoseExplicitUnavailability(D, R, DC)) return true; // Diagnose for deprecation if (const AvailableAttr *Attr = TypeChecker::getDeprecated(D)) { - if (!diagnoseIncDecDeprecation(D, R, Attr)) - TC.diagnoseDeprecated(R, DC, Attr, D->getFullName()); + TC.diagnoseDeprecated(R, DC, Attr, D->getFullName()); } if (TC.getLangOpts().DisableAvailabilityChecking) @@ -1132,11 +1135,11 @@ static bool isIntegerOrFloatingPointType(Type ty, DeclContext *DC, } -/// If this is a call to a deprecated ++ / -- operator, try to diagnose it with -/// a fixit hint and return true. If not, or if we fail, return false. -bool AvailabilityWalker::diagnoseIncDecDeprecation(const ValueDecl *D, - SourceRange R, - const AvailableAttr *Attr) { +/// If this is a call to an unavailable ++ / -- operator, try to diagnose it +/// with a fixit hint and return true. If not, or if we fail, return false. +bool AvailabilityWalker::diagnoseIncDecRemoval(const ValueDecl *D, + SourceRange R, + const AvailableAttr *Attr) { // We can only produce a fixit if we're talking about ++ or --. bool isInc = D->getNameStr() == "++"; if (!isInc && D->getNameStr() != "--") @@ -1171,17 +1174,16 @@ bool AvailabilityWalker::diagnoseIncDecDeprecation(const ValueDecl *D, if (!replacement.empty()) { // If we emit a deprecation diagnostic, produce a fixit hint as well. - TC.diagnoseDeprecated(R, DC, Attr, D->getFullName(), - [&](InFlightDiagnostic &diag) { - if (isa(call)) { - // Prefix: remove the ++ or --. - diag.fixItRemove(call->getFn()->getSourceRange()); - diag.fixItInsertAfter(call->getArg()->getEndLoc(), replacement); - } else { - // Postfix: replace the ++ or --. - diag.fixItReplace(call->getFn()->getSourceRange(), replacement); - } - }); + auto diag = TC.diagnose(R.Start, diag::availability_decl_unavailable_msg, + D->getFullName(), "it has been removed in Swift 3"); + if (isa(call)) { + // Prefix: remove the ++ or --. + diag.fixItRemove(call->getFn()->getSourceRange()); + diag.fixItInsertAfter(call->getArg()->getEndLoc(), replacement); + } else { + // Postfix: replace the ++ or --. + diag.fixItReplace(call->getFn()->getSourceRange(), replacement); + } return true; } @@ -1860,7 +1862,6 @@ static void checkCStyleForLoop(TypeChecker &TC, const ForStmt *FS) { if (checker.isVarDeclEverWritten(loopVar)) { diagnostic.flush(); - TC.diagnose(FS->getStartLoc(), diag::cant_fix_c_style_for_stmt); return; } diff --git a/lib/Sema/TypeCheckDecl.cpp b/lib/Sema/TypeCheckDecl.cpp index 2b4845c1b6b..b3b5493a187 100644 --- a/lib/Sema/TypeCheckDecl.cpp +++ b/lib/Sema/TypeCheckDecl.cpp @@ -3473,8 +3473,7 @@ public: TAD->getUnderlyingTypeLoc().setInvalidType(TC.Context); } else if (TAD->getDeclContext()->isGenericContext()) { TAD->setInterfaceType( - ArchetypeBuilder::mapTypeOutOfContext(TAD->getDeclContext(), - TAD->getType())); + ArchetypeBuilder::mapTypeOutOfContext(TAD, TAD->getType())); } // We create TypeAliasTypes with invalid underlying types, so we @@ -6428,7 +6427,7 @@ void TypeChecker::validateDecl(ValueDecl *D, bool resolveTypeParams) { if (typeAlias->hasType()) { // If we have are recursing into validation and already have a type set... - // but also don't have the underlying type computed, then we are are + // but also don't have the underlying type computed, then we are // recursing into interface validation while checking the body of the // type. Reject this with a circularity diagnostic. if (!typeAlias->hasUnderlyingType()) { @@ -6444,6 +6443,9 @@ void TypeChecker::validateDecl(ValueDecl *D, bool resolveTypeParams) { // Check generic parameters, if needed. if (auto gp = typeAlias->getGenericParams()) { + gp->setOuterParameters( + typeAlias->getDeclContext()->getGenericParamsOfContext()); + // Validate the generic type parameters. if (validateGenericTypeSignature(typeAlias)) { markInvalidGenericSignature(typeAlias, *this); @@ -6457,7 +6459,9 @@ void TypeChecker::validateDecl(ValueDecl *D, bool resolveTypeParams) { revertGenericParamList(gp); auto builder = createArchetypeBuilder(typeAlias->getModuleContext()); - checkGenericParamList(&builder, gp, nullptr/*parentSig*/); + auto *parentSig = typeAlias->getDeclContext()-> + getGenericSignatureOfContext(); + checkGenericParamList(&builder, gp, parentSig); finalizeGenericParamList(builder, gp, typeAlias, *this); } } diff --git a/lib/Sema/TypeCheckExpr.cpp b/lib/Sema/TypeCheckExpr.cpp index 076af4c6d35..1872b1655ec 100644 --- a/lib/Sema/TypeCheckExpr.cpp +++ b/lib/Sema/TypeCheckExpr.cpp @@ -732,14 +732,14 @@ namespace { llvm::SmallPtrSet Diagnosed; /// The AbstractClosureExpr or AbstractFunctionDecl being analyzed. AnyFunctionRef AFR; - bool &capturesTypes; + SourceLoc &TypeCapturingLoc; public: FindCapturedVars(TypeChecker &tc, SmallVectorImpl &captureList, - bool &capturesTypes, + SourceLoc &typeCapturingLoc, AnyFunctionRef AFR) : TC(tc), captureList(captureList), AFR(AFR), - capturesTypes(capturesTypes) { + TypeCapturingLoc(typeCapturingLoc) { if (auto AFD = AFR.getAbstractFunctionDecl()) CaptureLoc = AFD->getLoc(); else { @@ -758,7 +758,7 @@ namespace { /// FIXME: SILGen doesn't currently allow local generic functions to /// capture generic parameters from an outer context. Once it does, we /// will need to distinguish outer and inner type parameters here. - void checkType(Type type) { + void checkType(Type type, SourceLoc loc) { // Nothing to do if the type is concrete. if (!type || !type->hasArchetype()) return; @@ -766,14 +766,17 @@ namespace { // Walk the type to see if we have any archetypes that are *not* open // existentials and that aren't type-erased. class CapturesTypeWalker final : public TypeWalker { - bool &CapturesTypes; + SourceLoc &TypeCapturingLoc; + SourceLoc CurLoc; public: - CapturesTypeWalker(bool &capturesTypes) : CapturesTypes(capturesTypes){} + CapturesTypeWalker(SourceLoc &capturingLoc, SourceLoc curLoc) + : TypeCapturingLoc(capturingLoc), CurLoc(curLoc) {} Action walkToTypePre(Type t) override { if (t->is() && !t->isOpenedExistential()) { - CapturesTypes = true; + if (TypeCapturingLoc.isInvalid()) + TypeCapturingLoc = CurLoc; return Action::Stop; } @@ -789,7 +792,7 @@ namespace { } }; - type.walk(CapturesTypeWalker(capturesTypes)); + type.walk(CapturesTypeWalker(TypeCapturingLoc, loc)); } /// Add the specified capture to the closure's capture list, diagnosing it @@ -812,12 +815,12 @@ namespace { captureList[entryNumber-1] = capture; } - // Visit the type of the capture. If we capture 'self' via a 'super' call, - // and the superclass is not generic, there might not be any generic - // parameter types in the closure body, so we have to account for them - // here. - if (VD->hasType()) - checkType(VD->getType()); + // Visit the type of the capture, if it isn't a class reference, since + // we'd need the metadata to do so. + if (VD->hasType() + && (!AFR.isObjC() + || !VD->getType()->hasRetainablePointerRepresentation())) + checkType(VD->getType(), VD->getLoc()); // If VD is a noescape decl, then the closure we're computing this for // must also be noescape. @@ -999,7 +1002,7 @@ namespace { } if (innerClosure.getCaptureInfo().hasGenericParamCaptures()) - capturesTypes = true; + TypeCapturingLoc = innerClosure.getLoc(); } bool walkToDeclPre(Decl *D) override { @@ -1018,12 +1021,131 @@ namespace { return true; } + + bool usesTypeMetadataOfFormalType(Expr *E) { + // For non-ObjC closures, assume the type metadata is always used. + if (!AFR.isObjC()) + return true; + + if (!E->getType() || E->getType()->is()) + return false; + + // We can use Objective-C generics in limited ways without reifying + // their type metadata, meaning we don't need to capture their generic + // params. + + // Look through one layer of optionality when considering the class- + + // Referring to a class-constrained generic or metatype + // doesn't require its type metadata. + if (auto declRef = dyn_cast(E)) + return !declRef->getDecl()->isObjC() + && !E->getType()->hasRetainablePointerRepresentation() + && !E->getType()->is(); + + // Loading classes or metatypes doesn't require their metadata. + if (isa(E)) + return !E->getType()->hasRetainablePointerRepresentation() + && !E->getType()->is(); + + // Accessing @objc members doesn't require type metadata. + if (auto memberRef = dyn_cast(E)) + return !memberRef->getMember().getDecl()->hasClangNode(); + + if (auto applyExpr = dyn_cast(E)) { + if (auto methodApply = dyn_cast(applyExpr->getFn())) { + if (auto callee = dyn_cast(methodApply->getFn())) { + return !callee->getDecl()->isObjC(); + } + } + if (auto callee = dyn_cast(applyExpr->getFn())) { + return !callee->getDecl()->isObjC(); + } + } + + if (auto subscriptExpr = dyn_cast(E)) { + return !subscriptExpr->getDecl().getDecl()->isObjC(); + } + + // Getting the dynamic type of a class doesn't require type metadata. + if (isa(E)) + return !E->getType()->castTo()->getInstanceType() + ->hasRetainablePointerRepresentation(); + + // Building a fixed-size tuple doesn't require type metadata. + // Approximate this for the purposes of being able to invoke @objc methods + // by considering tuples of ObjC-representable types to not use metadata. + if (auto tuple = dyn_cast(E)) { + for (auto elt : tuple->getType()->castTo()->getElements()) { + if (!elt.getType()->isRepresentableIn(ForeignLanguage::ObjectiveC, + AFR.getAsDeclContext())) + return true; + } + return false; + } + + // Coercion by itself is a no-op. + if (isa(E)) + return false; + + // Upcasting doesn't require type metadata. + if (isa(E)) + return false; + if (isa(E)) + return false; + if (isa(E)) + return false; + if (isa(E)) + return false; + + // Identity expressions are no-ops. + if (isa(E)) + return false; + + // Discarding an assignment is a no-op. + if (isa(E)) + return false; + + // Opening an @objc existential or metatype is a no-op. + if (auto open = dyn_cast(E)) + return !open->getSubExpr()->getType()->isObjCExistentialType() + && !open->getSubExpr()->getType()->is(); + + // Erasure to an ObjC existential or between metatypes doesn't require + // type metadata. + if (auto erasure = dyn_cast(E)) { + if (E->getType()->isObjCExistentialType() + || E->getType()->is()) + return false; + // Erasure to a Swift protocol always captures the type metadata from + // its subexpression. + checkType(erasure->getSubExpr()->getType(), + erasure->getSubExpr()->getLoc()); + return true; + } + + // Converting an @objc metatype to AnyObject doesn't require type + // metadata. + if (isa(E) + || isa(E)) + return false; + + return true; + } std::pair walkToExprPre(Expr *E) override { - checkType(E->getType()); + if (usesTypeMetadataOfFormalType(E)) { + checkType(E->getType(), E->getLoc()); + } + + // Some kinds of expression don't really evaluate their subexpression, + // so we don't need to traverse. + if (isa(E)) { + return { false, E }; + } if (auto *ECE = dyn_cast(E)) { - checkType(ECE->getCastTypeLoc().getType()); + checkType(ECE->getCastTypeLoc().getType(), ECE->getLoc()); return { true, E }; } @@ -1038,7 +1160,7 @@ namespace { return { false, superE }; } - // Don't recurse into child closures. They should already have a capture + // Don't recur into child closures. They should already have a capture // list computed; we just propagate it, filtering out stuff that they // capture from us. if (auto *SubCE = dyn_cast(E)) { @@ -1074,12 +1196,29 @@ void TypeChecker::computeCaptures(AnyFunctionRef AFR) { return; SmallVector Captures; - bool GenericParamCaptures = false; - FindCapturedVars finder(*this, Captures, GenericParamCaptures, AFR); + SourceLoc GenericParamCaptureLoc; + FindCapturedVars finder(*this, Captures, GenericParamCaptureLoc, AFR); AFR.getBody()->walk(finder); - if (AFR.hasType()) - finder.checkType(AFR.getType()); + if (AFR.hasType() && !AFR.isObjC()) { + finder.checkType(AFR.getType(), AFR.getLoc()); +#if 0 + for (auto paramList : AFR.getParameterLists()) { + for (auto param : *paramList) { + // Passing parameters of class type doesn't require their metadata. + if (param->hasType() + && !param->getType()->is() + && !param->getType()->hasRetainablePointerRepresentation()) + finder.checkType(param->getType(), param->getLoc()); + } + } + + if (AFR.getBodyResultType() + && !AFR.getBodyResultType()->is() + && !AFR.getBodyResultType()->hasRetainablePointerRepresentation()) + finder.checkType(AFR.getBodyResultType(), AFR.getLoc()); +#endif + } // If this is an init(), explicitly walk the initializer values for members of // the type. They will be implicitly emitted by SILGen into the generated @@ -1111,7 +1250,8 @@ void TypeChecker::computeCaptures(AnyFunctionRef AFR) { if (!AFD || (!AFD->getGenericParams() && AFD->getDeclContext()->isLocalContext())) { - AFR.getCaptureInfo().setGenericParamCaptures(GenericParamCaptures); + AFR.getCaptureInfo() + .setGenericParamCaptures(GenericParamCaptureLoc.isValid()); } if (Captures.empty()) @@ -1121,11 +1261,14 @@ void TypeChecker::computeCaptures(AnyFunctionRef AFR) { // Extensions of generic ObjC functions can't use generic parameters from // their context. - if (AFD && GenericParamCaptures) { + if (AFD && GenericParamCaptureLoc.isValid()) { if (auto Clas = AFD->getParent()->getAsClassOrClassExtensionContext()) { - if (Clas->isGenericContext() && Clas->hasClangNode()) + if (Clas->isGenericContext() && Clas->hasClangNode()) { diagnose(AFD->getLoc(), diag::objc_generic_extension_using_type_parameter); + diagnose(GenericParamCaptureLoc, + diag::objc_generic_extension_using_type_parameter_here); + } } } diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index 6015b5801a9..0c177425a78 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -479,12 +479,25 @@ Type TypeChecker::applyUnboundGenericArguments( // If we're completing a generic TypeAlias, then we map the types provided // onto the underlying type. if (auto *TAD = dyn_cast(unbound->getDecl())) { + auto signature = TAD->getGenericSignature(); assert(TAD->getGenericParams()->getAllArchetypes().size() == genericArgs.size() && + signature->getInnermostGenericParams().size() == genericArgs.size()&& "argument arity mismatch"); SmallVector subs; subs.reserve(genericArgs.size()); + + // If we have any nested archetypes from an outer type, include them + // verbatim. + auto outerParams = signature->getGenericParams(); + outerParams = outerParams.drop_back(genericArgs.size()); + for (auto param : outerParams) { + Type type = resolver->resolveGenericTypeParamType(param); + + subs.push_back(Substitution(type, {})); + } + for (auto t : genericArgs) subs.push_back(Substitution(t.getType(), {})); diff --git a/lib/Sema/TypeChecker.cpp b/lib/Sema/TypeChecker.cpp index e6e088bc0f5..c0a22f8e84a 100644 --- a/lib/Sema/TypeChecker.cpp +++ b/lib/Sema/TypeChecker.cpp @@ -2244,8 +2244,7 @@ static bool isInsideDeprecatedDeclaration(SourceRange ReferenceRange, void TypeChecker::diagnoseDeprecated(SourceRange ReferenceRange, const DeclContext *ReferenceDC, const AvailableAttr *Attr, - DeclName Name, - std::function extraInfoHandler) { + DeclName Name) { // We match the behavior of clang to not report deprecation warnings // inside declarations that are themselves deprecated on all deployment // targets. @@ -2270,30 +2269,24 @@ void TypeChecker::diagnoseDeprecated(SourceRange ReferenceRange, DeprecatedVersion = Attr->Deprecated.getValue(); if (Attr->Message.empty() && Attr->Rename.empty()) { - auto diagValue = std::move( - diagnose(ReferenceRange.Start, diag::availability_deprecated, Name, - Attr->hasPlatform(), Platform, Attr->Deprecated.hasValue(), - DeprecatedVersion) - .highlight(Attr->getRange())); - extraInfoHandler(diagValue); + diagnose(ReferenceRange.Start, diag::availability_deprecated, Name, + Attr->hasPlatform(), Platform, Attr->Deprecated.hasValue(), + DeprecatedVersion) + .highlight(Attr->getRange()); return; } if (Attr->Message.empty()) { - auto diagValue = std::move( - diagnose(ReferenceRange.Start, diag::availability_deprecated_rename, Name, - Attr->hasPlatform(), Platform, Attr->Deprecated.hasValue(), - DeprecatedVersion, Attr->Rename) - .highlight(Attr->getRange())); - extraInfoHandler(diagValue); + diagnose(ReferenceRange.Start, diag::availability_deprecated_rename, Name, + Attr->hasPlatform(), Platform, Attr->Deprecated.hasValue(), + DeprecatedVersion, Attr->Rename) + .highlight(Attr->getRange()); } else { EncodedDiagnosticMessage EncodedMessage(Attr->Message); - auto diagValue = std::move( - diagnose(ReferenceRange.Start, diag::availability_deprecated_msg, Name, - Attr->hasPlatform(), Platform, Attr->Deprecated.hasValue(), - DeprecatedVersion, EncodedMessage.Message) - .highlight(Attr->getRange())); - extraInfoHandler(diagValue); + diagnose(ReferenceRange.Start, diag::availability_deprecated_msg, Name, + Attr->hasPlatform(), Platform, Attr->Deprecated.hasValue(), + DeprecatedVersion, EncodedMessage.Message) + .highlight(Attr->getRange()); } if (!Attr->Rename.empty()) { diff --git a/lib/Sema/TypeChecker.h b/lib/Sema/TypeChecker.h index 42f14e2bc1d..2a7d9125979 100644 --- a/lib/Sema/TypeChecker.h +++ b/lib/Sema/TypeChecker.h @@ -1757,9 +1757,7 @@ public: void diagnoseDeprecated(SourceRange SourceRange, const DeclContext *ReferenceDC, const AvailableAttr *Attr, - DeclName Name, - std::function extraInfoHandler = - [](InFlightDiagnostic&){}); + DeclName Name); /// @} /// If LangOptions::DebugForbidTypecheckPrefix is set and the given decl diff --git a/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift.gyb b/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift.gyb index fe792521a89..bd9973dcd9f 100644 --- a/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift.gyb +++ b/stdlib/private/StdlibCollectionUnittest/CheckMutableCollectionType.swift.gyb @@ -451,7 +451,7 @@ self.test("\(testNamePrefix)._withUnsafeMutableBufferPointerIfSupported()/semant // sort() //===----------------------------------------------------------------------===// -% for predicate in [ False, True ]: +% for predicate in [False, True]: self.test("\(testNamePrefix).sorted/DispatchesThrough_withUnsafeMutableBufferPointerIfSupported/${'Predicate' if predicate else 'WhereElementIsComparable'}") { let sequence = [ 5, 4, 3, 2, 1 ] @@ -782,7 +782,7 @@ if resiliencyChecks.subscriptOnOutOfBoundsIndicesBehavior != .none { // sort() //===----------------------------------------------------------------------===// -% for predicate in [ False, True ]: +% for predicate in [False, True]: func checkSortInPlace_${'Predicate' if predicate else 'WhereElementIsComparable'}( sequence: [Int], @@ -872,7 +872,7 @@ self.test("\(testNamePrefix).sort/${'Predicate' if predicate else 'WhereElementI // partition() //===----------------------------------------------------------------------===// -% for predicate in [ False, True ]: +% for predicate in [False, True]: func checkPartition_${'Predicate' if predicate else 'WhereElementIsComparable'}( sequence: [Int], diff --git a/stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb b/stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb index 9f9e59cbfb2..0743c0fb3f7 100644 --- a/stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb +++ b/stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb @@ -54,7 +54,7 @@ public struct SourceLocStack { } public init(_ loc: SourceLoc) { - locs = [ loc ] + locs = [loc] } init(_locs: [SourceLoc]) { @@ -563,6 +563,8 @@ extension ProcessTerminationStatus { return false case .signal(let signal): return CInt(signal) == SIGILL || CInt(signal) == SIGTRAP + default: + return false } } } @@ -673,7 +675,7 @@ struct _ParentProcess { } mutating func _spawnChild() { - let params = [ "--stdlib-unittest-run-child" ] + _args + let params = ["--stdlib-unittest-run-child"] + _args let (pid, childStdinFD, childStdoutFD, childStderrFD) = spawnChild(params) _pid = pid _childStdin = _FDOutputStream(fd: childStdinFD) @@ -2226,8 +2228,8 @@ func == (lhs: Pair, rhs: Pair) -> Bool { } func < (lhs: Pair, rhs: Pair) -> Bool { - return [ lhs.first, lhs.second ].lexicographicallyPrecedes( - [ rhs.first, rhs.second ]) + return [lhs.first, lhs.second].lexicographicallyPrecedes( + [rhs.first, rhs.second]) } public func expectEqualsUnordered< @@ -2241,7 +2243,7 @@ public func expectEqualsUnordered< _ expected: Expected, _ actual: Actual, ${TRACE} ) { func comparePairLess(_ lhs: (T, T), rhs: (T, T)) -> Bool { - return [ lhs.0, lhs.1 ].lexicographicallyPrecedes([ rhs.0, rhs.1 ]) + return [lhs.0, lhs.1].lexicographicallyPrecedes([rhs.0, rhs.1]) } let x: [(T, T)] = diff --git a/stdlib/public/Reflection/CMakeLists.txt b/stdlib/public/Reflection/CMakeLists.txt index 162924e1de0..a002c823ac8 100644 --- a/stdlib/public/Reflection/CMakeLists.txt +++ b/stdlib/public/Reflection/CMakeLists.txt @@ -3,4 +3,5 @@ add_swift_library(swiftReflection IS_STDLIB IS_HOST MetadataSource.cpp Remangle.cpp TypeRef.cpp + TypeRefBuilder.cpp INSTALL_IN_COMPONENT dev) diff --git a/stdlib/public/Reflection/TypeRef.cpp b/stdlib/public/Reflection/TypeRef.cpp index 6d642fa91f6..c9aa84a3e9a 100644 --- a/stdlib/public/Reflection/TypeRef.cpp +++ b/stdlib/public/Reflection/TypeRef.cpp @@ -16,8 +16,8 @@ //===----------------------------------------------------------------------===// #include "swift/Basic/Demangle.h" -#include "swift/Reflection/ReflectionContext.h" #include "swift/Reflection/TypeRef.h" +#include "swift/Reflection/TypeRefBuilder.h" using namespace swift; using namespace reflection; @@ -412,3 +412,133 @@ bool NominalTypeTrait::isClass() const { auto Demangled = Demangle::demangleTypeAsNode(MangledName); return ::isClass(Demangled); } + +class TypeRefSubstitution + : public TypeRefVisitor { + TypeRefBuilder &Builder; + GenericArgumentMap Substitutions; +public: + using TypeRefVisitor::visit; + + TypeRefSubstitution(TypeRefBuilder &Builder, GenericArgumentMap Substitutions) + : Builder(Builder), Substitutions(Substitutions) {} + + const TypeRef *visitBuiltinTypeRef(const BuiltinTypeRef *B) { + return B; + } + + const TypeRef *visitNominalTypeRef(const NominalTypeRef *N) { + return N; + } + + const TypeRef *visitBoundGenericTypeRef(const BoundGenericTypeRef *BG) { + std::vector GenericParams; + for (auto Param : BG->getGenericParams()) + GenericParams.push_back(visit(Param)); + return BoundGenericTypeRef::create(Builder, BG->getMangledName(), + GenericParams); + } + + const TypeRef *visitTupleTypeRef(const TupleTypeRef *T) { + std::vector Elements; + for (auto Element : T->getElements()) { + Elements.push_back(visit(Element)); + } + return TupleTypeRef::create(Builder, Elements); + } + + const TypeRef *visitFunctionTypeRef(const FunctionTypeRef *F) { + std::vector SubstitutedArguments; + for (auto Argument : F->getArguments()) + SubstitutedArguments.push_back(visit(Argument)); + + auto SubstitutedResult = visit(F->getResult()); + + return FunctionTypeRef::create(Builder, SubstitutedArguments, + SubstitutedResult); + } + + const TypeRef *visitProtocolTypeRef(const ProtocolTypeRef *P) { + return P; + } + + const TypeRef * + visitProtocolCompositionTypeRef(const ProtocolCompositionTypeRef *PC) { + return PC; + } + + const TypeRef *visitMetatypeTypeRef(const MetatypeTypeRef *M) { + return MetatypeTypeRef::create(Builder, visit(M->getInstanceType())); + } + + const TypeRef * + visitExistentialMetatypeTypeRef(const ExistentialMetatypeTypeRef *EM) { + assert(EM->getInstanceType()->isConcrete()); + return EM; + } + + const TypeRef * + visitGenericTypeParameterTypeRef(const GenericTypeParameterTypeRef *GTP) { + auto found = Substitutions.find({GTP->getDepth(), GTP->getIndex()}); + assert(found != Substitutions.end()); + assert(found->second->isConcrete()); + return found->second; + } + + const TypeRef *visitDependentMemberTypeRef(const DependentMemberTypeRef *DM) { + auto SubstBase = visit(DM->getBase()); + + const TypeRef *TypeWitness; + + switch (SubstBase->getKind()) { + case TypeRefKind::Nominal: { + auto Nominal = cast(SubstBase); + TypeWitness = Builder.getDependentMemberTypeRef(Nominal->getMangledName(), DM); + break; + } + case TypeRefKind::BoundGeneric: { + auto BG = cast(SubstBase); + TypeWitness = Builder.getDependentMemberTypeRef(BG->getMangledName(), DM); + break; + } + default: + assert(false && "Unknown base type"); + } + + assert(TypeWitness); + return TypeWitness->subst(Builder, SubstBase->getSubstMap()); + } + + const TypeRef *visitForeignClassTypeRef(const ForeignClassTypeRef *F) { + return F; + } + + const TypeRef *visitObjCClassTypeRef(const ObjCClassTypeRef *OC) { + return OC; + } + + const TypeRef *visitUnownedStorageTypeRef(const UnownedStorageTypeRef *US) { + return UnownedStorageTypeRef::create(Builder, visit(US->getType())); + } + + const TypeRef *visitWeakStorageTypeRef(const WeakStorageTypeRef *WS) { + return WeakStorageTypeRef::create(Builder, visit(WS->getType())); + } + + const TypeRef * + visitUnmanagedStorageTypeRef(const UnmanagedStorageTypeRef *US) { + return UnmanagedStorageTypeRef::create(Builder, visit(US->getType())); + } + + const TypeRef *visitOpaqueTypeRef(const OpaqueTypeRef *Op) { + return Op; + } +}; + +const TypeRef * +TypeRef::subst(TypeRefBuilder &Builder, GenericArgumentMap Subs) const { + const TypeRef *Result = TypeRefSubstitution(Builder, Subs).visit(this); + assert(Result->isConcrete()); + return Result; +} + diff --git a/stdlib/public/Reflection/TypeRefBuilder.cpp b/stdlib/public/Reflection/TypeRefBuilder.cpp new file mode 100644 index 00000000000..f0d170e7cba --- /dev/null +++ b/stdlib/public/Reflection/TypeRefBuilder.cpp @@ -0,0 +1,204 @@ +//===--- TypeRefBuilder.cpp - Swift Type Reference Builder ----------------===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See http://swift.org/LICENSE.txt for license information +// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// +// +// Implements utilities for constructing TypeRefs and looking up field and +// enum case types. +// +//===----------------------------------------------------------------------===// + +#include "swift/Reflection/TypeRefBuilder.h" + +#include "swift/Basic/Demangle.h" +#include "swift/Reflection/Records.h" +#include "swift/Reflection/TypeRef.h" +#include "swift/Remote/MetadataReader.h" + +using namespace swift; +using namespace reflection; + +const AssociatedTypeDescriptor * TypeRefBuilder:: +lookupAssociatedTypes(const std::string &MangledTypeName, + const DependentMemberTypeRef *DependentMember) { + // Cache missed - we need to look through all of the assocty sections + // for all images that we've been notified about. + for (auto &Info : ReflectionInfos) { + for (const auto &AssocTyDescriptor : Info.assocty) { + std::string ConformingTypeName(AssocTyDescriptor.ConformingTypeName); + if (ConformingTypeName.compare(MangledTypeName) != 0) + continue; + std::string ProtocolMangledName(AssocTyDescriptor.ProtocolTypeName); + auto DemangledProto = Demangle::demangleTypeAsNode(ProtocolMangledName); + auto TR = swift::remote::decodeMangledType(*this, DemangledProto); + + auto &Conformance = *DependentMember->getProtocol(); + if (auto Protocol = dyn_cast(TR)) { + if (*Protocol != Conformance) + continue; + return &AssocTyDescriptor; + } + } + } + return nullptr; +} + +const TypeRef * TypeRefBuilder:: +getDependentMemberTypeRef(const std::string &MangledTypeName, + const DependentMemberTypeRef *DependentMember) { + + if (auto AssocTys = lookupAssociatedTypes(MangledTypeName, DependentMember)) { + for (auto &AssocTy : *AssocTys) { + if (DependentMember->getMember().compare(AssocTy.getName()) != 0) + continue; + + auto SubstitutedTypeName = AssocTy.getMangledSubstitutedTypeName(); + auto Demangled = Demangle::demangleTypeAsNode(SubstitutedTypeName); + return swift::remote::decodeMangledType(*this, Demangled); + } + } + return nullptr; +} + +std::vector> TypeRefBuilder:: +getFieldTypeRefs(const TypeRef *TR) { + std::string MangledName; + if (auto N = dyn_cast(TR)) + MangledName = N->getMangledName(); + else if (auto BG = dyn_cast(TR)) + MangledName = BG->getMangledName(); + else + return {}; + + auto Subs = TR->getSubstMap(); + + std::vector> Fields; + for (auto Info : ReflectionInfos) { + for (auto &FieldDescriptor : Info.fieldmd) { + auto CandidateMangledName = FieldDescriptor.MangledTypeName.get(); + if (!CandidateMangledName) + continue; + if (MangledName.compare(CandidateMangledName) != 0) + continue; + for (auto &Field : FieldDescriptor) { + auto FieldName = Field.getFieldName(); + + // Empty cases of enums do not have a type + if (!Field.hasMangledTypeName()) { + Fields.push_back({FieldName, nullptr}); + continue; + } + + auto Demangled + = Demangle::demangleTypeAsNode(Field.getMangledTypeName()); + auto Unsubstituted = swift::remote::decodeMangledType(*this, Demangled); + if (!Unsubstituted) + return {}; + + auto Substituted = Unsubstituted->subst(*this, Subs); + if (FieldName.empty()) + FieldName = ""; + Fields.push_back({FieldName, Substituted}); + } + } + } + return Fields; +} + +/// +/// Dumping typerefs, field declarations, associated types +/// + +void +TypeRefBuilder::dumpTypeRef(const std::string &MangledName, + std::ostream &OS, bool printTypeName) { + auto TypeName = Demangle::demangleTypeAsString(MangledName); + OS << TypeName << '\n'; + + auto DemangleTree = Demangle::demangleTypeAsNode(MangledName); + auto TR = swift::remote::decodeMangledType(*this, DemangleTree); + if (!TR) { + OS << "!!! Invalid typeref: " << MangledName << '\n'; + return; + } + TR->dump(OS); + OS << '\n'; +} + +void TypeRefBuilder::dumpFieldSection(std::ostream &OS) { + for (const auto §ions : ReflectionInfos) { + for (const auto &descriptor : sections.fieldmd) { + auto TypeName + = Demangle::demangleTypeAsString(descriptor.getMangledTypeName()); + OS << TypeName << '\n'; + for (size_t i = 0; i < TypeName.size(); ++i) + OS << '-'; + OS << '\n'; + for (auto &field : descriptor) { + OS << field.getFieldName(); + if (field.hasMangledTypeName()) { + OS << ": "; + dumpTypeRef(field.getMangledTypeName(), OS); + } else { + OS << "\n\n"; + } + } + } + } +} + +void TypeRefBuilder::dumpAssociatedTypeSection(std::ostream &OS) { + for (const auto §ions : ReflectionInfos) { + for (const auto &descriptor : sections.assocty) { + auto conformingTypeName = Demangle::demangleTypeAsString( + descriptor.getMangledConformingTypeName()); + auto protocolName = Demangle::demangleTypeAsString( + descriptor.getMangledProtocolTypeName()); + + OS << "- " << conformingTypeName << " : " << protocolName; + OS << '\n'; + + for (const auto &associatedType : descriptor) { + OS << "typealias " << associatedType.getName() << " = "; + dumpTypeRef(associatedType.getMangledSubstitutedTypeName(), OS); + } + } + } +} + +void TypeRefBuilder::dumpBuiltinTypeSection(std::ostream &OS) { + for (const auto §ions : ReflectionInfos) { + for (const auto &descriptor : sections.builtin) { + auto typeName = Demangle::demangleTypeAsString( + descriptor.getMangledTypeName()); + + OS << "\n- " << typeName << ":\n"; + OS << "Size: " << descriptor.Size << "\n"; + OS << "Alignment: " << descriptor.Alignment << "\n"; + OS << "Stride: " << descriptor.Stride << "\n"; + OS << "NumExtraInhabitants: " << descriptor.NumExtraInhabitants << "\n"; + } + } +} + +void TypeRefBuilder::dumpAllSections(std::ostream &OS) { + OS << "FIELDS:\n"; + OS << "=======\n"; + dumpFieldSection(OS); + OS << '\n'; + OS << "ASSOCIATED TYPES:\n"; + OS << "=================\n"; + dumpAssociatedTypeSection(OS); + OS << '\n'; + OS << "BUILTIN TYPES:\n"; + OS << "==============\n"; + dumpBuiltinTypeSection(OS); + OS << '\n'; +} diff --git a/stdlib/public/SDK/CoreImage/CoreImage.swift b/stdlib/public/SDK/CoreImage/CoreImage.swift index 183e5c0db5b..ba9543264a8 100644 --- a/stdlib/public/SDK/CoreImage/CoreImage.swift +++ b/stdlib/public/SDK/CoreImage/CoreImage.swift @@ -36,7 +36,7 @@ extension CIFilter { @available(iOS, introduced: 8.0) @available(OSX, introduced: 10.10) convenience init?( - name: String!, elements: (String, AnyObject)... + name: String, elements: (String, AnyObject)... ) { var dict: [String : AnyObject] = [:] for (key, value) in elements { @@ -49,16 +49,16 @@ extension CIFilter { #if os(OSX) extension CISampler { // - (id)initWithImage:(CIImage *)im keysAndValues:key0, ...; - convenience init(im: CIImage!, elements: (NSCopying, AnyObject)...) { - let dict = NSMutableDictionary() + convenience init(im: CIImage, elements: (String, AnyObject)...) { + var dict: [String : AnyObject] = [:] for (key, value) in elements { dict[key] = value } // @objc(initWithImage:options:) - // init(image im: CIImage!, - // options dict: NSDictionary!) - self.init(image: im, options: dict as [NSObject: AnyObject]) + // init(image im: CIImage, + // options dict: NSDictionary?) + self.init(image: im, options: dict) } } #endif diff --git a/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift b/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift index 1c3ff3443ce..9e089df2442 100644 --- a/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift +++ b/stdlib/public/SwiftOnoneSupport/SwiftOnoneSupport.swift @@ -21,7 +21,7 @@ struct _Prespecialize { static internal func _specializeArrays() { func _createArrayUser(_ sampleValue: Element) { // Initializers. - let _: [Element] = [ sampleValue ] + let _: [Element] = [sampleValue] var a = [Element](repeating: sampleValue, count: 1) // Read array element @@ -70,7 +70,7 @@ struct _Prespecialize { func _createArrayUserWithoutSorting(_ sampleValue: Element) { // Initializers. - let _: [Element] = [ sampleValue ] + let _: [Element] = [sampleValue] var a = [Element](repeating: sampleValue, count: 1) // Read array element diff --git a/stdlib/public/core/ArrayBuffer.swift b/stdlib/public/core/ArrayBuffer.swift index 9d55ebc97ab..ee664fdc9a4 100644 --- a/stdlib/public/core/ArrayBuffer.swift +++ b/stdlib/public/core/ArrayBuffer.swift @@ -133,7 +133,7 @@ extension _ArrayBuffer { /// Otherwise, returns `nil`. @warn_unused_result public mutating func requestUniqueMutableBackingBuffer(minimumCapacity: Int) - -> NativeBuffer? { + -> NativeBuffer? { if _fastPath(isUniquelyReferenced()) { let b = _native if _fastPath(b.capacity >= minimumCapacity) { diff --git a/stdlib/public/core/Collection.swift b/stdlib/public/core/Collection.swift index 525d6a153a0..147b40802d5 100644 --- a/stdlib/public/core/Collection.swift +++ b/stdlib/public/core/Collection.swift @@ -978,7 +978,7 @@ extension Collection { } } -@available(*, unavailable, message: "Bit enum has been deprecated. Please use Int instead.") +@available(*, unavailable, message: "Bit enum has been removed. Please use Int instead.") public enum Bit {} @available(*, unavailable, renamed: "IndexingIterator") diff --git a/stdlib/public/core/CollectionAlgorithms.swift.gyb b/stdlib/public/core/CollectionAlgorithms.swift.gyb index 3063bfdbca9..9a5a89b2e1f 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift.gyb +++ b/stdlib/public/core/CollectionAlgorithms.swift.gyb @@ -108,7 +108,7 @@ orderingRequirementForComparable = """\ % # Generate two versions: with explicit predicates and with % # a Comparable requirement. -% for preds in [ True, False ]: +% for preds in [True, False]: % if preds: diff --git a/stdlib/public/core/FixedPoint.swift.gyb b/stdlib/public/core/FixedPoint.swift.gyb index db82e9b72e7..1f805b6a47b 100644 --- a/stdlib/public/core/FixedPoint.swift.gyb +++ b/stdlib/public/core/FixedPoint.swift.gyb @@ -607,17 +607,15 @@ extension ${Self} { // Prefix and postfix increment and decrement. -// FIXME: After is fixed, we should be able -// to remove these. @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public prefix func ++ (x: inout ${Self}) -> ${Self} { x = x + 1 return x } @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public postfix func ++ (x: inout ${Self}) -> ${Self} { let ret = x x = x + 1 @@ -625,14 +623,14 @@ public postfix func ++ (x: inout ${Self}) -> ${Self} { } @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public prefix func -- (x: inout ${Self}) -> ${Self} { x = x - 1 return x } @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public postfix func -- (x: inout ${Self}) -> ${Self} { let ret = x x = x - 1 diff --git a/stdlib/public/core/FloatingPoint.swift.gyb b/stdlib/public/core/FloatingPoint.swift.gyb index be20ac88377..5f87ccf7266 100644 --- a/stdlib/public/core/FloatingPoint.swift.gyb +++ b/stdlib/public/core/FloatingPoint.swift.gyb @@ -564,16 +564,16 @@ extension ${Self} { //===----------------------------------------------------------------------===// @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public prefix func ++ (rhs: inout ${Self}) -> ${Self} { rhs += 1.0; return rhs } @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public prefix func -- (rhs: inout ${Self}) -> ${Self} { rhs -= 1.0; return rhs } @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public postfix func ++ (lhs: inout ${Self}) -> ${Self} { let tmp = lhs; lhs += 1.0; return tmp } @_transparent -@available(*, deprecated, message: "it will be removed in Swift 3") +@available(*, unavailable, message: "it has been removed in Swift 3") public postfix func -- (lhs: inout ${Self}) -> ${Self} { let tmp = lhs; lhs -= 1.0; return tmp } diff --git a/stdlib/public/core/Runtime.swift.gyb b/stdlib/public/core/Runtime.swift.gyb index 15cae6719cd..1803cdc2b5c 100644 --- a/stdlib/public/core/Runtime.swift.gyb +++ b/stdlib/public/core/Runtime.swift.gyb @@ -476,8 +476,12 @@ func _uint64ToString( @warn_unused_result func _rawPointerToString(_ value: Builtin.RawPointer) -> String { var result = _uint64ToString( - UInt64(unsafeBitCast(value, to: UInt.self)), radix: 16, uppercase: false) - for _ in 0..<(2 * sizeof(Builtin.RawPointer) - result.utf16.count) { + UInt64( + UInt(bitPattern: UnsafePointer(value))), + radix: 16, + uppercase: false + ) + for _ in 0..<(2 * sizeof(UnsafePointer) - result.utf16.count) { result = "0" + result } return "0x" + result diff --git a/stdlib/public/core/SequenceAlgorithms.swift.gyb b/stdlib/public/core/SequenceAlgorithms.swift.gyb index a376320656f..1dd814e4613 100644 --- a/stdlib/public/core/SequenceAlgorithms.swift.gyb +++ b/stdlib/public/core/SequenceAlgorithms.swift.gyb @@ -46,7 +46,7 @@ extension Sequence { % # Generate two versions: with explicit predicates and with % # a Comparable requirement. -% for preds in [ True, False ]: +% for preds in [True, False]: %{ if preds: @@ -116,7 +116,7 @@ extension Sequence ${"" if preds else "where Iterator.Element : Comparable"} { % # Generate two versions: with explicit predicates and with % # an Equatable requirement. -% for preds in [ True, False ]: +% for preds in [True, False]: extension Sequence ${"" if preds else "where Iterator.Element : Equatable"} { @@ -170,7 +170,7 @@ else: % # Generate two versions: with explicit predicates and with % # an Equatable requirement. -% for preds in [ True, False ]: +% for preds in [True, False]: extension Sequence ${"" if preds else "where Iterator.Element : Equatable"} { @@ -226,7 +226,7 @@ else: % # Generate two versions: with explicit predicates and with % # Comparable requirement. -% for preds in [ True, False ]: +% for preds in [True, False]: extension Sequence ${"" if preds else "where Iterator.Element : Comparable"} { diff --git a/stdlib/public/core/StaticString.swift b/stdlib/public/core/StaticString.swift index 119b9f67969..87a42129e05 100644 --- a/stdlib/public/core/StaticString.swift +++ b/stdlib/public/core/StaticString.swift @@ -39,6 +39,9 @@ public struct StaticString CustomDebugStringConvertible, CustomReflectable { + // FIXME(ABI): RawPointer is non-nullable, but we can store a null Unicode + // scalar in it. Change it to an integer. + // /// Either a pointer to the start of UTF-8 data, or an integer representation /// of a single Unicode scalar. internal var _startPtrOrData: Builtin.RawPointer @@ -76,7 +79,9 @@ public struct StaticString _precondition( !hasPointerRepresentation, "StaticString should have Unicode scalar representation") - return UnicodeScalar(UInt32(unsafeBitCast(_startPtrOrData, to: UInt.self))) + return UnicodeScalar( + UInt32(UInt(bitPattern: UnsafePointer(_startPtrOrData))) + ) } /// If `self` stores a pointer to ASCII or UTF-8 code units, the diff --git a/stdlib/public/core/UnsafePointer.swift.gyb b/stdlib/public/core/UnsafePointer.swift.gyb index 1c5e9e11aff..3b14d3255cb 100644 --- a/stdlib/public/core/UnsafePointer.swift.gyb +++ b/stdlib/public/core/UnsafePointer.swift.gyb @@ -577,6 +577,28 @@ extension ${Self} { fatalError("unavailable function can't be called") } } + +extension Int { + @warn_unused_result + public init(bitPattern: ${Self}?) { + if let bitPattern = bitPattern { + self = Int(Builtin.ptrtoint_Word(bitPattern._rawValue)) + } else { + self = 0 + } + } +} + +extension UInt { + @warn_unused_result + public init(bitPattern: ${Self}?) { + if let bitPattern = bitPattern { + self = UInt(Builtin.ptrtoint_Word(bitPattern._rawValue)) + } else { + self = 0 + } + } +} % end # for mutable /// A byte-sized thing that isn't designed to interoperate with diff --git a/test/1_stdlib/ArrayTrapsObjC.swift.gyb b/test/1_stdlib/ArrayTrapsObjC.swift.gyb index 4ef688ee50c..b89dcbd2560 100644 --- a/test/1_stdlib/ArrayTrapsObjC.swift.gyb +++ b/test/1_stdlib/ArrayTrapsObjC.swift.gyb @@ -37,7 +37,7 @@ ArrayTraps.test("downcast2") { _isFastAssertConfiguration() }, reason: "this trap is not guaranteed to happen in -Ounchecked")) .code { - let a: [AnyObject] = [ "String", 1 ] + let a: [AnyObject] = ["String", 1] let sa = a as! [NSString] let s0 = sa[0] expectCrashLater() diff --git a/test/1_stdlib/DictionaryLiteral.swift b/test/1_stdlib/DictionaryLiteral.swift index 948e1799b7f..27a15206cc6 100644 --- a/test/1_stdlib/DictionaryLiteral.swift +++ b/test/1_stdlib/DictionaryLiteral.swift @@ -37,7 +37,7 @@ expectType(DictionaryLiteral.self, &stringNSStringLiteral) let aString = "1" let anNSString = "Foo" as NSString -var stringNSStringLet: DictionaryLiteral = [ "a": aString, "b": anNSString] +var stringNSStringLet: DictionaryLiteral = ["a": aString, "b": anNSString] expectType(DictionaryLiteral.self, &stringNSStringLet) var hetero1: DictionaryLiteral = ["a": 1, "b": "Foo" as NSString] diff --git a/test/1_stdlib/Float.swift b/test/1_stdlib/Float.swift index 36edfb56c21..2fd2b5d0ad5 100644 --- a/test/1_stdlib/Float.swift +++ b/test/1_stdlib/Float.swift @@ -129,7 +129,7 @@ func testSubnormal() { _preconditionFailure("unhandled float kind") } var positiveSubnormal: TestFloat = 1.0 - for var i = 0; i < iterations; i += 1 { + for i in 0 ..< iterations { positiveSubnormal /= 2.0 as TestFloat } checkSubnormal(positiveSubnormal) @@ -138,7 +138,7 @@ func testSubnormal() { _precondition(positiveSubnormal != 0.0) var negativeSubnormal: TestFloat = -1.0 - for var i = 0; i < iterations; i += 1{ + for i in 0 ..< iterations { negativeSubnormal /= 2.0 as TestFloat } checkSubnormal(negativeSubnormal) diff --git a/test/1_stdlib/HeapBuffer.swift b/test/1_stdlib/HeapBuffer.swift index 1e4c2af4f44..c77448859aa 100644 --- a/test/1_stdlib/HeapBuffer.swift +++ b/test/1_stdlib/HeapBuffer.swift @@ -30,7 +30,7 @@ func testUnique() { print("buffer is unique: \(a.isUniquelyReferenced())") // CHECK-NEXT: buffer is unique: true - var addRef = [ a ] + var addRef = [a] print("copied buffer is unique: \(a.isUniquelyReferenced())") // CHECK-NEXT: copied buffer is unique: false } diff --git a/test/1_stdlib/Mirror.swift b/test/1_stdlib/Mirror.swift index 57bbaa8d131..d714273a929 100644 --- a/test/1_stdlib/Mirror.swift +++ b/test/1_stdlib/Mirror.swift @@ -236,7 +236,7 @@ mirrors.test("Class/Root/superclass:.generated") { var b: String = "two" var customMirror: Mirror { return Mirror( - self, children: [ "bee": b ], ancestorRepresentation: .generated) + self, children: ["bee": b], ancestorRepresentation: .generated) } } @@ -253,7 +253,7 @@ mirrors.test("class/Root/superclass:") { class C : CustomReflectable { var c: UInt = 3 var customMirror: Mirror { - return Mirror(self, children: [ "sea": c + 1 ]) + return Mirror(self, children: ["sea": c + 1]) } } @@ -292,7 +292,7 @@ mirrors.test("class/UncustomizedSuper/Synthesized/Implicit") { class B : A, CustomReflectable { var b: UInt = 42 var customMirror: Mirror { - return Mirror(self, children: [ "bee": b ]) + return Mirror(self, children: ["bee": b]) } } @@ -312,7 +312,7 @@ mirrors.test("class/UncustomizedSuper/Synthesized/Explicit") { var b: UInt = 42 var customMirror: Mirror { return Mirror( - self, children: [ "bee": b ], ancestorRepresentation: .generated) + self, children: ["bee": b], ancestorRepresentation: .generated) } } @@ -329,7 +329,7 @@ mirrors.test("class/CustomizedSuper/Synthesized") { class A : CustomReflectable { var a: Int = 1 var customMirror: Mirror { - return Mirror(self, children: [ "aye": a ]) + return Mirror(self, children: ["aye": a]) } } @@ -341,7 +341,7 @@ mirrors.test("class/CustomizedSuper/Synthesized") { // rare cases, ancestorRepresentation: .Suppressed. However, it // has an expected behavior, which we test here. override var customMirror: Mirror { - return Mirror(self, children: [ "bee": b ]) + return Mirror(self, children: ["bee": b]) } } @@ -387,7 +387,7 @@ mirrors.test("class/ObjCUncustomizedSuper/Synthesized/Implicit") { class B : A, CustomReflectable { var b: UInt = 42 var customMirror: Mirror { - return Mirror(self, children: [ "bee": b ]) + return Mirror(self, children: ["bee": b]) } } @@ -409,7 +409,7 @@ mirrors.test("class/ObjCUncustomizedSuper/Synthesized/Explicit") { var b: UInt = 42 var customMirror: Mirror { return Mirror( - self, children: [ "bee": b ], ancestorRepresentation: .generated) + self, children: ["bee": b], ancestorRepresentation: .generated) } } @@ -428,7 +428,7 @@ mirrors.test("class/ObjCCustomizedSuper/Synthesized") { class A : NSDateFormatter, CustomReflectable { var a: Int = 1 var customMirror: Mirror { - return Mirror(self, children: [ "aye": a ]) + return Mirror(self, children: ["aye": a]) } } @@ -440,7 +440,7 @@ mirrors.test("class/ObjCCustomizedSuper/Synthesized") { // rare cases, ancestorRepresentation: .Suppressed. However, it // has an expected behavior, which we test here. override var customMirror: Mirror { - return Mirror(self, children: [ "bee": b ]) + return Mirror(self, children: ["bee": b]) } } @@ -468,7 +468,7 @@ mirrors.test("Class/Root/NoSuperclassMirror") { var b: String = "two" var customMirror: Mirror { return Mirror( - self, children: [ "bee": b ], ancestorRepresentation: .suppressed) + self, children: ["bee": b], ancestorRepresentation: .suppressed) } } @@ -486,7 +486,7 @@ mirrors.test("class/UncustomizedSuper/NoSuperclassMirror") { var b: UInt = 42 var customMirror: Mirror { return Mirror( - self, children: [ "bee": b ], ancestorRepresentation: .suppressed) + self, children: ["bee": b], ancestorRepresentation: .suppressed) } } @@ -499,7 +499,7 @@ mirrors.test("class/CustomizedSuper/NoSuperclassMirror") { class A : CustomReflectable { var a: Int = 1 var customMirror: Mirror { - return Mirror(self, children: [ "aye": a ]) + return Mirror(self, children: ["aye": a]) } } @@ -507,7 +507,7 @@ mirrors.test("class/CustomizedSuper/NoSuperclassMirror") { var b: UInt = 42 override var customMirror: Mirror { return Mirror( - self, children: [ "bee": b ], ancestorRepresentation: .suppressed) + self, children: ["bee": b], ancestorRepresentation: .suppressed) } } @@ -521,7 +521,7 @@ mirrors.test("class/CustomizedSuper/SuperclassCustomMirror/Direct") { class A : CustomReflectable { var a: Int = 1 var customMirror: Mirror { - return Mirror(self, children: [ "aye": a ]) + return Mirror(self, children: ["aye": a]) } } @@ -531,7 +531,7 @@ mirrors.test("class/CustomizedSuper/SuperclassCustomMirror/Direct") { override var customMirror: Mirror { return Mirror( self, - children: [ "bee": b ], + children: ["bee": b], ancestorRepresentation: .customized({ super.customMirror })) } } @@ -549,7 +549,7 @@ mirrors.test("class/CustomizedSuper/SuperclassCustomMirror/Indirect") { class A : CustomReflectable { var a: Int = 1 var customMirror: Mirror { - return Mirror(self, children: [ "aye": a ]) + return Mirror(self, children: ["aye": a]) } } @@ -563,7 +563,7 @@ mirrors.test("class/CustomizedSuper/SuperclassCustomMirror/Indirect") { override var customMirror: Mirror { return Mirror( self, - children: [ "bee": b ], + children: ["bee": b], ancestorRepresentation: .customized({ super.customMirror })) } } @@ -590,7 +590,7 @@ mirrors.test("class/CustomizedSuper/SuperclassCustomMirror/Indirect2") { var a: Int = 1 var customMirror: Mirror { return Mirror( - self, children: [ "aye": a ]) + self, children: ["aye": a]) } } @@ -604,7 +604,7 @@ mirrors.test("class/CustomizedSuper/SuperclassCustomMirror/Indirect2") { override var customMirror: Mirror { return Mirror( self, - children: [ "bee": b ], + children: ["bee": b], ancestorRepresentation: .customized({ super.customMirror })) } } @@ -624,7 +624,7 @@ mirrors.test("class/Cluster") { var a: Int = 1 var customMirror: Mirror { return Mirror( - self, children: [ "aye": a ]) + self, children: ["aye": a]) } } diff --git a/test/1_stdlib/NSStringAPI.swift b/test/1_stdlib/NSStringAPI.swift index 9d2a95492c5..c1f1350ea3e 100644 --- a/test/1_stdlib/NSStringAPI.swift +++ b/test/1_stdlib/NSStringAPI.swift @@ -386,13 +386,13 @@ NSStringAPIs.test("completePath(into:caseSensitive:matchesInto:filterTypes)") { do { var outputName = "None Found" - var outputArray: [String] = [ "foo", "bar" ] + var outputArray: [String] = ["foo", "bar"] var count = nonExistentPath.completePath( into: &outputName, caseSensitive: false, matchesInto: &outputArray) expectEqual(0, count) expectEqual("None Found", outputName) - expectEqual([ "foo", "bar" ], outputArray) + expectEqual(["foo", "bar"], outputArray) } do { @@ -411,19 +411,19 @@ NSStringAPIs.test("completePath(into:caseSensitive:matchesInto:filterTypes)") { do { var outputName = "None Found" - var outputArray: [String] = [ "foo", "bar" ] + var outputArray: [String] = ["foo", "bar"] var count = existingPath.completePath( into: &outputName, caseSensitive: false, matchesInto: &outputArray) expectEqual(1, count) expectEqual(existingPath, outputName) - expectEqual([ existingPath ], outputArray) + expectEqual([existingPath], outputArray) } do { var outputName = "None Found" var count = existingPath.completePath( - into: &outputName, caseSensitive: false, filterTypes: [ "txt" ]) + into: &outputName, caseSensitive: false, filterTypes: ["txt"]) expectEqual(1, count) expectEqual(existingPath, outputName) @@ -431,37 +431,37 @@ NSStringAPIs.test("completePath(into:caseSensitive:matchesInto:filterTypes)") { } NSStringAPIs.test("components(separatedBy:) (NSCharacterSet)") { - expectEqual([ "" ], "".components( + expectEqual([""], "".components( separatedBy: NSCharacterSet.decimalDigits())) expectEqual( - [ "абв", "", "あいう", "abc" ], + ["абв", "", "あいう", "abc"], "абв12あいう3abc".components( separatedBy: NSCharacterSet.decimalDigits())) expectEqual( - [ "абв", "", "あいう", "abc" ], + ["абв", "", "あいう", "abc"], "абв\u{1F601}\u{1F602}あいう\u{1F603}abc" .components( separatedBy: NSCharacterSet(charactersIn: "\u{1F601}\u{1F602}\u{1F603}"))) // Performs Unicode scalar comparison. expectEqual( - [ "abcし\u{3099}def" ], + ["abcし\u{3099}def"], "abcし\u{3099}def".components( separatedBy: NSCharacterSet(charactersIn: "\u{3058}"))) } NSStringAPIs.test("components(separatedBy:) (String)") { - expectEqual([ "" ], "".components(separatedBy: "//")) + expectEqual([""], "".components(separatedBy: "//")) expectEqual( - [ "абв", "あいう", "abc" ], + ["абв", "あいう", "abc"], "абв//あいう//abc".components(separatedBy: "//")) // Performs normalization. expectEqual( - [ "abc", "def" ], + ["abc", "def"], "abcし\u{3099}def".components(separatedBy: "\u{3058}")) } @@ -521,7 +521,7 @@ NSStringAPIs.test("enumerateLines(_:)") { stop = true } } - expectEqual([ "abc", "", "defghi" ], lines) + expectEqual(["abc", "", "defghi"], lines) } NSStringAPIs.test("enumerateLinguisticTagsIn(_:scheme:options:orthography:_:") { @@ -545,12 +545,11 @@ NSStringAPIs.test("enumerateLinguisticTagsIn(_:scheme:options:orthography:_:") { } } expectEqual( - [ NSLinguisticTagWord, NSLinguisticTagWhitespace, - NSLinguisticTagWord ], - tags) - expectEqual([ "Глокая", " ", "куздра" ], tokens) + [NSLinguisticTagWord, NSLinguisticTagWhitespace, NSLinguisticTagWord], + tags) + expectEqual(["Глокая", " ", "куздра"], tokens) let sentence = s[startIndex..) } @@ -1650,8 +1648,8 @@ NSStringAPIs.test("trimmingCharacters(in:)") { NSStringAPIs.test("NSString.stringsByAppendingPaths(_:)") { expectEqual([], "".strings(byAppendingPaths: [])) expectEqual( - [ "/tmp/foo", "/tmp/bar" ], - "/tmp".strings(byAppendingPaths: [ "foo", "bar" ])) + ["/tmp/foo", "/tmp/bar"], + "/tmp".strings(byAppendingPaths: ["foo", "bar"])) } NSStringAPIs.test("substring(from:)") { diff --git a/test/1_stdlib/PrintArray.swift b/test/1_stdlib/PrintArray.swift index 799ebee58cd..0f99edbc9cf 100644 --- a/test/1_stdlib/PrintArray.swift +++ b/test/1_stdlib/PrintArray.swift @@ -16,22 +16,22 @@ PrintTests.test("Printable") { expectPrinted("[1, 2]", [ 1, 2 ]) expectPrinted("[1, 2, 3]", [ 1, 2, 3 ]) - expectPrinted("[\"foo\", \"bar\", \"bas\"]", [ "foo", "bar", "bas" ]) - expectDebugPrinted("[\"foo\", \"bar\", \"bas\"]", [ "foo", "bar", "bas" ]) + expectPrinted("[\"foo\", \"bar\", \"bas\"]", ["foo", "bar", "bas"]) + expectDebugPrinted("[\"foo\", \"bar\", \"bas\"]", ["foo", "bar", "bas"]) - expectPrinted("[►1◀︎, ►2◀︎, ►3◀︎]", [ StructPrintable(1), - StructPrintable(2), StructPrintable(3) ]) + expectPrinted("[►1◀︎, ►2◀︎, ►3◀︎]", [StructPrintable(1), + StructPrintable(2), StructPrintable(3)]) expectPrinted("[<10 20 30 40>, <50 60 70 80>]", - [ LargeStructPrintable(10, 20, 30, 40), LargeStructPrintable(50, 60, 70, 80) ]) + [LargeStructPrintable(10, 20, 30, 40), LargeStructPrintable(50, 60, 70, 80)]) - expectPrinted("[►1◀︎]", [ StructDebugPrintable(1) ]) + expectPrinted("[►1◀︎]", [StructDebugPrintable(1)]) - expectPrinted("[►1◀︎, ►2◀︎, ►3◀︎]", [ ClassPrintable(1), - ClassPrintable(2), ClassPrintable(3) ]) + expectPrinted("[►1◀︎, ►2◀︎, ►3◀︎]", [ClassPrintable(1), + ClassPrintable(2), ClassPrintable(3)]) - expectPrinted("[►1◀︎, ►2◀︎, ►3◀︎]", [ ClassPrintable(1), - ClassPrintable(2), ClassPrintable(3) ] as Array) + expectPrinted("[►1◀︎, ►2◀︎, ►3◀︎]", [ClassPrintable(1), + ClassPrintable(2), ClassPrintable(3)] as Array) } runAllTests() diff --git a/test/1_stdlib/PrintClass.swift b/test/1_stdlib/PrintClass.swift index cc7876515d6..4da3b3f28e7 100644 --- a/test/1_stdlib/PrintClass.swift +++ b/test/1_stdlib/PrintClass.swift @@ -24,8 +24,8 @@ PrintTests.test("ClassPrintable") { let classMetatype = ClassPrintable.self expectPrinted("ClassPrintable", classMetatype) expectDebugPrinted("PrintTestTypes.ClassPrintable", classMetatype) - expectPrinted("[PrintTestTypes.ClassPrintable]", [ classMetatype ]) - expectDebugPrinted("[PrintTestTypes.ClassPrintable]", [ classMetatype ]) + expectPrinted("[PrintTestTypes.ClassPrintable]", [classMetatype]) + expectDebugPrinted("[PrintTestTypes.ClassPrintable]", [classMetatype]) } PrintTests.test("ClassVeryPrintable") { diff --git a/test/1_stdlib/PrintDictionary.swift b/test/1_stdlib/PrintDictionary.swift index 44085136219..e03e72cfdb9 100644 --- a/test/1_stdlib/PrintDictionary.swift +++ b/test/1_stdlib/PrintDictionary.swift @@ -10,16 +10,16 @@ PrintTests.test("Printable") { expectPrinted("[:]", [String: Int]()) expectDebugPrinted("[:]", [String: Int]()) - expectPrinted("[\"aaa\": 1]", [ "aaa": 1 ]) - expectDebugPrinted("[\"aaa\": 1]", [ "aaa": 1 ]) + expectPrinted("[\"aaa\": 1]", ["aaa": 1]) + expectDebugPrinted("[\"aaa\": 1]", ["aaa": 1]) - let d0 = [ "aaa": 1, "bbb": 2 ] - expectPrinted(expectedOneOf: [ "[\"aaa\": 1, \"bbb\": 2]", - "[\"bbb\": 2, \"aaa\": 1]" ], d0) - expectDebugPrinted(expectedOneOf: [ "[\"aaa\": 1, \"bbb\": 2]", - "[\"bbb\": 2, \"aaa\": 1]" ], d0) + let d0 = ["aaa": 1, "bbb": 2] + expectPrinted(expectedOneOf: ["[\"aaa\": 1, \"bbb\": 2]", + "[\"bbb\": 2, \"aaa\": 1]"], d0) + expectDebugPrinted(expectedOneOf: ["[\"aaa\": 1, \"bbb\": 2]", + "[\"bbb\": 2, \"aaa\": 1]"], d0) - let d1 = [ "aaa": "bbb" ] + let d1 = ["aaa": "bbb"] expectPrinted("[\"aaa\": \"bbb\"]", d1) expectDebugPrinted("[\"aaa\": \"bbb\"]", d1) } diff --git a/test/1_stdlib/PrintSet.swift b/test/1_stdlib/PrintSet.swift index f917be95242..c381260faa5 100644 --- a/test/1_stdlib/PrintSet.swift +++ b/test/1_stdlib/PrintSet.swift @@ -10,15 +10,15 @@ PrintTests.test("Printable") { expectDebugPrinted("Set([])", Set()) let s0 = Set([11, 22]) - expectPrinted(expectedOneOf: [ "[11, 22]", "[22, 11]" ], s0) - expectDebugPrinted(expectedOneOf: [ "Set([11, 22])", - "Set([22, 11])" ], s0) + expectPrinted(expectedOneOf: ["[11, 22]", "[22, 11]"], s0) + expectDebugPrinted(expectedOneOf: ["Set([11, 22])", + "Set([22, 11])"], s0) let s1 = Set(["Hello", "world"]) - expectPrinted(expectedOneOf: [ "[\"Hello\", \"world\"]", - "[\"world\", \"Hello\"]" ], s1) - expectDebugPrinted(expectedOneOf: [ "Set([\"Hello\", \"world\"])", - "Set([\"world\", \"Hello\"])" ], s1) + expectPrinted(expectedOneOf: ["[\"Hello\", \"world\"]", + "[\"world\", \"Hello\"]"], s1) + expectDebugPrinted(expectedOneOf: ["Set([\"Hello\", \"world\"])", + "Set([\"world\", \"Hello\"])"], s1) } runAllTests() diff --git a/test/1_stdlib/PrintStruct.swift b/test/1_stdlib/PrintStruct.swift index a91fb276a9e..6ed63845701 100644 --- a/test/1_stdlib/PrintStruct.swift +++ b/test/1_stdlib/PrintStruct.swift @@ -53,9 +53,9 @@ func test_ThickMetatypePrintingImpl( _ expectedDebug: String ) { expectPrinted(expectedPrint, thickMetatype) - expectPrinted("[\(expectedDebug)]", [ thickMetatype ]) + expectPrinted("[\(expectedDebug)]", [thickMetatype]) expectDebugPrinted(expectedDebug, thickMetatype) - expectDebugPrinted("[\(expectedDebug)]", [ thickMetatype ]) + expectDebugPrinted("[\(expectedDebug)]", [thickMetatype]) } PrintTests.test("StructPrintable") { @@ -72,8 +72,8 @@ PrintTests.test("StructPrintable") { let structMetatype = StructPrintable.self expectPrinted("StructPrintable", structMetatype) expectDebugPrinted("PrintTestTypes.StructPrintable", structMetatype) - expectPrinted("[PrintTestTypes.StructPrintable]", [ structMetatype ]) - expectDebugPrinted("[PrintTestTypes.StructPrintable]", [ structMetatype ]) + expectPrinted("[PrintTestTypes.StructPrintable]", [structMetatype]) + expectDebugPrinted("[PrintTestTypes.StructPrintable]", [structMetatype]) test_ThickMetatypePrintingImpl(structMetatype, "StructPrintable", "PrintTestTypes.StructPrintable") } diff --git a/test/1_stdlib/ReflectionHashing.swift b/test/1_stdlib/ReflectionHashing.swift index 38d0903d5fa..6994e9f2ad1 100644 --- a/test/1_stdlib/ReflectionHashing.swift +++ b/test/1_stdlib/ReflectionHashing.swift @@ -26,7 +26,7 @@ Reflection.test("Dictionary/Empty") { } Reflection.test("Dictionary") { - let dict = [ "One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5 ] + let dict = ["One": 1, "Two": 2, "Three": 3, "Four": 4, "Five": 5] var output = "" dump(dict, to: &output) diff --git a/test/1_stdlib/Runtime.swift b/test/1_stdlib/Runtime.swift index ac9dc6b4334..4365ded7f89 100644 --- a/test/1_stdlib/Runtime.swift +++ b/test/1_stdlib/Runtime.swift @@ -144,7 +144,7 @@ class ClassConformsToP1 : Boolean, Q1 { class Class2ConformsToP1 : Boolean, Q1 { init(_ value: T) { - self.value = [ value ] + self.value = [value] } var boolValue: Bool { return value[0].boolValue @@ -549,7 +549,7 @@ Reflection.test("Struct/Generic/DefaultMirror") { do { var value = GenericStructWithDefaultMirror( first: 123, - second: [ "abc", 456, 789.25 ]) + second: ["abc", 456, 789.25]) var output = "" dump(value, to: &output) diff --git a/test/1_stdlib/SpriteKit.swift b/test/1_stdlib/SpriteKit.swift index e3c4073286f..9e279de38d2 100644 --- a/test/1_stdlib/SpriteKit.swift +++ b/test/1_stdlib/SpriteKit.swift @@ -10,12 +10,12 @@ import Foundation import SpriteKit // Check that the subscript is there. -@available(OSX,introduced=10.10) -@available(iOS,introduced=8.0) -@available(tvOS,introduced=8.0) -@available(watchOS,introduced=2.0) +@available(OSX,introduced: 10.10) +@available(iOS,introduced: 8.0) +@available(tvOS,introduced: 8.0) +@available(watchOS,introduced: 2.0) func testSubscript(_ node: SKNode) { - var nodes: [SKNode] = node["me"] + var _: [SKNode] = node["me"] } // SKColor is NSColor on OS X and UIColor on iOS. diff --git a/test/1_stdlib/UnsafePointer.swift.gyb b/test/1_stdlib/UnsafePointer.swift.gyb index d7693af4657..e9052cfca9d 100644 --- a/test/1_stdlib/UnsafePointer.swift.gyb +++ b/test/1_stdlib/UnsafePointer.swift.gyb @@ -151,6 +151,29 @@ ${SelfName}TestSuite.test("Hashable") { } } +% if SelfName != 'OpaquePointer': +${SelfName}TestSuite.test("toInteger") { + do { + let word: Int = 0x12345678 + let ptr = ${SelfType}(bitPattern: word) + expectEqual(word, Int(bitPattern: ptr)) + } + do { + let ptr: ${SelfType}? = nil + expectEqual(Int(0), Int(bitPattern: ptr)) + } + do { + let uword: UInt = 0x12345678 + let ptr = ${SelfType}(bitPattern: uword) + expectEqual(uword, UInt(bitPattern: ptr)) + } + do { + let ptr: ${SelfType}? = nil + expectEqual(UInt(0), UInt(bitPattern: ptr)) + } +} +% end + % end enum Check { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4477d146be5..f5b2e57a44b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -117,53 +117,109 @@ if(PYTHONINTERP_FOUND) set(SWIFT_ASAN_BUILD TRUE) endif() - set(TEST_MODES optimize_none optimize optimize_unchecked executable non_executable) + # Normalize spelling of boolean values. + normalize_boolean_spelling(LLVM_ENABLE_ASSERTIONS) + normalize_boolean_spelling(SWIFT_STDLIB_ASSERTIONS) + normalize_boolean_spelling(SWIFT_AST_VERIFIER) + normalize_boolean_spelling(SWIFT_ASAN_BUILD) + is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" SWIFT_OPTIMIZED) + + if(SWIFT_ANALYZE_CODE_COVERAGE STREQUAL "MERGED") + set(profdata_merge_worker + "${CMAKE_CURRENT_SOURCE_DIR}/../utils/profdata_merge/main.py") + set(command_profdata_merge_start + COMMAND "${PYTHON_EXECUTABLE}" "${profdata_merge_worker}" + -l "${swift_test_results_dir}/profdata_merge.log" + start + -o "${swift_test_results_dir}") + set(command_profdata_merge_stop + COMMAND "${PYTHON_EXECUTABLE}" "${profdata_merge_worker}" stop) + else() + set(command_profdata_merge_start) + set(command_profdata_merge_stop) + endif() + + set(TEST_MODES + optimize_none optimize optimize_unchecked + only_executable only_non_executable + ) + set(TEST_SUBSETS + primary + validation + all + only_validation + only_long + ) foreach(SDK ${SWIFT_SDKS}) foreach(ARCH ${SWIFT_SDK_${SDK}_ARCHITECTURES}) - foreach(TEST_MODE ${TEST_MODES}) - # Configure variables for this subdirectory. - set(VARIANT_SUFFIX "-${SWIFT_SDK_${SDK}_LIB_SUBDIR}-${ARCH}") - set(VARIANT_TRIPLE "${SWIFT_SDK_${SDK}_ARCH_${ARCH}_TRIPLE}") - set(VARIANT_SDK "${SWIFT_SDK_${SDK}_PATH}") - is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" SWIFT_OPTIMIZED) + # Configure variables for this subdirectory. + set(VARIANT_SUFFIX "-${SWIFT_SDK_${SDK}_LIB_SUBDIR}-${ARCH}") + set(VARIANT_TRIPLE "${SWIFT_SDK_${SDK}_ARCH_${ARCH}_TRIPLE}") + set(VARIANT_SDK "${SWIFT_SDK_${SDK}_PATH}") - # Normalize spelling of boolean values. - normalize_boolean_spelling(LLVM_ENABLE_ASSERTIONS) - normalize_boolean_spelling(SWIFT_STDLIB_ASSERTIONS) - normalize_boolean_spelling(SWIFT_AST_VERIFIER) - normalize_boolean_spelling(SWIFT_ASAN_BUILD) + # A directory where to put the xUnit-style XML test results. + set(swift_test_results_dir + "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/swift-test-results/${VARIANT_TRIPLE}") - # A directory where to put the xUnit-style XML test results. - set(swift_test_results_dir - "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/swift-test-results/${VARIANT_TRIPLE}") + set(command_clean_test_results_dir + COMMAND "${CMAKE_COMMAND}" -E remove_directory "${swift_test_results_dir}" + COMMAND "${CMAKE_COMMAND}" -E make_directory "${swift_test_results_dir}") - set(command_clean_test_results_dir - COMMAND "${CMAKE_COMMAND}" -E remove_directory "${swift_test_results_dir}" - COMMAND "${CMAKE_COMMAND}" -E make_directory "${swift_test_results_dir}") + set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}") + set(validation_test_bin_dir + "${CMAKE_CURRENT_BINARY_DIR}/../validation-test${VARIANT_SUFFIX}") + swift_configure_lit_site_cfg( + "${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in" + "${test_bin_dir}/lit.site.cfg" + "test${VARIANT_SUFFIX}.lit.site.cfg") + + swift_configure_lit_site_cfg( + "${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in" + "${test_bin_dir}/Unit/lit.site.cfg" + "") + + swift_configure_lit_site_cfg( + "${CMAKE_CURRENT_SOURCE_DIR}/../validation-test/lit.site.cfg.in" + "${validation_test_bin_dir}/lit.site.cfg" + "validation-test${VARIANT_SUFFIX}.lit.site.cfg") + + set(test_dependencies) + get_test_dependencies("${SDK}" test_dependencies) + list(APPEND test_dependencies + "swift-test-stdlib-${SWIFT_SDK_${SDK}_LIB_SUBDIR}") + + if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS) + list(APPEND test_dependencies + "swift-reflection-test${VARIANT_SUFFIX}") + endif() + + set(validation_test_dependencies + "swiftStdlibCollectionUnittest-${SWIFT_SDK_${SDK}_LIB_SUBDIR}") + + foreach(test_mode ${TEST_MODES}) set(LIT_ARGS "${SWIFT_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}") separate_arguments(LIT_ARGS) + if(test_mode STREQUAL "optimize_none") + # No special arguments required. + elseif(test_mode STREQUAL "optimize") + list(APPEND LIT_ARGS "--param" "run_only_tests=executable_tests") + elseif(test_mode STREQUAL "optimize_unchecked") + list(APPEND LIT_ARGS "--param" "run_only_tests=executable_tests") + elseif(test_mode STREQUAL "only_executable") + list(APPEND LIT_ARGS "--param" "run_only_tests=executable_tests") + elseif(test_mode STREQUAL "only_non_executable") + list(APPEND LIT_ARGS "--param" "run_only_tests=non_executable_tests") + else() + message(FATAL_ERROR "Unknown test mode: ${test_mode}") + endif() + set(test_mode_target_suffix "") - if(NOT TEST_MODE STREQUAL "optimize_none") - if(TEST_MODE STREQUAL "optimize") - set(test_mode_target_suffix "-optimize") - list(APPEND LIT_ARGS "--param" "run_only_tests=executable_tests") - endif() - if(TEST_MODE STREQUAL "optimize_unchecked") - set(test_mode_target_suffix "-optimize-unchecked") - list(APPEND LIT_ARGS "--param" "run_only_tests=executable_tests") - endif() - if(TEST_MODE STREQUAL "executable") - set(test_mode_target_suffix "-executable") - list(APPEND LIT_ARGS "--param" "run_only_tests=executable_tests") - endif() - if(TEST_MODE STREQUAL "non_executable") - set(test_mode_target_suffix "-non-executable") - list(APPEND LIT_ARGS "--param" "run_only_tests=non_executable_tests") - endif() - list(APPEND LIT_ARGS "--param" "swift_test_mode=${TEST_MODE}") + if(NOT test_mode STREQUAL "optimize_none") + list(APPEND LIT_ARGS "--param" "swift_test_mode=${test_mode}") + set(test_mode_target_suffix "-${test_mode}") endif() if(NOT SWIFT_BUILD_STDLIB) @@ -173,123 +229,74 @@ if(PYTHONINTERP_FOUND) list(APPEND LIT_ARGS "--xunit-xml-output=${swift_test_results_dir}/lit-tests.xml") - set(lit_command ${PYTHON_EXECUTABLE} "${LIT}" ${LIT_ARGS}) - set(command_upload_stdlib) if("${SDK}" STREQUAL "IOS" OR "${SDK}" STREQUAL "TVOS" OR "${SDK}" STREQUAL "WATCHOS") # These are supported testing SDKs. endif() - set(test_dependencies) - get_test_dependencies("${SDK}" test_dependencies) - list(APPEND test_dependencies - "swift-test-stdlib-${SWIFT_SDK_${SDK}_LIB_SUBDIR}") + foreach(test_subset ${TEST_SUBSETS}) + set(want_this_combination TRUE) + if(test_subset STREQUAL "only_long") + # Long tests are only run in 'optimize_none' mode. + if(NOT test_mode STREQUAL "optimize_none") + set(want_this_combination FALSE) + endif() - if(SWIFT_BUILD_STDLIB AND SWIFT_INCLUDE_TESTS) - list(APPEND test_dependencies - "swift-reflection-test${VARIANT_SUFFIX}") - endif() + list(APPEND LIT_ARGS "--param" "run_only_tests=long_tests") + endif() - set(validation_test_dependencies - "swiftStdlibCollectionUnittest-${SWIFT_SDK_${SDK}_LIB_SUBDIR}") + set(directories) + set(dependencies ${test_dependencies}) - set(test_bin_dir "${CMAKE_CURRENT_BINARY_DIR}${VARIANT_SUFFIX}") - set(validation_test_bin_dir - "${CMAKE_CURRENT_BINARY_DIR}/../validation-test${VARIANT_SUFFIX}") - - swift_configure_lit_site_cfg( - "${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in" - "${test_bin_dir}/lit.site.cfg" - "test${VARIANT_SUFFIX}.lit.site.cfg") - - swift_configure_lit_site_cfg( - "${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in" - "${test_bin_dir}/Unit/lit.site.cfg" - "") - - swift_configure_lit_site_cfg( - "${CMAKE_CURRENT_SOURCE_DIR}/../validation-test/lit.site.cfg.in" - "${validation_test_bin_dir}/lit.site.cfg" - "validation-test${VARIANT_SUFFIX}.lit.site.cfg") - set(profdata_merge_worker - "${CMAKE_CURRENT_SOURCE_DIR}/../utils/profdata_merge/main.py") - - if(SWIFT_ANALYZE_CODE_COVERAGE STREQUAL "MERGED") - set(command_profdata_merge_start - COMMAND "${PYTHON_EXECUTABLE}" "${profdata_merge_worker}" - -l "${swift_test_results_dir}/profdata_merge.log" - start - -o "${swift_test_results_dir}") - set(command_profdata_merge_stop - COMMAND "${PYTHON_EXECUTABLE}" "${profdata_merge_worker}" stop) - else() - set(command_profdata_merge_start) - set(command_profdata_merge_stop) - endif() - - add_custom_target("check-swift${test_mode_target_suffix}${VARIANT_SUFFIX}" - ${command_upload_stdlib} - ${command_clean_test_results_dir} - ${command_profdata_merge_start} - COMMAND ${lit_command} "${test_bin_dir}" - ${command_profdata_merge_stop} - DEPENDS ${test_dependencies} - COMMENT "Running Swift tests for ${VARIANT_TRIPLE}" - ${cmake_3_2_USES_TERMINAL}) - - add_custom_target("check-swift-validation${test_mode_target_suffix}${VARIANT_SUFFIX}" - ${command_upload_stdlib} - ${command_clean_test_results_dir} - ${command_profdata_merge_start} - COMMAND ${lit_command} "${validation_test_bin_dir}" - ${command_profdata_merge_stop} - DEPENDS ${test_dependencies} ${validation_test_dependencies} - COMMENT "Running Swift validation tests for ${VARIANT_TRIPLE}" - ${cmake_3_2_USES_TERMINAL}) - - add_custom_target("check-swift-all${test_mode_target_suffix}${VARIANT_SUFFIX}" - ${command_upload_stdlib} - ${command_clean_test_results_dir} - ${command_profdata_merge_start} - COMMAND ${lit_command} "${validation_test_bin_dir}" "${test_bin_dir}" - ${command_profdata_merge_stop} - DEPENDS ${test_dependencies} ${validation_test_dependencies} - COMMENT "Running all Swift tests for ${VARIANT_TRIPLE}" - ${cmake_3_2_USES_TERMINAL}) + if((test_subset STREQUAL "primary") OR + (test_subset STREQUAL "only_long") OR + (test_subset STREQUAL "all")) + list(APPEND directories "${test_bin_dir}") + endif() + if((test_subset STREQUAL "validation") OR + (test_subset STREQUAL "only_validation") OR + (test_subset STREQUAL "only_long") OR + (test_subset STREQUAL "all")) + list(APPEND directories "${validation_test_bin_dir}") + list(APPEND dependencies ${validation_test_dependencies}) + endif() + set(test_subset_target_suffix "-${test_subset}") + if(test_subset STREQUAL "primary") + set(test_subset_target_suffix "") + endif() + if(want_this_combination) + add_custom_target("check-swift${test_subset_target_suffix}${test_mode_target_suffix}${VARIANT_SUFFIX}" + ${command_upload_stdlib} + ${command_clean_test_results_dir} + ${command_profdata_merge_start} + COMMAND ${PYTHON_EXECUTABLE} "${LIT}" ${LIT_ARGS} ${directories} + ${command_profdata_merge_stop} + DEPENDS ${dependencies} + COMMENT "Running ${test_subset} Swift tests for ${VARIANT_TRIPLE}" + ${cmake_3_2_USES_TERMINAL}) + endif() + endforeach() endforeach() endforeach() endforeach() # Add shortcuts for the default variant. - foreach(TEST_MODE ${TEST_MODES}) - set(test_mode_target_suffix) - if(TEST_MODE STREQUAL "optimize_none") + foreach(test_mode ${TEST_MODES}) + foreach(test_subset ${TEST_SUBSETS}) set(test_mode_target_suffix "") - endif() - if(TEST_MODE STREQUAL "optimize") - set(test_mode_target_suffix "-optimize") - endif() - if(TEST_MODE STREQUAL "optimize_unchecked") - set(test_mode_target_suffix "-optimize-unchecked") - endif() - if(TEST_MODE STREQUAL "executable") - set(test_mode_target_suffix "-executable") - endif() - if(TEST_MODE STREQUAL "non_executable") - set(test_mode_target_suffix "-non-executable") - endif() - - add_custom_target(check-swift${test_mode_target_suffix} - DEPENDS "check-swift${test_mode_target_suffix}${SWIFT_PRIMARY_VARIANT_SUFFIX}") - - add_custom_target(check-swift-validation${test_mode_target_suffix} - DEPENDS "check-swift-validation${test_mode_target_suffix}${SWIFT_PRIMARY_VARIANT_SUFFIX}") - - add_custom_target(check-swift-all${test_mode_target_suffix} - DEPENDS "check-swift-all${test_mode_target_suffix}${SWIFT_PRIMARY_VARIANT_SUFFIX}") + if(NOT test_mode STREQUAL "optimize_none") + set(test_mode_target_suffix "-${test_mode}") + endif() + set(test_subset_target_suffix "-${test_subset}") + if(test_subset STREQUAL "primary") + set(test_subset_target_suffix "") + endif() + add_custom_target(check-swift${test_subset_target_suffix}${test_mode_target_suffix} + DEPENDS "check-swift${test_subset_target_suffix}${test_mode_target_suffix}${SWIFT_PRIMARY_VARIANT_SUFFIX}") + endforeach() endforeach() endif() diff --git a/test/ClangModules/objc_bridging_generics.swift b/test/ClangModules/objc_bridging_generics.swift index 27373042c37..197c49a9b04 100644 --- a/test/ClangModules/objc_bridging_generics.swift +++ b/test/ClangModules/objc_bridging_generics.swift @@ -55,9 +55,30 @@ func j(_ x: GenericClass?) { } class Desk {} -class Rock: Pettable {} -class Porcupine: Animal {} -class Cat: Animal, Pettable {} +class Rock: NSObject, Pettable { + required init(fur: AnyObject) {} + func other() -> Self { return self } + class func adopt() -> Self { fatalError("") } + func pet() {} + func pet(with other: Pettable) {} + class var needingMostPets: Pettable { + get { fatalError("") } + set { } + } +} +class Porcupine: Animal { +} +class Cat: Animal, Pettable { + required init(fur: AnyObject) {} + func other() -> Self { return self } + class func adopt() -> Self { fatalError("") } + func pet() {} + func pet(with other: Pettable) {} + class var needingMostPets: Pettable { + get { fatalError("") } + set { } + } +} func testImportedTypeParamRequirements() { let _ = PettableContainer() // expected-error{{type 'Desk' does not conform to protocol 'Pettable'}} @@ -77,56 +98,176 @@ func testImportedTypeParamRequirements() { extension GenericClass { func doesntUseGenericParam() {} @objc func doesntUseGenericParam2() -> Self {} - // Doesn't technically use 'T', since it's type-erased at runtime + // Doesn't use 'T', since ObjC class type params are type-erased func doesntUseGenericParam3() -> GenericClass {} + // Doesn't use 'T', since its metadata isn't necessary to pass around instance + @objc func doesntUseGenericParam4(_ x: T, _ y: T.Type) -> T { + _ = x + _ = y + return x + } + // Doesn't use 'T', since its metadata isn't necessary to erase to AnyObject + // or to existential metatype + func doesntUseGenericParam5(_ x: T, _ y: T.Type) -> T { + _ = y as AnyObject.Type + _ = y as Any.Type + _ = y as AnyObject + _ = x as AnyObject + } - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} - func usesGenericParamA(_ x: T) {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} - func usesGenericParamB(_ x: Int) -> T {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} - func usesGenericParamC(_ x: [(T, T)]?) {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamC(_ x: [(T, T)]?) {} // expected-note{{used here}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} func usesGenericParamD(_ x: Int) { - _ = T.self + _ = T.self // expected-note{{used here}} } - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} func usesGenericParamE(_ x: Int) { - _ = x as? T + _ = x as? T // expected-note{{used here}} } - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} func usesGenericParamF(_ x: Int) { - _ = x is T + _ = x is T // expected-note{{used here}} } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamG(_ x: T) { + _ = T.self // expected-note{{used here}} + } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamH(_ x: T) { + _ = x as Any // expected-note{{used here}} + } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamI(_ y: T.Type) { + _ = y as Any // expected-note{{used here}} + } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamJ() -> [(T, T)]? {} // expected-note{{used here}} static func doesntUseGenericParam() {} static func doesntUseGenericParam2() -> Self {} // Doesn't technically use 'T', since it's type-erased at runtime static func doesntUseGenericParam3() -> GenericClass {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} - static func usesGenericParamA(_ x: T) {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} - static func usesGenericParamB(_ x: Int) -> T {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} - static func usesGenericParamC(_ x: [(T, T)]?) {} - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + static func usesGenericParamC(_ x: [(T, T)]?) {} // expected-note{{used here}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} static func usesGenericParamD(_ x: Int) { - _ = T.self + _ = T.self // expected-note{{used here}} } - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} static func usesGenericParamE(_ x: Int) { - _ = x as? T + _ = x as? T // expected-note{{used here}} } - // expected-error@+1{{Extension of a generic Objective-C class cannot access the class's generic parameters}} + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} static func usesGenericParamF(_ x: Int) { - _ = x is T + _ = x is T // expected-note{{used here}} } func checkThatMethodsAreObjC() { _ = #selector(GenericClass.doesntUseGenericParam) _ = #selector(GenericClass.doesntUseGenericParam2) _ = #selector(GenericClass.doesntUseGenericParam3) + _ = #selector(GenericClass.doesntUseGenericParam4) + _ = #selector(GenericClass.doesntUseGenericParam5) + } +} + +func swiftFunction(x: T) {} + +extension AnimalContainer { + func doesntUseGenericParam1(_ x: T, _ y: T.Type) { + _ = #selector(x.another) + _ = #selector(y.create) + } + + func doesntUseGenericParam2(_ x: T, _ y: T.Type) { + let a = x.another() + _ = a.another() + _ = x.another().another() + + _ = x.dynamicType.create().another() + _ = x.dynamicType.init(noise: x).another() + _ = y.create().another() + _ = y.init(noise: x).another() + _ = y.init(noise: x.another()).another() + x.eat(a) + } + + func doesntUseGenericParam3(_ x: T, _ y: T.Type) { + let sup: Animal = x + sup.eat(x) + _ = x.buddy + _ = x[0] + x[0] = x + } + + func doesntUseGenericParam4(_ x: T, _ y: T.Type) { + _ = x.dynamicType.apexPredator.another() + x.dynamicType.apexPredator = x + + _ = y.apexPredator.another() + + y.apexPredator = x + } + + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamA(_ x: T) { + _ = T(noise: x) // expected-note{{used here}} + } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamB() { + _ = T.create() // expected-note{{used here}} + } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamC() { + _ = T.apexPredator // expected-note{{used here}} + } + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamD(_ x: T) { + T.apexPredator = x // expected-note{{used here}} + } + + func checkThatMethodsAreObjC() { + _ = #selector(AnimalContainer.doesntUseGenericParam1) + _ = #selector(AnimalContainer.doesntUseGenericParam2) + _ = #selector(AnimalContainer.doesntUseGenericParam3) + _ = #selector(AnimalContainer.doesntUseGenericParam4) + } +} + +extension PettableContainer { + func doesntUseGenericParam(_ x: T, _ y: T.Type) { + _ = x.dynamicType.init(fur: x).other() + _ = x.dynamicType.adopt().other() + _ = y.init(fur: x).other() + _ = y.adopt().other() + x.pet() + x.pet(with: x) + } + + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamA(_ x: T) { + _ = T(fur: x) // expected-note{{used here}} + } + + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamB(_ x: T) { + _ = T.adopt() // expected-note{{used here}} + } + + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamC(_ x: T) { + _ = T.needingMostPets // expected-note{{used here}} + } + + // expected-error@+1{{extension of a generic Objective-C class cannot access the class's generic parameters}} + func usesGenericParamD(_ x: T) { + T.needingMostPets = x // expected-note{{used here}} + } + + func checkThatMethodsAreObjC() { + _ = #selector(PettableContainer.doesntUseGenericParam) } } diff --git a/test/Constraints/dictionary_literal.swift b/test/Constraints/dictionary_literal.swift index 7347bd04545..06ad9c39a3e 100644 --- a/test/Constraints/dictionary_literal.swift +++ b/test/Constraints/dictionary_literal.swift @@ -16,13 +16,13 @@ func useDictStringInt(_ d: DictStringInt) {} func useDict(_ d: Dictionary) {} // Concrete dictionary literals. -useDictStringInt([ "Hello" : 1 ]) -useDictStringInt([ "Hello" : 1, "World" : 2]) -useDictStringInt([ "Hello" : 1, "World" : 2.5]) // expected-error{{cannot convert value of type 'Double' to expected dictionary value type 'Int'}} -useDictStringInt([ 4.5 : 2]) // expected-error{{cannot convert value of type 'Double' to expected dictionary key type 'String'}} -useDictStringInt([ nil : 2]) // expected-error{{nil is not compatible with expected dictionary key type 'String'}} +useDictStringInt(["Hello" : 1]) +useDictStringInt(["Hello" : 1, "World" : 2]) +useDictStringInt(["Hello" : 1, "World" : 2.5]) // expected-error{{cannot convert value of type 'Double' to expected dictionary value type 'Int'}} +useDictStringInt([4.5 : 2]) // expected-error{{cannot convert value of type 'Double' to expected dictionary key type 'String'}} +useDictStringInt([nil : 2]) // expected-error{{nil is not compatible with expected dictionary key type 'String'}} -useDictStringInt([ 7 : 1, "World" : 2]) // expected-error{{cannot convert value of type 'Int' to expected dictionary key type 'String'}} +useDictStringInt([7 : 1, "World" : 2]) // expected-error{{cannot convert value of type 'Int' to expected dictionary key type 'String'}} // Generic dictionary literals. useDict(["Hello" : 1]) @@ -35,7 +35,7 @@ var a = ["Hello" : 1, "World" : 2] var a2 : Dictionary = a var a3 = ["Hello" : 1] -var b = [ 1 : 2, 1.5 : 2.5 ] +var b = [1 : 2, 1.5 : 2.5] var b2 : Dictionary = b var b3 = [1 : 2.5] diff --git a/test/Constraints/lvalues.swift b/test/Constraints/lvalues.swift index f02bee521f7..0bcfa50abc5 100644 --- a/test/Constraints/lvalues.swift +++ b/test/Constraints/lvalues.swift @@ -49,7 +49,6 @@ x += x var yi = y[i] // Non-settable lvalues -// FIXME: better diagnostic! var non_settable_x : X { return x @@ -78,28 +77,28 @@ f2(&non_settable_x) // expected-error{{cannot pass immutable value as inout argu f1(&non_settable_x) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} // - inout assignment non_settable_x += x // expected-error{{left side of mutating operator isn't mutable: 'non_settable_x' is a get-only property}} -++non_settable_x // expected-error{{cannot pass immutable value to mutating operator: 'non_settable_x' is a get-only property}} +++non_settable_x // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} // non-settable property is non-settable: z.non_settable_x = x // expected-error{{cannot assign to property: 'non_settable_x' is a get-only property}} f2(&z.non_settable_x) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} f1(&z.non_settable_x) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} z.non_settable_x += x // expected-error{{left side of mutating operator isn't mutable: 'non_settable_x' is a get-only property}} -++z.non_settable_x // expected-error{{cannot pass immutable value to mutating operator: 'non_settable_x' is a get-only property}} +++z.non_settable_x // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} // non-settable subscript is non-settable: z[0] = 0.0 // expected-error{{cannot assign through subscript: subscript is get-only}} f2(&z[0]) // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}} f1(&z[0]) // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}} z[0] += 0.0 // expected-error{{left side of mutating operator isn't mutable: subscript is get-only}} -++z[0] // expected-error{{cannot pass immutable value to mutating operator: subscript is get-only}} +++z[0] // expected-error{{cannot pass immutable value as inout argument: subscript is get-only}} // settable property of an rvalue value type is non-settable: fz().settable_x = x // expected-error{{cannot assign to property: 'fz' returns immutable value}} f2(&fz().settable_x) // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}} f1(&fz().settable_x) // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}} fz().settable_x += x // expected-error{{left side of mutating operator isn't mutable: 'fz' returns immutable value}} -++fz().settable_x // expected-error{{cannot pass immutable value to mutating operator: 'fz' returns immutable value}} +++fz().settable_x // expected-error{{cannot pass immutable value as inout argument: 'fz' returns immutable value}} // settable property of an rvalue reference type IS SETTABLE: fref().property = 0.0 @@ -113,7 +112,7 @@ z.non_settable_x.property = 1.0 // expected-error{{cannot assign to property: 'n f2(&z.non_settable_x.property) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} f1(&z.non_settable_x.property) // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} z.non_settable_x.property += 1.0 // expected-error{{left side of mutating operator isn't mutable: 'non_settable_x' is a get-only property}} -++z.non_settable_x.property // expected-error{{cannot pass immutable value to mutating operator: 'non_settable_x' is a get-only property}} +++z.non_settable_x.property // expected-error{{cannot pass immutable value as inout argument: 'non_settable_x' is a get-only property}} // settable property of a non-settable reference type IS SETTABLE: z.non_settable_reftype.property = 1.0 diff --git a/test/DebugInfo/bbentry-location.swift b/test/DebugInfo/bbentry-location.swift index 05bb9088585..65341fdc187 100644 --- a/test/DebugInfo/bbentry-location.swift +++ b/test/DebugInfo/bbentry-location.swift @@ -3,7 +3,7 @@ // RUN: %target-swift-frontend -emit-ir -g %s -o - | FileCheck %s import UIKit -@available(iOS, introduced=8.0) +@available(iOS, introduced: 8.0) class ActionViewController { var imageView: UIImageView! diff --git a/test/DebugInfo/closure.swift b/test/DebugInfo/closure.swift index f40588b80f8..c41f84622db 100644 --- a/test/DebugInfo/closure.swift +++ b/test/DebugInfo/closure.swift @@ -5,7 +5,7 @@ func markUsed(_ t: T) {} func foldl1(_ list: [T], _ function: (a: T, b: T) -> T) -> T { assert(list.count > 1) var accumulator = list[0] - for var i = 1; i < list.count; i += 1 { + for i in 1 ..< list.count { accumulator = function(a: accumulator, b: list[i]) } return accumulator diff --git a/test/DebugInfo/for.swift b/test/DebugInfo/for.swift index a10a2971f56..9c141cf419b 100644 --- a/test/DebugInfo/for.swift +++ b/test/DebugInfo/for.swift @@ -2,11 +2,12 @@ // Verify that variables bound in the for statements are in distinct scopes. -for var i = 0; i < 3; i += 1 { +for i in 0 ..< 3 { // CHECK: ![[SCOPE1:[0-9]+]] = {{.*}}Block(scope: ![[MAIN:[0-9]+]],{{.*}}line: 5 -// CHECK: !DILocalVariable(name: "i", scope: ![[SCOPE1]] } -for var i = 0; i < 3; i += 1 { -// CHECK: ![[SCOPE2:[0-9]+]] = {{.*}}Block(scope: ![[MAIN:[0-9]+]],{{.*}}line: 9 + +for i in 0 ..< 3 { +// CHECK: ![[SCOPE2:[0-9]+]] = {{.*}}Block(scope: ![[MAIN]],{{.*}}line: 9 +// CHECK: !DILocalVariable(name: "i", scope: ![[SCOPE1]] // CHECK: !DILocalVariable(name: "i", scope: ![[SCOPE2]] } diff --git a/test/DebugInfo/iteration.swift b/test/DebugInfo/iteration.swift index 41f8fcdee23..f40f220bfc1 100644 --- a/test/DebugInfo/iteration.swift +++ b/test/DebugInfo/iteration.swift @@ -7,7 +7,7 @@ var puzzleOutput: [String] = [] // CHECK-NOT: !DILocalVariable(name: "$letter$generator" // CHECK: !DILocalVariable(name: "letter", // CHECK-SAME: line: [[@LINE+1]] -for letter in [ "g", "r", "e", "a", "t" ] { +for letter in ["g", "r", "e", "a", "t"] { switch letter { case "a", "e", "i", "o", "u", " ": continue diff --git a/test/IDE/complete_doc_keyword.swift b/test/IDE/complete_doc_keyword.swift index ed1d359c53c..a84659fd169 100644 --- a/test/IDE/complete_doc_keyword.swift +++ b/test/IDE/complete_doc_keyword.swift @@ -1,5 +1,6 @@ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=TYPE1 | FileCheck %s -check-prefix=TYPE1 // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER1 | FileCheck %s -check-prefix=MEMBER1 +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER2 | FileCheck %s -check-prefix=MEMBER2 /** - keyword: C1, Class @@ -61,6 +62,21 @@ enum E1{} */ enum E2{} +/** + - keyword: S3, Struct +*/ +struct S3 { + /** + - nonmutatingvariant: fooing + */ + mutating func foo() {} + + /** + - mutatingvariant: foo + */ + func fooing() -> S3 {} +} + func foo1() { #^TYPE1^# // TYPE1: Begin completions @@ -70,6 +86,7 @@ func foo1() { // TYPE1-DAG: Decl[Struct]/CurrModule/keyword[S2, Struct]/recommended[S1]: S2[#S2#] // TYPE1-DAG: Decl[Class]/CurrModule/keyword[C2, Class]/recommendedover[C1]: C2[#C2#] // TYPE1-DAG: Decl[Enum]/CurrModule/keyword[E1, Enum]/recommended[E2]: E1[#E1#] +// TYPE1-DAG: Decl[Struct]/CurrModule/keyword[S3, Struct]: S3[#S3#] } func foo2() { @@ -81,3 +98,11 @@ func foo2() { // MEMBER1-NEXT: Decl[InstanceMethod]/CurrNominal/keyword[f1, func]/recommended[f2]: f1()[#Void#] // MEMBER1-NEXT: Decl[InstanceMethod]/CurrNominal/keyword[f2, func]/recommendedover[f1]: f2()[#Void#] } + +func foo3() { + let s = S3() + s.#^MEMBER2^# +// MEMBER2: Begin completions +// MEMBER2-NEXT: Decl[InstanceMethod]/CurrNominal/nonmutatingvariant[fooing]: foo()[#Void#] +// MEMBER2-NEXT: Decl[InstanceMethod]/CurrNominal/mutatingvariant[foo]: fooing()[#S3#] +} diff --git a/test/Inputs/clang-importer-sdk/usr/include/objc_generics.h b/test/Inputs/clang-importer-sdk/usr/include/objc_generics.h index 0472a01491a..628b11d1340 100644 --- a/test/Inputs/clang-importer-sdk/usr/include/objc_generics.h +++ b/test/Inputs/clang-importer-sdk/usr/include/objc_generics.h @@ -22,9 +22,36 @@ void takeGenericClass(__nullable GenericClass *thing); @end @protocol Pettable +- (nonnull instancetype)initWithFur:(nonnull id)fur; +- (nonnull instancetype)other; ++ (nonnull instancetype)adopt; +- (void)pet; +- (void)petWith:(nonnull id )other; + +@property (nonatomic, class) _Nonnull id needingMostPets; + @end @interface Animal : NSObject +- (nonnull instancetype)initWithNoise:(nonnull id)noise; +- (nonnull instancetype)another; ++ (nonnull instancetype)create; + +- (void)eat:(Animal*)prey; + +@property (nonatomic, readonly) Animal *_Nonnull buddy; + +@property (nonatomic, class) Animal *_Nonnull apexPredator; + +- (Animal *_Nonnull)objectAtIndexedSubscript:(NSInteger)i; +- (void)setObject:(Animal *_Nonnull)x atIndexedSubscript:(NSInteger)i; + +@end + +@protocol Fungible +@end + +@interface FungibleContainer> : NSObject @end @interface PettableContainer> : NSObject diff --git a/test/Interpreter/SDK/Foundation_test.swift b/test/Interpreter/SDK/Foundation_test.swift index 975221067eb..e21a55fa862 100644 --- a/test/Interpreter/SDK/Foundation_test.swift +++ b/test/Interpreter/SDK/Foundation_test.swift @@ -69,7 +69,7 @@ FoundationTestSuite.test("NSNumber") { FoundationTestSuite.test("NSArray") { // Literals - var nsArr: NSArray = [ 1, 2.5, "Hello" ] + var nsArr: NSArray = [1, 2.5, "Hello"] assert(nsArr.count == 3) // Subscripting @@ -82,7 +82,7 @@ FoundationTestSuite.test("NSArray") { for x: AnyObject in nsArr { result.append((x as! NSObject).description) } - expectEqualSequence([ "1", "2.5", "Hello" ], result) + expectEqualSequence(["1", "2.5", "Hello"], result) } FoundationTestSuite.test("NSMutableArray") { @@ -189,7 +189,7 @@ class ClassWithDtor : NSObject { FoundationTestSuite.test("rdar://17584531") { // // Type checker used to be confused by this. - var dict: NSDictionary = [ "status": 200, "people": [ [ "id": 255, "name": [ "first": "John", "last": "Appleseed" ] ] ] ] + var dict: NSDictionary = ["status": 200, "people": [["id": 255, "name": ["first": "John", "last": "Appleseed"]]]] var dict2 = dict["people"]?[0] as! NSDictionary expectEqual("Optional(255)", String(dict2["id"])) } diff --git a/test/Interpreter/availability_weak_linking.swift b/test/Interpreter/availability_weak_linking.swift index dc6762ce2ce..2ef2740da27 100644 --- a/test/Interpreter/availability_weak_linking.swift +++ b/test/Interpreter/availability_weak_linking.swift @@ -115,7 +115,7 @@ func useUnavailableObjCClass() { o.someMethod() } - for var i = 0; i < getInt(5); i += 1 { + for i in 0 ..< getInt(5) { if #available(OSX 1066.0, iOS 1066.0, watchOS 1066.0, tvOS 1066.0, *) { let o: UnavailableObjCClass = printClassMetadataViaGeneric() _blackHole(o) @@ -125,14 +125,14 @@ func useUnavailableObjCClass() { class SomeClass { } let someObject: AnyObject = _opaqueIdentity(SomeClass() as AnyObject) - for var i = 0; i < getInt(5); i += 1 { + for i in 0 ..< getInt(5) { if #available(OSX 1066.0, iOS 1066.0, watchOS 1066.0, tvOS 1066.0, *) { let isUnavailable = someObject is UnavailableObjCClass _blackHole(isUnavailable) } } - for var i = 0; i < getInt(5); i += 1 { + for i in 0 ..< getInt(5) { if #available(OSX 1066.0, iOS 1066.0, watchOS 1066.0, tvOS 1066.0, *) { let asUnavailable = someObject as? UnavailableObjCClass _blackHole(asUnavailable) diff --git a/test/Interpreter/break_continue.swift b/test/Interpreter/break_continue.swift index 8643f13aeff..534b8a60210 100644 --- a/test/Interpreter/break_continue.swift +++ b/test/Interpreter/break_continue.swift @@ -1,37 +1,6 @@ // RUN: %target-run-simple-swift | FileCheck %s // REQUIRES: executable_test -func test1() { - print("test1") - var i : Int - for i=0;;i += 1 { - if i > 2 { - break - } - print(i) - continue - } -} -func test2() { - print("test2") - var i : Int - for i=0;i<10;i += 1 { - if i > 2 { - continue - } - print(i) - } -} -func test3() { - print("test3") - var i : Int - for i=0;i<10;i += 1 { - if i > 2 { - break - } - print(i) - } -} func test4() { print("test4") for i in 0..<10 { @@ -75,39 +44,8 @@ func test7() { } print("foo") } -func test8() { - print("test8") - var i : Int - for i=0;;i += 1 { - for j in 0..<10 { - if j > 1 { - break - } - print(j) - } - if i > 2 { - break - } - print(i) - continue - } -} print("start") -test1() -// CHECK: test1 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -test2() -// CHECK: test2 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -test3() -// CHECK: test3 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 + test4() // CHECK: test4 // CHECK-NEXT: 0 @@ -125,11 +63,3 @@ test7() // CHECK: test7 // CHECK-NEXT: 0 // CHECK-NEXT: foo -test8() -// CHECK: test8 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 1 diff --git a/test/Interpreter/fractal.swift b/test/Interpreter/fractal.swift index 82c2b1bee73..9475f02519e 100644 --- a/test/Interpreter/fractal.swift +++ b/test/Interpreter/fractal.swift @@ -50,8 +50,8 @@ func fractal (_ densityFunc:(c: Complex, maxIterations: Int) -> Int, var dY = (yMax - yMin) / Double(cols) // Iterate over the points an determine if they are in the // Mandelbrot set. - for var row = xMin; row < xMax ; row += dX { - for var col = yMin; col < yMax; col += dY { + for row in stride(from: xMin, to: xMax, by: dX) { + for col in stride(from: yMin, to: yMax, by: dY) { var c = Complex(real: col, imag: row) printDensity(densityFunc(c: c, maxIterations: maxIterations)) } diff --git a/test/Interpreter/mandelbrot.swift b/test/Interpreter/mandelbrot.swift index eeac3323fc4..3f38b53a89e 100644 --- a/test/Interpreter/mandelbrot.swift +++ b/test/Interpreter/mandelbrot.swift @@ -39,8 +39,8 @@ func mandelbrot(_ xMin: Double, _ xMax: Double, var dY = (yMax - yMin) / Double(cols) // Iterate over the points an determine if they are in the // Mandelbrot set. - for var row = xMin; row < xMax ; row += dX { - for var col = yMin; col < yMax; col += dY { + for row in stride(from: xMin, to: xMax, by: dX) { + for col in stride(from: yMin, to: yMax, by: dY) { var c = Complex(real: col, imag: row) printDensity(getMandelbrotIterations(c, 200)) } diff --git a/test/Misc/misc_diagnostics.swift b/test/Misc/misc_diagnostics.swift index bbcbb547b02..579ed87275c 100644 --- a/test/Misc/misc_diagnostics.swift +++ b/test/Misc/misc_diagnostics.swift @@ -136,7 +136,7 @@ func test20770032() { func tuple_splat1(_ a : Int, _ b : Int) { let x = (1,2) - tuple_splat1(x) // expected-warning {{passing 2 arguments to a callee as a single tuple value is deprecated}} + tuple_splat1(x) // expected-error {{passing 2 arguments to a callee as a single tuple value has been removed in Swift 3}} tuple_splat1(1, 2) // Ok. tuple_splat1((1, 2)) // expected-error {{missing argument for parameter #2 in call}} } diff --git a/test/Parse/line-directive.swift b/test/Parse/line-directive.swift index 65c72a73a2a..f4febffc991 100644 --- a/test/Parse/line-directive.swift +++ b/test/Parse/line-directive.swift @@ -25,11 +25,11 @@ public struct S { // expected-note{{in declaration of 'S'}} // expected-error@+1{{expected declaration}} / ###line 25 "line-directive.swift" } -// expected-warning@+1{{#line directive is deprecated, please use #sourceLocation instead}} +// expected-error@+1{{#line directive was renamed to #sourceLocation}} #line 32000 "troops_on_the_water" #sourceLocation() -// expected-warning@+1{{#line directive is deprecated, please use #sourceLocation instead}} +// expected-error@+1{{#line directive was renamed to #sourceLocation}} #setline 32000 "troops_on_the_water" diff --git a/test/Parse/recovery.swift b/test/Parse/recovery.swift index 06c16fcf5d2..f6372968a5f 100644 --- a/test/Parse/recovery.swift +++ b/test/Parse/recovery.swift @@ -137,7 +137,6 @@ func missingWhileInRepeat() { } // expected-error {{expected 'while' after body of 'repeat' statement}} } -// expected-note @+1 {{in call to function 'acceptsClosure'}} func acceptsClosure(t: T) -> Bool { return true } func missingControllingExprInFor() { @@ -167,25 +166,7 @@ func missingControllingExprInFor() { for var i = 0; true { // expected-error {{expected ';' in 'for' statement}} } - // Ensure that we don't do recovery in the following cases. - for ; ; { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - } - - for { true }(); ; { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - } - - for ; { true }() ; { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - } - - for acceptsClosure { 42 }; ; { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - } - - // A trailing closure is not accepted for the condition. - for ; acceptsClosure { 42 }; { // expected-error{{generic parameter 'T' could not be inferred}} expected-error{{expression resolves to an unused function}} -// expected-error@-1{{expected ';' in 'for' statement}} -// expected-error@-2{{braced block}} - } - + // The #if block is used to provide a scope for the for stmt to force it to end // where necessary to provoke the crash. #if true // compiler crashes on "for{{" diff --git a/test/PrintAsObjC/classes.swift b/test/PrintAsObjC/classes.swift index 4acbe3d1e61..3394ea34245 100644 --- a/test/PrintAsObjC/classes.swift +++ b/test/PrintAsObjC/classes.swift @@ -596,15 +596,14 @@ public class NonObjCClass { } init(fn: Int -> Int) throws { } } -@objc class Pet: Pettable {} -@objc protocol Runcible {} +@objc class Spoon: Fungible {} // CHECK-LABEL: @interface UsesImportedGenerics @objc class UsesImportedGenerics { // CHECK: - (GenericClass * _Nonnull)takeAndReturnGenericClass:(GenericClass * _Nullable)x; @objc func takeAndReturnGenericClass(_ x: GenericClass?) -> GenericClass { fatalError("") } - // CHECK: - (PettableContainer> * _Null_unspecified)takeAndReturnPettableContainer:(PettableContainer * _Nonnull)x; - @objc func takeAndReturnPettableContainer(_ x: PettableContainer) -> PettableContainer! { fatalError("") } + // CHECK: - (FungibleContainer> * _Null_unspecified)takeAndReturnFungibleContainer:(FungibleContainer * _Nonnull)x; + @objc func takeAndReturnFungibleContainer(_ x: FungibleContainer) -> FungibleContainer! { fatalError("") } } // CHECK: @end diff --git a/test/Prototypes/CollectionTransformers.swift b/test/Prototypes/CollectionTransformers.swift index cd40ad16266..eb779881fec 100644 --- a/test/Prototypes/CollectionTransformers.swift +++ b/test/Prototypes/CollectionTransformers.swift @@ -59,7 +59,7 @@ internal func _splitRandomAccessIndexRange< let endIndex = range.upperBound let length = elements.distance(from: startIndex, to: endIndex).toIntMax() if length < 2 { - return [ range ] + return [range] } let middle = elements.index(C.IndexDistance(length / 2), stepsFrom: startIndex) return [startIndex ..< middle, middle ..< endIndex] diff --git a/test/Prototypes/CollectionsMoveIndices.swift b/test/Prototypes/CollectionsMoveIndices.swift index aa4cc040f3d..38c0ffccb3d 100644 --- a/test/Prototypes/CollectionsMoveIndices.swift +++ b/test/Prototypes/CollectionsMoveIndices.swift @@ -1578,15 +1578,15 @@ internal final class _NodePayload { extension _NodePayload : CustomReflectable { internal func customMirror() -> Mirror { if let lc = _leftChild, rc = _rightChild { - return Mirror(self, children: [ "left": lc, "data": _data, "right": rc ]) + return Mirror(self, children: ["left": lc, "data": _data, "right": rc]) } if let lc = _leftChild { - return Mirror(self, children: [ "left": lc, "data": _data ]) + return Mirror(self, children: ["left": lc, "data": _data]) } if let rc = _rightChild { - return Mirror(self, children: [ "data": _data, "right": rc ]) + return Mirror(self, children: ["data": _data, "right": rc]) } - return Mirror(self, children: [ "data": _data ]) + return Mirror(self, children: ["data": _data]) } } diff --git a/test/SIL/Parser/available.sil b/test/SIL/Parser/available.sil index 5b201a9622a..eae57334c7d 100644 --- a/test/SIL/Parser/available.sil +++ b/test/SIL/Parser/available.sil @@ -1,6 +1,6 @@ // RUN: %target-sil-opt %s | FileCheck %s -@available(*,unavailable,message="it has been renamed") +@available(*,unavailable,message: "it has been renamed") public struct mmConstUnsafePointer { } diff --git a/test/SILGen/break_continue.swift b/test/SILGen/break_continue.swift deleted file mode 100644 index 02499b96e53..00000000000 --- a/test/SILGen/break_continue.swift +++ /dev/null @@ -1,27 +0,0 @@ -// RUN: %target-swift-frontend -module-name Swift -parse-stdlib -emit-silgen %s | FileCheck %s - -enum Optional { - case none - case some(Wrapped) -} - -protocol Boolean { - var boolValue: Bool { get } -} - -struct Bool : Boolean { - var value: Builtin.Int1 - func _getBuiltinLogicValue() -> Builtin.Int1 { return value } - var boolValue: Bool { return self } -} - -// CHECK-LABEL: sil hidden @_TFs5test1 -func test1(bi: Bool) { - var b = bi - for var c = b; b; b = c { - if b { - break - } - continue - } -} diff --git a/test/SILGen/instrprof_basic.swift b/test/SILGen/instrprof_basic.swift index f8c13d1e47c..efaf2628400 100644 --- a/test/SILGen/instrprof_basic.swift +++ b/test/SILGen/instrprof_basic.swift @@ -32,7 +32,7 @@ func basic(a : Int32) { } // CHECK: builtin "int_instrprof_increment" - for var i: Int32 = 0; i < a; ++i { + for i in 0 ..< a { } // CHECK: builtin "int_instrprof_increment" diff --git a/test/SILGen/sil_locations.swift b/test/SILGen/sil_locations.swift index 48664a9db0e..db406bd4d62 100644 --- a/test/SILGen/sil_locations.swift +++ b/test/SILGen/sil_locations.swift @@ -5,7 +5,7 @@ func ifexpr() -> Int { var x : Int = 0 if true { - x++; + x+=1 } return x // CHECK-LABEL: sil hidden @_TF13sil_locations6ifexprFT_Si @@ -18,9 +18,9 @@ func ifexpr() -> Int { func ifelseexpr() -> Int { var x : Int = 0 if true { - x++; + x+=1 } else { - x--; + x-=1 } return x // CHECK-LABEL: sil hidden @_TF13sil_locations10ifelseexprFT_Si @@ -62,15 +62,15 @@ func ifexpr_rval() -> Int { // CHECK: br bb{{[0-9]+}}({{%.*}}), loc "{{.*}}":[[@LINE-8]]:22 } -// TODO: missing info on the first branch. -func forstmt_empty_cond(_ i: Int) -> Int { - for var i=0;;++i {} - // CHECK-LABEL: sil hidden @{{.*}}forstmt_empty_cond{{.*}} - // CHECK: apply {{.*}}, loc "{{.*}}":[[@LINE-2]]:13 - // CHECK: br [[TRUE_BB:bb[0-9]+]] - // CHECK: [[TRUE_BB:bb[0-9]+]]: - // CHECK: br [[TRUE_BB:bb[0-9]+]], loc "{{.*}}":[[@LINE-5]]:21 -} + + + + + + + + + // --- Test function calls. func simpleDirectCallTest(_ i: Int) -> Int { @@ -116,7 +116,7 @@ func multipleReturnsImplicitAndExplicit() { if x > 10 { return } - x++; + x += 1 // CHECK-LABEL: sil hidden @_TF13sil_locations34multipleReturnsImplicitAndExplicitFT_T_ // CHECK: cond_br // CHECK: br bb{{[0-9]+}}, loc "{{.*}}":[[@LINE-5]]:5, {{.*}}:return @@ -175,13 +175,13 @@ func testIf() { } func testFor() { - for (var i:Int = 0; i<10; i++) { + for i in 0..<10 { var y: Int = 300 - y++; + y+=1 if true { break } - y--; + y-=1 continue } @@ -350,9 +350,9 @@ func testStringForEachStmt() { func testForStmt() { - var i = 0 + var m = 0 - for (i = 0; i < 10; ++i) { + for i in 0..<10 { m += 1 if m == 15 { break @@ -363,19 +363,19 @@ func testForStmt() { } - // CHECK-LABEL: sil hidden @_TF13sil_locations11testForStmtFT_T_ - // CHECK: br {{.*}} line:[[@LINE-12]]:3 - // CHECK: cond_br {{.*}} line:[[@LINE-13]]:15 - // CHECK: cond_br {{.*}} line:[[@LINE-12]]:8 - // Break branch: - // CHECK: br {{.*}} line:[[@LINE-13]]:7 - // Continue branch: - // CHECK: br {{.*}} line:[[@LINE-13]]:7 - // Looping back branch: - // CHECK: br {{.*}} line:[[@LINE-12]]:3 - // Condition is false branch: - // CHECK: br {{.*}} line:[[@LINE-22]]:3 + + + + + + + + + + + + } diff --git a/test/SILGen/statements.swift b/test/SILGen/statements.swift index 54c62df5a90..2aac357a83d 100644 --- a/test/SILGen/statements.swift +++ b/test/SILGen/statements.swift @@ -156,21 +156,10 @@ func do_loop_with_continue(_ x: Int, y: Bool, z: Bool) -> Int { // CHECK-LABEL: sil hidden @{{.*}}for_loops1 func for_loops1(_ x: Int, c: Bool) { - var x = x for i in 1..<100 { markUsed(i) } - - for ; x < 40; { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - markUsed(x) - x += 1 - } - - for var i = 0; i < 100; i += 1 { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - } - - for let i = 0; i < 100; i { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - } + } // CHECK-LABEL: sil hidden @{{.*}}for_loops2 diff --git a/test/SILGen/unreachable_code.swift b/test/SILGen/unreachable_code.swift index 86488911f6e..22859b74c68 100644 --- a/test/SILGen/unreachable_code.swift +++ b/test/SILGen/unreachable_code.swift @@ -16,7 +16,7 @@ func testUnreachableAfterIfReturn(a: Bool) -> Int { } func testUnreachableForAfterContinue(b: Bool) { - for (var i:Int = 0; i<10; i+=1) { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} + for _ in 0..<10 { var y: Int = 300 y += 1 if b { @@ -43,9 +43,8 @@ func testUnreachableWhileAfterContinue(b: Bool) { } func testBreakAndContinue() { - var i = 0 var m = 0 - for (i = 0; i < 10; i += 1) { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} + for _ in 0 ..< 10 { m += 1 if m == 15 { break diff --git a/test/Sema/diag_c_style_for.swift b/test/Sema/diag_c_style_for.swift index e16c0d8bb36..47d50f4c4e6 100644 --- a/test/Sema/diag_c_style_for.swift +++ b/test/Sema/diag_c_style_for.swift @@ -1,57 +1,57 @@ // RUN: %target-parse-verify-swift -// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}} -for var a = 0; a < 10; a++ { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{5-9=}} {{10-13= in }} {{14-20= ..< }} {{22-27=}} +// expected-error @+1 {{'++' is unavailable: it has been removed in Swift 3}} +for var a = 0; a < 10; a++ { // expected-error {{C-style for statement has been removed in Swift 3}} {{5-9=}} {{10-13= in }} {{14-20= ..< }} {{22-27=}} } -// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}} -for var b = 0; b < 10; ++b { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{5-9=}} {{10-13= in }} {{14-20= ..< }} {{22-27=}} +// expected-error @+1 {{'++' is unavailable: it has been removed in Swift 3}} +for var b = 0; b < 10; ++b { // expected-error {{C-style for statement has been removed in Swift 3}} {{5-9=}} {{10-13= in }} {{14-20= ..< }} {{22-27=}} } -// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}} -for var c=1;c != 5 ;++c { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{5-9=}} {{10-11= in }} {{12-18= ..< }} {{20-24=}} +// expected-error @+1 {{'++' is unavailable: it has been removed in Swift 3}} +for var c=1;c != 5 ;++c { // expected-error {{C-style for statement has been removed in Swift 3}} {{5-9=}} {{10-11= in }} {{12-18= ..< }} {{20-24=}} } -// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}} -for var d=100;d<5;d++ { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{5-9=}} {{10-11= in }} {{14-17= ..< }} {{18-22=}} +// expected-error @+1 {{'++' is unavailable: it has been removed in Swift 3}} +for var d=100;d<5;d++ { // expected-error {{C-style for statement has been removed in Swift 3}} {{5-9=}} {{10-11= in }} {{14-17= ..< }} {{18-22=}} } // next three aren't auto-fixable -// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}} -for var e = 3; e > 4; e++ { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}} +// expected-error @+1 {{'++' is unavailable: it has been removed in Swift 3}} +for var e = 3; e > 4; e++ { // expected-error {{C-style for statement has been removed in Swift 3}} {{none}} } -// expected-warning @+1 {{'--' is deprecated: it will be removed in Swift 3}} -for var f = 3; f < 4; f-- { // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} {{none}} +// expected-error @+1 {{'--' is unavailable: it has been removed in Swift 3}} +for var f = 3; f < 4; f-- { // expected-error {{C-style for statement has been removed in Swift 3}} {{none}} } let start = Int8(4) let count = Int8(10) var other = Int8(2) -// expected-warning @+1 {{'++' is deprecated: it will be removed in Swift 3}} -for ; other(_ t: T) throws -> T { return t } -@warn_unused_result(message="you might want to keep it") +@warn_unused_result(message: "you might want to keep it") public func mineGold() -> Int { return 1 } public struct Foo { public init() { } - @warn_unused_result(mutable_variant="reverseInPlace") + @warn_unused_result(mutable_variant: "reverseInPlace") public func reverse() -> Foo { return self } public mutating func reverseInPlace() { } diff --git a/test/SourceKit/CodeComplete/Inputs/custom-completion/custom.json b/test/SourceKit/CodeComplete/Inputs/custom-completion/custom.json index 6a2554a4216..581c5b72889 100644 --- a/test/SourceKit/CodeComplete/Inputs/custom-completion/custom.json +++ b/test/SourceKit/CodeComplete/Inputs/custom-completion/custom.json @@ -4,17 +4,17 @@ { key.name: "customExpr", key.kind: myuid.customExpr, - key.context: [ source.lang.swift.expr ] + key.context: [source.lang.swift.expr] }, { key.name: "customStmt", key.kind: myuid.customStmt, - key.context: [ source.lang.swift.stmt ] + key.context: [source.lang.swift.stmt] }, { key.name: "customType", key.kind: myuid.customType, - key.context: [ source.lang.swift.type ] + key.context: [source.lang.swift.type] }, { key.name: "customExprOrStmtOrType", diff --git a/test/SourceKit/CodeComplete/Inputs/filter-rules/hideModules.json b/test/SourceKit/CodeComplete/Inputs/filter-rules/hideModules.json index 601b7ff9846..4ecce5ff426 100644 --- a/test/SourceKit/CodeComplete/Inputs/filter-rules/hideModules.json +++ b/test/SourceKit/CodeComplete/Inputs/filter-rules/hideModules.json @@ -2,11 +2,11 @@ { key.kind: source.codecompletion.module, key.hide: 1, - key.names: [ "Foo" ] + key.names: ["Foo"] }, { key.kind: source.codecompletion.identifier, key.hide: 0, - key.names: [ "FooStruct2" ] + key.names: ["FooStruct2"] } ] diff --git a/test/SourceKit/CodeComplete/Inputs/filter-rules/showSpecific.json b/test/SourceKit/CodeComplete/Inputs/filter-rules/showSpecific.json index e5355a3e8d0..6e3f8381755 100644 --- a/test/SourceKit/CodeComplete/Inputs/filter-rules/showSpecific.json +++ b/test/SourceKit/CodeComplete/Inputs/filter-rules/showSpecific.json @@ -6,11 +6,11 @@ { key.kind: source.codecompletion.identifier, key.hide: 0, - key.names: [ "myFunFunction1()" ] + key.names: ["myFunFunction1()"] }, { key.kind: source.codecompletion.keyword, key.hide: 0, - key.uids: [ source.lang.swift.keyword.func ] + key.uids: [source.lang.swift.keyword.func] } ] diff --git a/test/SourceKit/DocSupport/doc_clang_module.swift.response b/test/SourceKit/DocSupport/doc_clang_module.swift.response index 5a320882604..d1604f8436b 100644 --- a/test/SourceKit/DocSupport/doc_clang_module.swift.response +++ b/test/SourceKit/DocSupport/doc_clang_module.swift.response @@ -87,6 +87,10 @@ enum FooComparisonResult : Int { init?(_ text: String, radix radix: Int = default) init(_ objectID: ObjectIdentifier) + + init(bitPattern bitPattern: UnsafeMutablePointer?) + + init(bitPattern bitPattern: UnsafePointer?) } extension FooComparisonResult : BitwiseOperations { @@ -1893,564 +1897,560 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1813, + key.offset: 1815, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 1820, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 1823, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 1834, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 1823, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 1834, + key.length: 10 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "UnsafeMutablePointer", + key.usr: "s:Sp", + key.offset: 1846, + key.length: 20 + }, + { + key.kind: source.lang.swift.syntaxtype.typeidentifier, + key.offset: 1867, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 1877, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 1882, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 1885, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 1896, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 1885, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 1896, + key.length: 10 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "UnsafePointer", + key.usr: "s:SP", + key.offset: 1908, + key.length: 13 + }, + { + key.kind: source.lang.swift.syntaxtype.typeidentifier, + key.offset: 1922, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 1930, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 1823, + key.offset: 1940, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "BitwiseOperations", key.usr: "s:Ps17BitwiseOperations", - key.offset: 1845, + key.offset: 1962, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1870, + key.offset: 1987, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1877, + key.offset: 1994, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1881, + key.offset: 1998, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 1891, + key.offset: 2008, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1897, + key.offset: 2014, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1906, + key.offset: 2023, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 1916, + key.offset: 2033, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "CustomStringConvertible", key.usr: "s:Ps23CustomStringConvertible", - key.offset: 1938, + key.offset: 2055, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 1969, + key.offset: 2086, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1973, + key.offset: 2090, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "String", key.usr: "s:SS", - key.offset: 1986, + key.offset: 2103, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 1995, + key.offset: 2112, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2004, + key.offset: 2121, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 2014, + key.offset: 2131, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Hashable", key.usr: "s:Ps8Hashable", - key.offset: 2036, + key.offset: 2153, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2052, + key.offset: 2169, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2056, + key.offset: 2173, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 2067, + key.offset: 2184, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2073, + key.offset: 2190, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2082, + key.offset: 2199, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 2092, + key.offset: 2209, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "SignedNumber", key.usr: "s:Ps12SignedNumber", - key.offset: 2114, + key.offset: 2231, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2132, + key.offset: 2249, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 2142, + key.offset: 2259, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "CustomReflectable", key.usr: "s:Ps17CustomReflectable", - key.offset: 2164, + key.offset: 2281, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2189, + key.offset: 2306, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2193, + key.offset: 2310, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "Mirror", key.usr: "s:Vs6Mirror", - key.offset: 2207, + key.offset: 2324, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2216, + key.offset: 2333, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2225, + key.offset: 2342, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 2235, + key.offset: 2352, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "CustomPlaygroundQuickLookable", key.usr: "s:Ps29CustomPlaygroundQuickLookable", - key.offset: 2257, + key.offset: 2374, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2294, + key.offset: 2411, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2298, + key.offset: 2415, key.length: 25 }, { key.kind: source.lang.swift.ref.enum, key.name: "PlaygroundQuickLook", key.usr: "s:Os19PlaygroundQuickLook", - key.offset: 2325, + key.offset: 2442, key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2347, + key.offset: 2464, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2356, + key.offset: 2473, key.length: 9 }, { key.kind: source.lang.swift.ref.enum, key.name: "FooComparisonResult", key.usr: "c:@E@FooComparisonResult", - key.offset: 2366, + key.offset: 2483, key.length: 19 }, { key.kind: source.lang.swift.ref.protocol, key.name: "CVarArg", key.usr: "s:Ps7CVarArg", - key.offset: 2388, + key.offset: 2505, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2400, + key.offset: 2517, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2407, + key.offset: 2524, key.length: 17 }, { key.kind: source.lang.swift.ref.protocol, key.name: "OptionSet", key.usr: "s:Ps9OptionSet", - key.offset: 2427, + key.offset: 2544, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2444, + key.offset: 2561, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2449, + key.offset: 2566, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2458, + key.offset: 2575, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2449, + key.offset: 2566, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2458, + key.offset: 2575, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 2468, + key.offset: 2585, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2478, + key.offset: 2595, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2485, + key.offset: 2602, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2489, + key.offset: 2606, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 2502, + key.offset: 2619, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2522, + key.offset: 2639, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2533, + key.offset: 2650, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2540, + key.offset: 2657, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2544, + key.offset: 2661, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 2558, + key.offset: 2675, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2578, + key.offset: 2695, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2587, + key.offset: 2704, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 2597, + key.offset: 2714, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2622, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2627, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2633, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2635, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2635, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2642, - key.length: 4 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2651, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2661, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2666, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2676, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2678, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2678, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2685, - key.length: 4 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2694, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2704, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2709, - key.length: 11 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2721, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2723, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2723, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2730, - key.length: 4 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", key.offset: 2739, key.length: 4 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2747, - key.length: 9 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "FooRuncingOptions", - key.usr: "c:@E@FooRuncingOptions", - key.offset: 2757, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2782, - key.length: 4 - }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2787, - key.length: 8 + key.offset: 2744, + key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2796, + key.offset: 2750, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2798, - key.length: 6 + key.offset: 2752, + key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2798, - key.length: 6 + key.offset: 2752, + key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2806, + key.offset: 2759, key.length: 4 }, { - key.kind: source.lang.swift.ref.struct, - key.name: "Bool", - key.usr: "s:Sb", - key.offset: 2815, + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 2768, key.length: 4 }, - { - key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2825, - key.length: 8 - }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2834, + key.offset: 2778, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2839, - key.length: 6 + key.offset: 2783, + key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2846, + key.offset: 2793, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2848, - key.length: 6 + key.offset: 2795, + key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2848, - key.length: 6 + key.offset: 2795, + key.length: 5 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 2802, + key.length: 4 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 2811, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 2821, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 2826, + key.length: 11 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 2838, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 2840, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 2840, + key.length: 5 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 2847, + key.length: 4 }, { key.kind: source.lang.swift.ref.generic_type_param, @@ -2459,1326 +2459,1295 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.offset: 2856, key.length: 4 }, - { - key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2867, - key.length: 8 - }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2876, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2881, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 2888, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 2890, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2890, - key.length: 6 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2898, - key.length: 4 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 2907, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2916, + key.offset: 2864, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 2926, + key.offset: 2874, key.length: 17 }, - { - key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2951, - key.length: 11 - }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2963, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 2975, - key.length: 8 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 2984, + key.offset: 2899, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 2989, + key.offset: 2904, + key.length: 8 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 2913, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 2915, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 2915, + key.length: 6 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 2923, + key.length: 4 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Bool", + key.usr: "s:Sb", + key.offset: 2932, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.attribute.builtin, + key.offset: 2942, + key.length: 8 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 2951, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 2956, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 2963, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 2965, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 2965, + key.length: 6 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 2973, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.attribute.builtin, + key.offset: 2984, + key.length: 8 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 2993, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 2998, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 3005, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 3007, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3007, + key.length: 6 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 3015, + key.length: 4 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs9OptionSet4SelfMx", + key.offset: 3024, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 3033, + key.length: 9 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "FooRuncingOptions", + key.usr: "c:@E@FooRuncingOptions", + key.offset: 3043, + key.length: 17 + }, + { + key.kind: source.lang.swift.syntaxtype.attribute.builtin, + key.offset: 3068, + key.length: 11 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 3080, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.attribute.builtin, + key.offset: 3092, + key.length: 8 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 3101, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3106, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3002, + key.offset: 3119, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3004, + key.offset: 3121, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3004, + key.offset: 3121, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 3011, + key.offset: 3128, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3022, + key.offset: 3139, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3031, + key.offset: 3148, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3036, + key.offset: 3153, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3053, + key.offset: 3170, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3055, + key.offset: 3172, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3055, + key.offset: 3172, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 3062, + key.offset: 3179, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3073, + key.offset: 3190, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3082, + key.offset: 3199, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3087, + key.offset: 3204, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3106, + key.offset: 3223, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3108, + key.offset: 3225, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3108, + key.offset: 3225, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs9OptionSet4SelfMx", - key.offset: 3115, + key.offset: 3232, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3124, + key.offset: 3241, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 3134, + key.offset: 3251, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3159, + key.offset: 3276, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3171, + key.offset: 3288, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3176, + key.offset: 3293, key.length: 1 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Sequence", key.usr: "s:Ps8Sequence", - key.offset: 3180, + key.offset: 3297, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3189, + key.offset: 3306, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3195, + key.offset: 3312, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3197, + key.offset: 3314, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3206, + key.offset: 3323, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3217, + key.offset: 3334, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3236, + key.offset: 3353, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3238, + key.offset: 3355, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3238, + key.offset: 3355, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.typeidentifier, - key.offset: 3248, + key.offset: 3365, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3256, + key.offset: 3373, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3268, + key.offset: 3385, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3273, + key.offset: 3390, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3286, + key.offset: 3403, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3273, + key.offset: 3390, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3286, + key.offset: 3403, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 3300, + key.offset: 3417, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 3327, + key.offset: 3444, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3336, + key.offset: 3453, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3341, + key.offset: 3458, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3357, + key.offset: 3474, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3359, + key.offset: 3476, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3359, + key.offset: 3476, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3366, + key.offset: 3483, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3377, + key.offset: 3494, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3382, + key.offset: 3499, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3393, + key.offset: 3510, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3395, + key.offset: 3512, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3395, + key.offset: 3512, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3402, + key.offset: 3519, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 3411, + key.offset: 3528, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3421, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3426, - key.length: 12 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3439, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3441, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3441, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3448, - key.length: 4 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Bool", - key.usr: "s:Sb", - key.offset: 3457, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3467, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3472, - key.length: 14 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3487, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3489, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3489, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3496, - key.length: 4 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Bool", - key.usr: "s:Sb", - key.offset: 3505, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3515, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3520, - key.length: 8 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3529, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3531, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3531, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.generic_type_param, - key.name: "Self", - key.usr: "s:tPs10SetAlgebra4SelfMx", key.offset: 3538, key.length: 4 }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3543, + key.length: 12 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 3556, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 3558, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3558, + key.length: 5 + }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3547, + key.offset: 3565, + key.length: 4 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Bool", + key.usr: "s:Sb", + key.offset: 3574, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3557, + key.offset: 3584, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3589, + key.length: 14 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 3604, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 3606, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3606, + key.length: 5 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs10SetAlgebra4SelfMx", + key.offset: 3613, + key.length: 4 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Bool", + key.usr: "s:Sb", + key.offset: 3622, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 3632, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3637, + key.length: 8 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 3646, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 3648, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 3648, + key.length: 5 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs10SetAlgebra4SelfMx", + key.offset: 3655, + key.length: 4 + }, + { + key.kind: source.lang.swift.ref.generic_type_param, + key.name: "Self", + key.usr: "s:tPs10SetAlgebra4SelfMx", + key.offset: 3664, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 3674, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3561, + key.offset: 3678, key.length: 7 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 3570, + key.offset: 3687, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3577, + key.offset: 3694, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3588, + key.offset: 3705, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3593, + key.offset: 3710, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3612, + key.offset: 3729, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3614, + key.offset: 3731, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3614, + key.offset: 3731, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3621, + key.offset: 3738, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 3630, + key.offset: 3747, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3640, + key.offset: 3757, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3645, + key.offset: 3762, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3662, + key.offset: 3779, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3664, + key.offset: 3781, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3664, + key.offset: 3781, key.length: 5 }, { key.kind: source.lang.swift.ref.generic_type_param, key.name: "Self", key.usr: "s:tPs10SetAlgebra4SelfMx", - key.offset: 3671, + key.offset: 3788, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 3680, + key.offset: 3797, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3690, + key.offset: 3807, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3697, + key.offset: 3814, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3702, + key.offset: 3819, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3710, + key.offset: 3827, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3712, + key.offset: 3829, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3712, + key.offset: 3829, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 3715, + key.offset: 3832, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3734, + key.offset: 3851, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3743, + key.offset: 3860, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3734, + key.offset: 3851, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3743, + key.offset: 3860, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 3746, + key.offset: 3863, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 3768, + key.offset: 3885, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3778, + key.offset: 3895, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3785, + key.offset: 3902, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3790, + key.offset: 3907, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3798, + key.offset: 3915, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3800, + key.offset: 3917, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3800, + key.offset: 3917, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 3803, + key.offset: 3920, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3822, + key.offset: 3939, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3837, + key.offset: 3954, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3822, + key.offset: 3939, key.length: 14 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3837, + key.offset: 3954, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", - key.offset: 3840, + key.offset: 3957, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, key.name: "Bool", key.usr: "s:Sb", - key.offset: 3862, + key.offset: 3979, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3869, + key.offset: 3986, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3876, + key.offset: 3993, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3894, + key.offset: 4011, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3898, + key.offset: 4015, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 3901, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3912, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3916, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Double", - key.usr: "s:Sd", - key.offset: 3919, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3931, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3943, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3948, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3950, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3948, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3950, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 3953, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 3960, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 3962, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3960, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3962, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Double", - key.usr: "s:Sd", - key.offset: 3965, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 3975, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 3982, - key.length: 10 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4000, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4004, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 4007, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 4018, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4029, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4022, + key.offset: 4033, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Double", key.usr: "s:Sd", - key.offset: 4025, + key.offset: 4036, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4037, + key.offset: 4048, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4049, + key.offset: 4060, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4054, + key.offset: 4065, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4056, + key.offset: 4067, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4054, + key.offset: 4065, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4056, + key.offset: 4067, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4059, + key.offset: 4070, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4066, + key.offset: 4077, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4068, + key.offset: 4079, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4066, + key.offset: 4077, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4068, + key.offset: 4079, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Double", key.usr: "s:Sd", - key.offset: 4071, + key.offset: 4082, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4081, + key.offset: 4092, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4099, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4117, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4121, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 4124, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4135, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4139, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Double", + key.usr: "s:Sd", + key.offset: 4142, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4154, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4166, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4171, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4173, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4171, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4173, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 4176, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4183, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4185, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4183, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4185, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Double", + key.usr: "s:Sd", + key.offset: 4188, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4198, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4091, + key.offset: 4208, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooStruct2", key.usr: "c:@S@FooStruct2", - key.offset: 4111, + key.offset: 4228, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4122, + key.offset: 4239, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4129, + key.offset: 4246, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4154, + key.offset: 4271, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4158, + key.offset: 4275, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4161, + key.offset: 4278, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4172, + key.offset: 4289, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4176, + key.offset: 4293, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Double", key.usr: "s:Sd", - key.offset: 4179, + key.offset: 4296, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4191, + key.offset: 4308, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4203, + key.offset: 4320, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4208, + key.offset: 4325, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4210, + key.offset: 4327, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4208, + key.offset: 4325, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4210, + key.offset: 4327, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4213, + key.offset: 4330, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4220, + key.offset: 4337, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4222, + key.offset: 4339, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4220, + key.offset: 4337, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4222, + key.offset: 4339, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Double", key.usr: "s:Sd", - key.offset: 4225, + key.offset: 4342, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4235, + key.offset: 4352, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4245, + key.offset: 4362, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4259, + key.offset: 4376, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4265, + key.offset: 4382, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4269, + key.offset: 4386, key.length: 9 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4280, + key.offset: 4397, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4286, + key.offset: 4403, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4291, + key.offset: 4408, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4300, + key.offset: 4417, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4302, + key.offset: 4419, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4302, + key.offset: 4419, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4305, + key.offset: 4422, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4315, + key.offset: 4432, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4321, + key.offset: 4438, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4326, + key.offset: 4443, key.length: 22 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4349, + key.offset: 4466, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4351, + key.offset: 4468, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4354, + key.offset: 4471, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4364, + key.offset: 4481, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4370, + key.offset: 4487, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4375, + key.offset: 4492, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4384, + key.offset: 4501, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4386, + key.offset: 4503, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4386, + key.offset: 4503, key.length: 1 }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 4389, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4396, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4398, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4398, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Float", - key.usr: "s:Sf", - key.offset: 4401, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4408, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4410, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4410, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Double", - key.usr: "s:Sd", - key.offset: 4413, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4421, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4423, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4423, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "UnsafeMutablePointer", - key.usr: "s:Sp", - key.offset: 4426, - key.length: 20 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 4447, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 4459, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4465, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4470, - key.length: 16 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4487, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4489, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4489, - key.length: 3 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Float", - key.usr: "s:Sf", - key.offset: 4496, - key.length: 5 - }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", @@ -3786,1237 +3755,1300 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.offset: 4506, key.length: 5 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4515, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4520, - key.length: 26 - }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4547, + key.offset: 4513, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4549, + key.offset: 4515, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4515, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Float", + key.usr: "s:Sf", + key.offset: 4518, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4525, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4527, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4527, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Double", + key.usr: "s:Sd", + key.offset: 4530, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4538, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4540, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4540, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "UnsafeMutablePointer", + key.usr: "s:Sp", + key.offset: 4543, + key.length: 20 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 4564, + key.length: 5 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 4576, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4582, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4549, + key.offset: 4587, + key.length: 16 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4604, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4606, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4606, + key.length: 3 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Float", + key.usr: "s:Sf", + key.offset: 4613, + key.length: 5 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 4623, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4632, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4637, + key.length: 26 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4664, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4666, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4666, key.length: 4 }, { key.kind: source.lang.swift.ref.struct, key.name: "Float", key.usr: "s:Sf", - key.offset: 4557, + key.offset: 4674, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 4567, + key.offset: 4684, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4576, + key.offset: 4693, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4586, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4591, - key.length: 16 - }, - { - key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 4610, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4620, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4625, - key.length: 16 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4644, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4649, - key.length: 19 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4671, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4676, - key.length: 19 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4698, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, key.offset: 4703, - key.length: 19 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4725, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4730, - key.length: 19 + key.offset: 4708, + key.length: 16 + }, + { + key.kind: source.lang.swift.syntaxtype.attribute.builtin, + key.offset: 4727, + key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4752, + key.offset: 4737, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4757, - key.length: 19 + key.offset: 4742, + key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4779, + key.offset: 4761, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4784, - key.length: 32 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 4817, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 4819, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4819, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 4822, - key.length: 5 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 4832, - key.length: 5 + key.offset: 4766, + key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4838, - key.length: 8 + key.offset: 4788, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4793, + key.length: 19 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4815, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4820, + key.length: 19 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4842, + key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, key.offset: 4847, - key.length: 15 + key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4870, + key.offset: 4869, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4875, - key.length: 12 + key.offset: 4874, + key.length: 19 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4895, + key.offset: 4896, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4900, - key.length: 33 + key.offset: 4901, + key.length: 32 }, { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4941, - key.length: 4 + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 4934, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 4936, + key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4946, - key.length: 33 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4987, - key.length: 6 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 4994, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 4999, - key.length: 17 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5024, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5028, - key.length: 12 + key.offset: 4936, + key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 5042, + key.offset: 4939, key.length: 5 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5050, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5054, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5065, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5069, - key.length: 12 - }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 5083, + key.offset: 4949, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5091, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5095, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5106, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5110, - key.length: 12 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 5124, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5132, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5140, + key.offset: 4955, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5149, + key.offset: 4964, + key.length: 15 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 4987, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 4992, + key.length: 12 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5012, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5017, + key.length: 33 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5058, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5063, + key.length: 33 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5104, + key.length: 6 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5111, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5116, + key.length: 17 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5141, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5145, + key.length: 12 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 5159, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5167, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5171, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5182, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5186, + key.length: 12 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 5200, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5208, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5212, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5223, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5227, + key.length: 12 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 5241, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5249, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5257, + key.length: 8 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5266, key.length: 18 }, { key.kind: source.lang.swift.ref.protocol, key.name: "FooProtocolBase", key.usr: "c:objc(pl)FooProtocolBase", - key.offset: 5170, + key.offset: 5287, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5190, + key.offset: 5307, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5196, + key.offset: 5313, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5216, + key.offset: 5333, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5221, + key.offset: 5338, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5249, + key.offset: 5366, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5254, + key.offset: 5371, key.length: 20 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 5275, + key.offset: 5392, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 5277, + key.offset: 5394, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5277, + key.offset: 5394, key.length: 8 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 5287, + key.offset: 5404, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "FooClassBase", key.usr: "c:objc(cs)FooClassBase", - key.offset: 5302, + key.offset: 5419, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5321, + key.offset: 5438, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 5334, + key.offset: 5451, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5346, + key.offset: 5463, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 5352, + key.offset: 5469, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 5358, + key.offset: 5475, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5352, + key.offset: 5469, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5358, + key.offset: 5475, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Float", key.usr: "s:Sf", - key.offset: 5361, + key.offset: 5478, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5373, + key.offset: 5490, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5378, + key.offset: 5495, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5415, + key.offset: 5532, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5421, + key.offset: 5538, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5426, + key.offset: 5543, key.length: 17 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5451, + key.offset: 5568, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5456, + key.offset: 5573, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 5476, + key.offset: 5593, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5492, + key.offset: 5609, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5497, + key.offset: 5614, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 5517, + key.offset: 5634, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5533, + key.offset: 5650, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5538, + key.offset: 5655, key.length: 15 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 5559, + key.offset: 5676, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5575, + key.offset: 5692, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5580, + key.offset: 5697, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 5600, + key.offset: 5717, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5613, + key.offset: 5730, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5619, + key.offset: 5736, key.length: 15 }, { key.kind: source.lang.swift.ref.class, key.name: "FooClassBase", key.usr: "c:objc(cs)FooClassBase", - key.offset: 5637, + key.offset: 5754, key.length: 12 }, { key.kind: source.lang.swift.ref.protocol, key.name: "FooProtocolDerived", key.usr: "c:objc(pl)FooProtocolDerived", - key.offset: 5651, + key.offset: 5768, key.length: 18 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5677, + key.offset: 5794, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5681, + key.offset: 5798, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 5695, + key.offset: 5812, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5706, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5710, - key.length: 12 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 5724, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5735, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5739, - key.length: 12 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 5753, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5761, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5772, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5777, - key.length: 16 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5801, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5806, - key.length: 16 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, key.offset: 5823, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 5825, - key.length: 1 + key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5825, - key.length: 1 + key.offset: 5827, + key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 5828, + key.offset: 5841, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5840, + key.offset: 5852, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5856, + key.length: 12 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 5870, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5878, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5889, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5845, + key.offset: 5894, + key.length: 16 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 5918, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5923, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 5862, + key.offset: 5940, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 5864, + key.offset: 5942, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5864, + key.offset: 5942, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 5867, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 5874, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 5880, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5874, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5880, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 5883, + key.offset: 5945, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5895, + key.offset: 5957, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5900, + key.offset: 5962, + key.length: 16 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 5979, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 5981, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5981, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 5984, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 5991, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 5997, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5991, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 5997, + key.length: 1 + }, + { + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 6000, + key.length: 5 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 6012, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 6017, key.length: 29 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5937, + key.offset: 6054, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5943, + key.offset: 6060, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5948, + key.offset: 6065, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 5969, + key.offset: 6086, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 5974, + key.offset: 6091, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 5994, + key.offset: 6111, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6010, + key.offset: 6127, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6015, + key.offset: 6132, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 6035, + key.offset: 6152, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6051, + key.offset: 6168, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6056, + key.offset: 6173, key.length: 15 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 6077, + key.offset: 6194, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6093, + key.offset: 6210, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6098, + key.offset: 6215, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 6118, + key.offset: 6235, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6131, + key.offset: 6248, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6135, + key.offset: 6252, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 6148, + key.offset: 6265, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6156, + key.offset: 6273, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6162, + key.offset: 6279, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6166, + key.offset: 6283, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 6179, + key.offset: 6296, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6187, + key.offset: 6304, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6193, + key.offset: 6310, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6197, + key.offset: 6314, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 6210, + key.offset: 6327, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6218, + key.offset: 6335, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6224, + key.offset: 6341, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6228, + key.offset: 6345, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:Vs6UInt32", - key.offset: 6241, + key.offset: 6358, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6250, + key.offset: 6367, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6256, + key.offset: 6373, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6260, + key.offset: 6377, key.length: 11 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt64", key.usr: "s:Vs6UInt64", - key.offset: 6273, + key.offset: 6390, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6282, + key.offset: 6399, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6288, + key.offset: 6405, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6292, + key.offset: 6409, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 6311, + key.offset: 6428, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6319, + key.offset: 6436, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6325, + key.offset: 6442, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6329, + key.offset: 6446, key.length: 17 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 6348, + key.offset: 6465, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6356, + key.offset: 6473, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6362, + key.offset: 6479, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6367, + key.offset: 6484, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6386, + key.offset: 6503, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6391, + key.offset: 6508, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6415, + key.offset: 6532, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6422, + key.offset: 6539, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6445, + key.offset: 6562, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6449, + key.offset: 6566, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 6452, + key.offset: 6569, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6463, + key.offset: 6580, key.length: 4 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6475, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 6480, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 6482, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6480, - key.length: 1 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6482, - key.length: 1 - }, - { - key.kind: source.lang.swift.ref.struct, - key.name: "Int32", - key.usr: "s:Vs5Int32", - key.offset: 6485, - key.length: 5 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6494, - key.length: 9 - }, - { - key.kind: source.lang.swift.ref.class, - key.name: "FooClassBase", - key.usr: "c:objc(cs)FooClassBase", - key.offset: 6504, - key.length: 12 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6524, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6529, - key.length: 14 - }, - { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 6549, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6562, - key.length: 9 - }, - { - key.kind: source.lang.swift.ref.class, - key.name: "FooClassBase", - key.usr: "c:objc(cs)FooClassBase", - key.offset: 6572, - key.length: 12 - }, { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 6592, key.length: 4 }, + { + key.kind: source.lang.swift.syntaxtype.argument, + key.offset: 6597, + key.length: 1 + }, + { + key.kind: source.lang.swift.syntaxtype.parameter, + key.offset: 6599, + key.length: 1 + }, { key.kind: source.lang.swift.syntaxtype.identifier, key.offset: 6597, - key.length: 14 - }, - { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 6617, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6633, - key.length: 4 + key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6638, - key.length: 15 + key.offset: 6599, + key.length: 1 }, { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 6659, - key.length: 9 + key.kind: source.lang.swift.ref.struct, + key.name: "Int32", + key.usr: "s:Vs5Int32", + key.offset: 6602, + key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6672, + key.offset: 6611, key.length: 9 }, { key.kind: source.lang.swift.ref.class, key.name: "FooClassBase", key.usr: "c:objc(cs)FooClassBase", - key.offset: 6682, + key.offset: 6621, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6702, + key.offset: 6641, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6707, + key.offset: 6646, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 6727, + key.offset: 6666, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6740, + key.offset: 6679, + key.length: 9 + }, + { + key.kind: source.lang.swift.ref.class, + key.name: "FooClassBase", + key.usr: "c:objc(cs)FooClassBase", + key.offset: 6689, + key.length: 12 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 6709, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 6714, + key.length: 14 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 6734, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 6750, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 6755, + key.length: 15 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 6776, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 6789, + key.length: 9 + }, + { + key.kind: source.lang.swift.ref.class, + key.name: "FooClassBase", + key.usr: "c:objc(cs)FooClassBase", + key.offset: 6799, + key.length: 12 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 6819, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 6824, + key.length: 14 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 6844, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 6857, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6749, + key.offset: 6866, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6767, + key.offset: 6884, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6773, + key.offset: 6890, key.length: 21 }, { key.kind: source.lang.swift.ref.protocol, key.name: "_InternalProt", key.usr: "c:objc(pl)_InternalProt", - key.offset: 6797, + key.offset: 6914, key.length: 13 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6815, + key.offset: 6932, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6821, + key.offset: 6938, key.length: 25 }, { key.kind: source.lang.swift.ref.class, key.name: "FooClassBase", key.usr: "c:objc(cs)FooClassBase", - key.offset: 6849, + key.offset: 6966, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6869, + key.offset: 6986, key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6885, + key.offset: 7002, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6889, + key.offset: 7006, key.length: 10 }, - { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 6901, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 6917, - key.length: 15 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6933, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6937, - key.length: 16 - }, - { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 6955, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 6971, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 6975, - key.length: 10 - }, - { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 6987, - key.length: 9 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7003, - key.length: 3 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7007, - key.length: 9 - }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", @@ -5027,357 +5059,376 @@ var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.syntaxtype.attribute.builtin, key.offset: 7034, - key.length: 10 + key.length: 15 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7045, + key.offset: 7050, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7049, + key.offset: 7054, + key.length: 16 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 7072, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 7088, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 7092, + key.length: 10 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 7104, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 7120, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 7124, + key.length: 9 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 7135, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.attribute.builtin, + key.offset: 7151, + key.length: 10 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 7162, + key.length: 3 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 7166, key.length: 8 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7059, + key.offset: 7176, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 7075, + key.offset: 7192, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7080, + key.offset: 7197, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7084, + key.offset: 7201, key.length: 7 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7093, + key.offset: 7210, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7109, + key.offset: 7226, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7113, + key.offset: 7230, key.length: 6 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 7121, + key.offset: 7238, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7132, + key.offset: 7249, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7137, + key.offset: 7254, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7157, + key.offset: 7274, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7173, + key.offset: 7290, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7178, + key.offset: 7295, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7198, + key.offset: 7315, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7214, + key.offset: 7331, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7219, + key.offset: 7336, key.length: 15 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7240, + key.offset: 7357, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7256, + key.offset: 7373, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7261, + key.offset: 7378, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7281, + key.offset: 7398, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7294, + key.offset: 7411, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7300, + key.offset: 7417, key.length: 21 }, { key.kind: source.lang.swift.ref.class, key.name: "FooClassBase", key.usr: "c:objc(cs)FooClassBase", - key.offset: 7324, + key.offset: 7441, key.length: 12 }, { key.kind: source.lang.swift.syntaxtype.attribute.builtin, - key.offset: 7344, + key.offset: 7461, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7356, + key.offset: 7473, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 7362, + key.offset: 7479, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 7366, + key.offset: 7483, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7362, + key.offset: 7479, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7366, + key.offset: 7483, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 7369, + key.offset: 7486, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7381, + key.offset: 7498, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7387, + key.offset: 7504, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7392, + key.offset: 7509, key.length: 7 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 7400, + key.offset: 7517, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 7402, + key.offset: 7519, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7402, + key.offset: 7519, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 7405, + key.offset: 7522, key.length: 5 }, { key.kind: source.lang.swift.ref.class, key.name: "FooUnavailableMembers", key.usr: "c:objc(cs)FooUnavailableMembers", - key.offset: 7415, + key.offset: 7532, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7426, + key.offset: 7543, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7431, + key.offset: 7548, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7450, + key.offset: 7567, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7455, + key.offset: 7572, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7479, + key.offset: 7596, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7484, + key.offset: 7601, key.length: 10 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7502, + key.offset: 7619, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7507, + key.offset: 7624, key.length: 22 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7537, + key.offset: 7654, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7542, + key.offset: 7659, key.length: 22 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7572, + key.offset: 7689, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7577, + key.offset: 7694, key.length: 21 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7606, + key.offset: 7723, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7611, + key.offset: 7728, key.length: 23 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7642, + key.offset: 7759, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7647, + key.offset: 7764, key.length: 25 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7680, + key.offset: 7797, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7685, + key.offset: 7802, key.length: 25 }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7718, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7723, - key.length: 24 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7755, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7760, - key.length: 26 - }, - { - key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7794, - key.length: 4 - }, - { - key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7799, - key.length: 14 - }, - { - key.kind: source.lang.swift.ref.protocol, - key.name: "AnyObject", - key.usr: "s:Ps9AnyObject", - key.offset: 7819, - key.length: 9 - }, { key.kind: source.lang.swift.syntaxtype.keyword, key.offset: 7835, @@ -5386,306 +5437,343 @@ var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.syntaxtype.identifier, key.offset: 7840, + key.length: 24 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 7872, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 7877, + key.length: 26 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 7911, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 7916, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7860, + key.offset: 7936, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7876, + key.offset: 7952, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7881, + key.offset: 7957, + key.length: 14 + }, + { + key.kind: source.lang.swift.ref.protocol, + key.name: "AnyObject", + key.usr: "s:Ps9AnyObject", + key.offset: 7977, + key.length: 9 + }, + { + key.kind: source.lang.swift.syntaxtype.keyword, + key.offset: 7993, + key.length: 4 + }, + { + key.kind: source.lang.swift.syntaxtype.identifier, + key.offset: 7998, key.length: 15 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7902, + key.offset: 8019, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7918, + key.offset: 8035, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7923, + key.offset: 8040, key.length: 14 }, { key.kind: source.lang.swift.ref.protocol, key.name: "AnyObject", key.usr: "s:Ps9AnyObject", - key.offset: 7943, + key.offset: 8060, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7956, + key.offset: 8073, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7966, + key.offset: 8083, key.length: 12 }, { key.kind: source.lang.swift.ref.class, key.name: "FooCFType", key.usr: "c:Foo.h@T@FooCFTypeRef", - key.offset: 7981, + key.offset: 8098, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 7991, + key.offset: 8108, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 7997, + key.offset: 8114, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8011, + key.offset: 8128, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8016, + key.offset: 8133, key.length: 16 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 8033, + key.offset: 8150, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 8035, + key.offset: 8152, key.length: 1 }, { key.kind: source.lang.swift.ref.class, key.name: "FooCFType", key.usr: "c:Foo.h@T@FooCFTypeRef", - key.offset: 8038, + key.offset: 8155, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8050, + key.offset: 8167, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8055, + key.offset: 8172, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 8067, + key.offset: 8184, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 8069, + key.offset: 8186, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8069, + key.offset: 8186, key.length: 1 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 8072, + key.offset: 8189, key.length: 5 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int32", key.usr: "s:Vs5Int32", - key.offset: 8082, + key.offset: 8199, key.length: 5 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8088, + key.offset: 8205, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8095, + key.offset: 8212, key.length: 11 }, { key.kind: source.lang.swift.ref.protocol, key.name: "RawRepresentable", key.usr: "s:Ps16RawRepresentable", - key.offset: 8109, + key.offset: 8226, key.length: 16 }, { key.kind: source.lang.swift.ref.protocol, key.name: "Equatable", key.usr: "s:Ps9Equatable", - key.offset: 8127, + key.offset: 8244, key.length: 9 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8144, + key.offset: 8261, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 8149, + key.offset: 8266, key.length: 1 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 8151, + key.offset: 8268, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8151, + key.offset: 8268, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:Vs6UInt32", - key.offset: 8161, + key.offset: 8278, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8174, + key.offset: 8291, key.length: 4 }, { key.kind: source.lang.swift.syntaxtype.argument, - key.offset: 8179, + key.offset: 8296, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.parameter, - key.offset: 8188, + key.offset: 8305, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8179, + key.offset: 8296, key.length: 8 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8188, + key.offset: 8305, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:Vs6UInt32", - key.offset: 8198, + key.offset: 8315, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8211, + key.offset: 8328, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8215, + key.offset: 8332, key.length: 8 }, { key.kind: source.lang.swift.ref.struct, key.name: "UInt32", key.usr: "s:Vs6UInt32", - key.offset: 8225, + key.offset: 8342, key.length: 6 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8234, + key.offset: 8351, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8238, + key.offset: 8355, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 8252, + key.offset: 8369, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8266, + key.offset: 8383, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8272, + key.offset: 8389, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8276, + key.offset: 8393, key.length: 12 }, { key.kind: source.lang.swift.ref.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 8290, + key.offset: 8407, key.length: 11 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8304, + key.offset: 8421, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.keyword, - key.offset: 8310, + key.offset: 8427, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8314, + key.offset: 8431, key.length: 25 }, { key.kind: source.lang.swift.ref.struct, key.name: "Int", key.usr: "s:Si", - key.offset: 8341, + key.offset: 8458, key.length: 3 }, { key.kind: source.lang.swift.syntaxtype.identifier, - key.offset: 8347, + key.offset: 8464, key.length: 3 } ] @@ -5972,7 +6060,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "c:@E@FooComparisonResult", key.doc.full_as_xml: "FooComparisonResultc:@E@FooComparisonResultenum FooComparisonResult : Int Aaa. FooComparisonResult. Bbb.", key.offset: 625, - key.length: 1186, + key.length: 1303, key.fully_annotated_decl: "enum FooComparisonResult : Int", key.inherits: [ { @@ -6566,12 +6654,58 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.length: 16 } ] + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(bitPattern:)", + key.usr: "s:FSicurFT10bitPatternGSqGSpx___Si::SYNTHESIZED::c:@E@FooComparisonResult", + key.original_usr: "s:FSicurFT10bitPatternGSqGSpx___Si", + key.generic_params: [ + { + key.name: "U" + } + ], + key.offset: 1815, + key.length: 56, + key.fully_annotated_decl: "init<U>(bitPattern: UnsafeMutablePointer<U>?)", + key.entities: [ + { + key.kind: source.lang.swift.decl.var.local, + key.keyword: "bitPattern", + key.name: "bitPattern", + key.offset: 1846, + key.length: 24 + } + ] + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(bitPattern:)", + key.usr: "s:FSicurFT10bitPatternGSqGSPx___Si::SYNTHESIZED::c:@E@FooComparisonResult", + key.original_usr: "s:FSicurFT10bitPatternGSqGSPx___Si", + key.generic_params: [ + { + key.name: "U" + } + ], + key.offset: 1877, + key.length: 49, + key.fully_annotated_decl: "init<U>(bitPattern: UnsafePointer<U>?)", + key.entities: [ + { + key.kind: source.lang.swift.decl.var.local, + key.keyword: "bitPattern", + key.name: "bitPattern", + key.offset: 1908, + key.length: 17 + } + ] } ] }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 1813, + key.offset: 1930, key.length: 91, key.conforms: [ { @@ -6592,7 +6726,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:ZvSi8allZerosSi::SYNTHESIZED::c:@E@FooComparisonResult", key.original_usr: "s:ZvSi8allZerosSi", key.doc.full_as_xml: "allZeross:ZvSi8allZerosSistatic var allZeros: Int { get }The empty bitset of type Int.", - key.offset: 1870, + key.offset: 1987, key.length: 32, key.fully_annotated_decl: "static var allZeros: Int { get }", key.conforms: [ @@ -6607,7 +6741,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 1906, + key.offset: 2023, key.length: 96, key.conforms: [ { @@ -6628,7 +6762,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:vSi11descriptionSS::SYNTHESIZED::c:@E@FooComparisonResult", key.original_usr: "s:vSi11descriptionSS", key.doc.full_as_xml: "descriptions:vSi11descriptionSSvar description: String { get }A textual representation of self.", - key.offset: 1969, + key.offset: 2086, key.length: 31, key.fully_annotated_decl: "var description: String { get }", key.conforms: [ @@ -6643,7 +6777,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 2004, + key.offset: 2121, key.length: 76, key.conforms: [ { @@ -6664,7 +6798,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:vSi9hashValueSi::SYNTHESIZED::c:@E@FooComparisonResult", key.original_usr: "s:vSi9hashValueSi", key.doc.full_as_xml: "hashValues:vSi9hashValueSivar hashValue: Int { get }The hash value.Axiom: x == y implies x.hashValue == y.hashValue.The hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.", - key.offset: 2052, + key.offset: 2169, key.length: 26, key.fully_annotated_decl: "var hashValue: Int { get }", key.conforms: [ @@ -6679,7 +6813,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 2082, + key.offset: 2199, key.length: 48, key.conforms: [ { @@ -6696,7 +6830,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 2132, + key.offset: 2249, key.length: 91, key.conforms: [ { @@ -6717,7 +6851,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:vSi12customMirrorVs6Mirror::SYNTHESIZED::c:@E@FooComparisonResult", key.original_usr: "s:vSi12customMirrorVs6Mirror", key.doc.full_as_xml: "customMirrors:vSi12customMirrorVs6Mirrorvar customMirror: Mirror { get }Returns a mirror that reflects self.", - key.offset: 2189, + key.offset: 2306, key.length: 32, key.fully_annotated_decl: "var customMirror: Mirror { get }", key.conforms: [ @@ -6732,7 +6866,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 2225, + key.offset: 2342, key.length: 129, key.conforms: [ { @@ -6752,7 +6886,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "customPlaygroundQuickLook", key.usr: "s:vSi25customPlaygroundQuickLookOs19PlaygroundQuickLook::SYNTHESIZED::c:@E@FooComparisonResult", key.original_usr: "s:vSi25customPlaygroundQuickLookOs19PlaygroundQuickLook", - key.offset: 2294, + key.offset: 2411, key.length: 58, key.fully_annotated_decl: "var customPlaygroundQuickLook: PlaygroundQuickLook { get }", key.conforms: [ @@ -6767,7 +6901,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 2356, + key.offset: 2473, key.length: 43, key.conforms: [ { @@ -6787,7 +6921,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "FooRuncingOptions", key.usr: "c:@E@FooRuncingOptions", key.doc.full_as_xml: "FooRuncingOptionsc:@E@FooRuncingOptionsstruct FooRuncingOptions : OptionSet Aaa. FooRuncingOptions. Bbb.", - key.offset: 2400, + key.offset: 2517, key.length: 185, key.fully_annotated_decl: "struct FooRuncingOptions : OptionSet", key.conforms: [ @@ -6802,7 +6936,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(rawValue:)", key.usr: "s:FVSC17FooRuncingOptionscFT8rawValueSi_S_", - key.offset: 2444, + key.offset: 2561, key.length: 28, key.fully_annotated_decl: "init(rawValue: Int)", key.conforms: [ @@ -6822,7 +6956,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "rawValue", key.name: "rawValue", - key.offset: 2468, + key.offset: 2585, key.length: 3 } ] @@ -6831,7 +6965,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.static, key.name: "enableMince", key.usr: "c:@E@FooRuncingOptions@FooRuncingEnableMince", - key.offset: 2478, + key.offset: 2595, key.length: 49, key.fully_annotated_decl: "static var enableMince: FooRuncingOptions { get }" }, @@ -6839,7 +6973,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.static, key.name: "enableQuince", key.usr: "c:@E@FooRuncingOptions@FooRuncingEnableQuince", - key.offset: 2533, + key.offset: 2650, key.length: 50, key.fully_annotated_decl: "static var enableQuince: FooRuncingOptions { get }" } @@ -6848,7 +6982,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.decl.extension.struct, key.doc.full_as_xml: "extension FooRuncingOptionsOptionSet requirements for which default implementations are supplied.A type conforming to OptionSet can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.", - key.offset: 2587, + key.offset: 2704, key.length: 158, key.extends: { key.kind: source.lang.swift.ref.struct, @@ -6862,7 +6996,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs9OptionSet5unionFxx::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs9OptionSet5unionFxx", key.doc.full_as_xml: "union(_:)s:FEsPs9OptionSet5unionFxxfunc union(_ other: Self) -> SelfReturns the set of elements contained in self, in other, or in both self and other.", - key.offset: 2622, + key.offset: 2739, key.length: 33, key.fully_annotated_decl: "func union(_ other: Self) -> Self", key.entities: [ @@ -6870,7 +7004,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 2642, + key.offset: 2759, key.length: 4 } ] @@ -6881,7 +7015,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs9OptionSet9intersectFxx::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs9OptionSet9intersectFxx", key.doc.full_as_xml: "intersect(_:)s:FEsPs9OptionSet9intersectFxxfunc intersect(_ other: Self) -> SelfReturns the set of elements contained in both self and other.", - key.offset: 2661, + key.offset: 2778, key.length: 37, key.fully_annotated_decl: "func intersect(_ other: Self) -> Self", key.entities: [ @@ -6889,7 +7023,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 2685, + key.offset: 2802, key.length: 4 } ] @@ -6900,7 +7034,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs9OptionSet11exclusiveOrFxx::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs9OptionSet11exclusiveOrFxx", key.doc.full_as_xml: "exclusiveOr(_:)s:FEsPs9OptionSet11exclusiveOrFxxfunc exclusiveOr(_ other: Self) -> SelfReturns the set of elements contained in self or in other, but not in both self and other.", - key.offset: 2704, + key.offset: 2821, key.length: 39, key.fully_annotated_decl: "func exclusiveOr(_ other: Self) -> Self", key.entities: [ @@ -6908,7 +7042,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 2730, + key.offset: 2847, key.length: 4 } ] @@ -6923,7 +7057,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } } ], key.doc.full_as_xml: "extension FooRuncingOptions where Element == SelfOptionSet requirements for which default implementations are supplied when Element == Self, which is the default.A type conforming to OptionSet can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.", - key.offset: 2747, + key.offset: 2864, key.length: 167, key.extends: { key.kind: source.lang.swift.ref.struct, @@ -6937,7 +7071,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetxzwx7ElementrS_8containsFxSb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetxzwx7ElementrS_8containsFxSb", key.doc.full_as_xml: "contains(_:)s:FesRxs9OptionSetxzwx7ElementrS_8containsFxSbfunc contains(_ member: Self) -> BoolReturns true if self contains member.Equivalent to self.intersect([member]) == [member]", - key.offset: 2782, + key.offset: 2899, key.length: 37, key.fully_annotated_decl: "func contains(_ member: Self) -> Bool", key.entities: [ @@ -6945,7 +7079,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "member", - key.offset: 2806, + key.offset: 2923, key.length: 4 } ] @@ -6956,7 +7090,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T_::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T_", key.doc.full_as_xml: "insert(_:)s:FesRxs9OptionSetxzwx7ElementrS_6insertFwxS0_T_mutating func insert(_ member: Self)If member is not already contained in self, insert it.self.contains(member)Equivalent to self.unionInPlace([member])", - key.offset: 2825, + key.offset: 2942, key.length: 36, key.fully_annotated_decl: "mutating func insert(_ member: Self)", key.entities: [ @@ -6964,7 +7098,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "member", - key.offset: 2856, + key.offset: 2973, key.length: 4 } ] @@ -6975,7 +7109,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__", key.doc.full_as_xml: "remove(_:)s:FesRxs9OptionSetxzwx7ElementrS_6removeFwxS0_GSqwxS0__mutating func remove(_ member: Self) -> Self?If member is contained in self, remove and return it. Otherwise, return nil.self.intersect([member]).isEmpty", - key.offset: 2867, + key.offset: 2984, key.length: 45, key.fully_annotated_decl: "@discardableResult mutating func remove(_ member: Self) -> Self?", key.entities: [ @@ -6983,7 +7117,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "member", - key.offset: 2898, + key.offset: 3015, key.length: 4 } ] @@ -6998,7 +7132,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } } ], key.doc.full_as_xml: "extension FooRuncingOptions where RawValue : BitwiseOperationsOptionSet requirements for which default implementations are supplied when RawValue conforms to BitwiseOperations, which is the usual case. Each distinct bit of an option set’s .rawValue corresponds to a disjoint element of the option set.A type conforming to OptionSet can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.union is implemented as a bitwise “or” (|) of rawValuesintersection is implemented as a bitwise “and” (|) of rawValuesexclusiveOr is implemented as a bitwise “exclusive or” (^) of rawValues", - key.offset: 2916, + key.offset: 3033, key.length: 206, key.extends: { key.kind: source.lang.swift.ref.struct, @@ -7012,7 +7146,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_cFT_x::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_cFT_x", key.doc.full_as_xml: "init()s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_cFT_xconvenience init()Create an empty instance.Equivalent to [] as Self", - key.offset: 2951, + key.offset: 3068, key.length: 18, key.fully_annotated_decl: "convenience init()" }, @@ -7022,7 +7156,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_12unionInPlaceFxT_::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_12unionInPlaceFxT_", key.doc.full_as_xml: "unionInPlace(_:)s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_12unionInPlaceFxT_mutating func unionInPlace(_ other: Self)Insert all elements of other into self.self.isSupersetOf(other)Equivalent to replacing self with self.union(other).", - key.offset: 2975, + key.offset: 3092, key.length: 41, key.fully_annotated_decl: "mutating func unionInPlace(_ other: Self)", key.entities: [ @@ -7030,7 +7164,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3011, + key.offset: 3128, key.length: 4 } ] @@ -7041,7 +7175,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16intersectInPlaceFxT_::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16intersectInPlaceFxT_", key.doc.full_as_xml: "intersectInPlace(_:)s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_16intersectInPlaceFxT_mutating func intersectInPlace(_ other: Self)Remove all elements of self that are not also present in other.self.isSubsetOf(other)Equivalent to replacing self with self.intersect(other)", - key.offset: 3022, + key.offset: 3139, key.length: 45, key.fully_annotated_decl: "mutating func intersectInPlace(_ other: Self)", key.entities: [ @@ -7049,7 +7183,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3062, + key.offset: 3179, key.length: 4 } ] @@ -7060,7 +7194,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_18exclusiveOrInPlaceFxT_::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_18exclusiveOrInPlaceFxT_", key.doc.full_as_xml: "exclusiveOrInPlace(_:)s:FesRxs9OptionSetwx8RawValues17BitwiseOperationsrS_18exclusiveOrInPlaceFxT_mutating func exclusiveOrInPlace(_ other: Self)Replace self with a set containing all elements contained in either self or other, but not both.Equivalent to replacing self with self.exclusiveOr(other)", - key.offset: 3073, + key.offset: 3190, key.length: 47, key.fully_annotated_decl: "mutating func exclusiveOrInPlace(_ other: Self)", key.entities: [ @@ -7068,7 +7202,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3115, + key.offset: 3232, key.length: 4 } ] @@ -7078,7 +7212,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } { key.kind: source.lang.swift.decl.extension.struct, key.doc.full_as_xml: "extension FooRuncingOptionsSetAlgebra requirements for which default implementations are supplied.A type conforming to SetAlgebra can implement any of these initializers or methods, and those implementations will be used in lieu of these defaults.", - key.offset: 3124, + key.offset: 3241, key.length: 744, key.extends: { key.kind: source.lang.swift.ref.struct, @@ -7103,7 +7237,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } } ], key.doc.full_as_xml: "init(_:)s:FEsPs10SetAlgebracuRd__s8Sequencewx7ElementzWd__8Iterator7Element_rFqd__xconvenience init<S : Sequence where S.Iterator.Element == Element>(_ sequence: S)Creates the set containing all elements of sequence.", - key.offset: 3159, + key.offset: 3276, key.length: 91, key.fully_annotated_decl: "convenience init<S : Sequence where S.Iterator.Element == FooRuncingOptions>(_ sequence: S)", key.entities: [ @@ -7111,7 +7245,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "sequence", - key.offset: 3248, + key.offset: 3365, key.length: 1 } ] @@ -7122,7 +7256,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__x", key.doc.full_as_xml: "init(arrayLiteral:)s:FEsPs10SetAlgebracFt12arrayLiteralGSawx7Element__xconvenience init(arrayLiteral: Self.Element...)Creates a set containing all elements of the given arrayLiteral.This initializer allows an array literal containing Self.Element to represent an instance of the set, wherever it is implied by the type context.", - key.offset: 3256, + key.offset: 3373, key.length: 65, key.fully_annotated_decl: "convenience init(arrayLiteral: FooRuncingOptions...)", key.entities: [ @@ -7130,7 +7264,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "arrayLiteral", key.name: "arrayLiteral", - key.offset: 3300, + key.offset: 3417, key.length: 17 } ] @@ -7141,7 +7275,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra15subtractInPlaceFxT_::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra15subtractInPlaceFxT_", key.doc.full_as_xml: "subtractInPlace(_:)s:FEsPs10SetAlgebra15subtractInPlaceFxT_mutating func subtractInPlace(_ other: Self)Removes all elements of other from self.Equivalent to replacing self with self.subtract(other).", - key.offset: 3327, + key.offset: 3444, key.length: 44, key.fully_annotated_decl: "mutating func subtractInPlace(_ other: Self)", key.entities: [ @@ -7149,7 +7283,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3366, + key.offset: 3483, key.length: 4 } ] @@ -7160,7 +7294,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra10isSubsetOfFxSb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra10isSubsetOfFxSb", key.doc.full_as_xml: "isSubsetOf(_:)s:FEsPs10SetAlgebra10isSubsetOfFxSbfunc isSubsetOf(_ other: Self) -> BoolReturns true iff every element of self is contained in other.", - key.offset: 3377, + key.offset: 3494, key.length: 38, key.fully_annotated_decl: "func isSubsetOf(_ other: Self) -> Bool", key.entities: [ @@ -7168,7 +7302,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3402, + key.offset: 3519, key.length: 4 } ] @@ -7179,7 +7313,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra12isSupersetOfFxSb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra12isSupersetOfFxSb", key.doc.full_as_xml: "isSupersetOf(_:)s:FEsPs10SetAlgebra12isSupersetOfFxSbfunc isSupersetOf(_ other: Self) -> BoolReturns true iff every element of other is contained in self.", - key.offset: 3421, + key.offset: 3538, key.length: 40, key.fully_annotated_decl: "func isSupersetOf(_ other: Self) -> Bool", key.entities: [ @@ -7187,7 +7321,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3448, + key.offset: 3565, key.length: 4 } ] @@ -7198,7 +7332,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra14isDisjointWithFxSb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra14isDisjointWithFxSb", key.doc.full_as_xml: "isDisjointWith(_:)s:FEsPs10SetAlgebra14isDisjointWithFxSbfunc isDisjointWith(_ other: Self) -> BoolReturns true iff self.intersect(other).isEmpty.", - key.offset: 3467, + key.offset: 3584, key.length: 42, key.fully_annotated_decl: "func isDisjointWith(_ other: Self) -> Bool", key.entities: [ @@ -7206,7 +7340,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3496, + key.offset: 3613, key.length: 4 } ] @@ -7217,7 +7351,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra8subtractFxx::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra8subtractFxx", key.doc.full_as_xml: "subtract(_:)s:FEsPs10SetAlgebra8subtractFxxfunc subtract(_ other: Self) -> SelfReturns the set of elements contained in self but not in other.", - key.offset: 3515, + key.offset: 3632, key.length: 36, key.fully_annotated_decl: "func subtract(_ other: Self) -> Self", key.entities: [ @@ -7225,7 +7359,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3538, + key.offset: 3655, key.length: 4 } ] @@ -7236,7 +7370,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:vEsPs10SetAlgebra7isEmptySb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:vEsPs10SetAlgebra7isEmptySb", key.doc.full_as_xml: "isEmptys:vEsPs10SetAlgebra7isEmptySbvar isEmpty: Bool { get }Returns true iff self.contains(e) is false for all e.", - key.offset: 3557, + key.offset: 3674, key.length: 25, key.fully_annotated_decl: "var isEmpty: Bool { get }" }, @@ -7246,7 +7380,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra18isStrictSupersetOfFxSb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra18isStrictSupersetOfFxSb", key.doc.full_as_xml: "isStrictSupersetOf(_:)s:FEsPs10SetAlgebra18isStrictSupersetOfFxSbfunc isStrictSupersetOf(_ other: Self) -> BoolReturns true iff every element of other is contained in self and self contains an element that is not contained in other.", - key.offset: 3588, + key.offset: 3705, key.length: 46, key.fully_annotated_decl: "func isStrictSupersetOf(_ other: Self) -> Bool", key.entities: [ @@ -7254,7 +7388,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3621, + key.offset: 3738, key.length: 4 } ] @@ -7265,7 +7399,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:FEsPs10SetAlgebra16isStrictSubsetOfFxSb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:FEsPs10SetAlgebra16isStrictSubsetOfFxSb", key.doc.full_as_xml: "isStrictSubsetOf(_:)s:FEsPs10SetAlgebra16isStrictSubsetOfFxSbfunc isStrictSubsetOf(_ other: Self) -> BoolReturns true iff every element of self is contained in other and other contains an element that is not contained in self.", - key.offset: 3640, + key.offset: 3757, key.length: 44, key.fully_annotated_decl: "func isStrictSubsetOf(_ other: Self) -> Bool", key.entities: [ @@ -7273,7 +7407,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "other", - key.offset: 3671, + key.offset: 3788, key.length: 4 } ] @@ -7284,7 +7418,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:ZFEsPs10SetAlgebra7elementFTwx7Element8subsumeswxS0__Sb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:ZFEsPs10SetAlgebra7elementFTwx7Element8subsumeswxS0__Sb", key.doc.full_as_xml: "element(_:subsumes:)s:ZFEsPs10SetAlgebra7elementFTwx7Element8subsumeswxS0__Sbstatic func element(_ a: Self.Element, subsumes b: Self.Element) -> BoolReturns true iff a subsumes b.Equivalent to ([a] as Self).isSupersetOf([b])", - key.offset: 3690, + key.offset: 3807, key.length: 82, key.fully_annotated_decl: "static func element(_ a: FooRuncingOptions, subsumes b: FooRuncingOptions) -> Bool", key.entities: [ @@ -7292,14 +7426,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 3715, + key.offset: 3832, key.length: 17 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "subsumes", key.name: "b", - key.offset: 3746, + key.offset: 3863, key.length: 17 } ] @@ -7310,7 +7444,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.usr: "s:ZFEsPs10SetAlgebra7elementFTwx7Element14isDisjointWithwxS0__Sb::SYNTHESIZED::c:@E@FooRuncingOptions", key.original_usr: "s:ZFEsPs10SetAlgebra7elementFTwx7Element14isDisjointWithwxS0__Sb", key.doc.full_as_xml: "element(_:isDisjointWith:)s:ZFEsPs10SetAlgebra7elementFTwx7Element14isDisjointWithwxS0__Sbstatic func element(_ a: Self.Element, isDisjointWith b: Self.Element) -> BoolReturns true iff a is disjoint with b.Two elements are disjoint when neither one subsumes the other.Self.element(_, subsumes:_)", - key.offset: 3778, + key.offset: 3895, key.length: 88, key.fully_annotated_decl: "static func element(_ a: FooRuncingOptions, isDisjointWith b: FooRuncingOptions) -> Bool", key.entities: [ @@ -7318,14 +7452,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 3803, + key.offset: 3920, key.length: 17 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "isDisjointWith", key.name: "b", - key.offset: 3840, + key.offset: 3957, key.length: 17 } ] @@ -7336,7 +7470,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.name: "FooStruct1", key.usr: "c:@S@FooStruct1", - key.offset: 3869, + key.offset: 3986, key.length: 105, key.fully_annotated_decl: "struct FooStruct1", key.entities: [ @@ -7344,7 +7478,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "x", key.usr: "c:@S@FooStruct1@FI@x", - key.offset: 3894, + key.offset: 4011, key.length: 12, key.fully_annotated_decl: "var x: Int32" }, @@ -7352,7 +7486,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "y", key.usr: "c:@S@FooStruct1@FI@y", - key.offset: 3912, + key.offset: 4029, key.length: 13, key.fully_annotated_decl: "var y: Double" }, @@ -7360,7 +7494,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init()", key.usr: "s:FVSC10FooStruct1cFT_S_", - key.offset: 3931, + key.offset: 4048, key.length: 6, key.fully_annotated_decl: "init()" }, @@ -7368,7 +7502,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:y:)", key.usr: "s:FVSC10FooStruct1cFT1xVs5Int321ySd_S_", - key.offset: 3943, + key.offset: 4060, key.length: 29, key.fully_annotated_decl: "init(x: Int32, y: Double)", key.entities: [ @@ -7376,14 +7510,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 3953, + key.offset: 4070, key.length: 5 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "y", key.name: "y", - key.offset: 3965, + key.offset: 4082, key.length: 6 } ] @@ -7394,7 +7528,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.name: "FooStruct2", key.usr: "c:@S@FooStruct2", - key.offset: 3975, + key.offset: 4092, key.length: 105, key.fully_annotated_decl: "struct FooStruct2", key.entities: [ @@ -7402,7 +7536,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "x", key.usr: "c:@S@FooStruct2@FI@x", - key.offset: 4000, + key.offset: 4117, key.length: 12, key.fully_annotated_decl: "var x: Int32" }, @@ -7410,7 +7544,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "y", key.usr: "c:@S@FooStruct2@FI@y", - key.offset: 4018, + key.offset: 4135, key.length: 13, key.fully_annotated_decl: "var y: Double" }, @@ -7418,7 +7552,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init()", key.usr: "s:FVSC10FooStruct2cFT_S_", - key.offset: 4037, + key.offset: 4154, key.length: 6, key.fully_annotated_decl: "init()" }, @@ -7426,7 +7560,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:y:)", key.usr: "s:FVSC10FooStruct2cFT1xVs5Int321ySd_S_", - key.offset: 4049, + key.offset: 4166, key.length: 29, key.fully_annotated_decl: "init(x: Int32, y: Double)", key.entities: [ @@ -7434,14 +7568,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 4059, + key.offset: 4176, key.length: 5 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "y", key.name: "y", - key.offset: 4071, + key.offset: 4188, key.length: 6 } ] @@ -7452,7 +7586,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.typealias, key.name: "FooStructTypedef1", key.usr: "c:Foo.h@T@FooStructTypedef1", - key.offset: 4081, + key.offset: 4198, key.length: 40, key.fully_annotated_decl: "typealias FooStructTypedef1 = FooStruct2" }, @@ -7460,7 +7594,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.name: "FooStructTypedef2", key.usr: "c:@SA@FooStructTypedef2", - key.offset: 4122, + key.offset: 4239, key.length: 112, key.fully_annotated_decl: "struct FooStructTypedef2", key.entities: [ @@ -7468,7 +7602,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "x", key.usr: "c:@SA@FooStructTypedef2@FI@x", - key.offset: 4154, + key.offset: 4271, key.length: 12, key.fully_annotated_decl: "var x: Int32" }, @@ -7476,7 +7610,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "y", key.usr: "c:@SA@FooStructTypedef2@FI@y", - key.offset: 4172, + key.offset: 4289, key.length: 13, key.fully_annotated_decl: "var y: Double" }, @@ -7484,7 +7618,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init()", key.usr: "s:FVSC17FooStructTypedef2cFT_S_", - key.offset: 4191, + key.offset: 4308, key.length: 6, key.fully_annotated_decl: "init()" }, @@ -7492,7 +7626,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:y:)", key.usr: "s:FVSC17FooStructTypedef2cFT1xVs5Int321ySd_S_", - key.offset: 4203, + key.offset: 4320, key.length: 29, key.fully_annotated_decl: "init(x: Int32, y: Double)", key.entities: [ @@ -7500,14 +7634,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 4213, + key.offset: 4330, key.length: 5 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "y", key.name: "y", - key.offset: 4225, + key.offset: 4342, key.length: 6 } ] @@ -7519,7 +7653,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "FooTypedef1", key.usr: "c:Foo.h@T@FooTypedef1", key.doc.full_as_xml: "FooTypedef1c:Foo.h@T@FooTypedef1typealias FooTypedef1 = Int32 Aaa. FooTypedef1. Bbb.", - key.offset: 4235, + key.offset: 4352, key.length: 29, key.fully_annotated_decl: "typealias FooTypedef1 = Int32" }, @@ -7528,7 +7662,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooIntVar", key.usr: "c:@fooIntVar", key.doc.full_as_xml: "fooIntVarc:@fooIntVarvar fooIntVar: Int32 Aaa. fooIntVar. Bbb.", - key.offset: 4265, + key.offset: 4382, key.length: 20, key.fully_annotated_decl: "var fooIntVar: Int32" }, @@ -7537,7 +7671,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooFunc1(_:)", key.usr: "c:@F@fooFunc1", key.doc.full_as_xml: "fooFunc1c:@F@fooFunc1@discardableResult func fooFunc1(_ a: Int32) -> Int32 Aaa. fooFunc1. Bbb.", - key.offset: 4286, + key.offset: 4403, key.length: 34, key.fully_annotated_decl: "@discardableResult func fooFunc1(_ a: Int32) -> Int32", key.entities: [ @@ -7545,7 +7679,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 4305, + key.offset: 4422, key.length: 5 } ] @@ -7554,14 +7688,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooFunc1AnonymousParam(_:)", key.usr: "c:@F@fooFunc1AnonymousParam", - key.offset: 4321, + key.offset: 4438, key.length: 48, key.fully_annotated_decl: "@discardableResult func fooFunc1AnonymousParam(_: Int32) -> Int32", key.entities: [ { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", - key.offset: 4354, + key.offset: 4471, key.length: 5 } ] @@ -7570,7 +7704,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooFunc3(_:_:_:_:)", key.usr: "c:@F@fooFunc3", - key.offset: 4370, + key.offset: 4487, key.length: 94, key.fully_annotated_decl: "@discardableResult func fooFunc3(_ a: Int32, _ b: Float, _ c: Double, _ d: UnsafeMutablePointer<Int32>!) -> Int32", key.entities: [ @@ -7578,28 +7712,28 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 4389, + key.offset: 4506, key.length: 5 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "b", - key.offset: 4401, + key.offset: 4518, key.length: 5 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "c", - key.offset: 4413, + key.offset: 4530, key.length: 6 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "d", - key.offset: 4426, + key.offset: 4543, key.length: 28 } ] @@ -7608,7 +7742,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooFuncWithBlock(_:)", key.usr: "c:@F@fooFuncWithBlock", - key.offset: 4465, + key.offset: 4582, key.length: 49, key.fully_annotated_decl: "func fooFuncWithBlock(_ blk: ((Float) -> Int32)!)", key.entities: [ @@ -7616,7 +7750,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "blk", - key.offset: 4494, + key.offset: 4611, key.length: 19 } ] @@ -7625,7 +7759,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooFuncWithFunctionPointer(_:)", key.usr: "c:@F@fooFuncWithFunctionPointer", - key.offset: 4515, + key.offset: 4632, key.length: 60, key.fully_annotated_decl: "func fooFuncWithFunctionPointer(_ fptr: ((Float) -> Int32)!)", key.entities: [ @@ -7633,7 +7767,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "fptr", - key.offset: 4555, + key.offset: 4672, key.length: 19 } ] @@ -7642,7 +7776,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooFuncNoreturn1()", key.usr: "c:@F@fooFuncNoreturn1", - key.offset: 4576, + key.offset: 4693, key.length: 33, key.fully_annotated_decl: "@noreturn func fooFuncNoreturn1()" }, @@ -7650,7 +7784,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooFuncNoreturn2()", key.usr: "c:@F@fooFuncNoreturn2", - key.offset: 4610, + key.offset: 4727, key.length: 33, key.fully_annotated_decl: "@noreturn func fooFuncNoreturn2()" }, @@ -7659,7 +7793,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooFuncWithComment1()", key.usr: "c:@F@fooFuncWithComment1", key.doc.full_as_xml: "fooFuncWithComment1c:@F@fooFuncWithComment1func fooFuncWithComment1() Aaa. fooFuncWithComment1. Bbb. Ccc. Ddd.", - key.offset: 4644, + key.offset: 4761, key.length: 26, key.fully_annotated_decl: "func fooFuncWithComment1()" }, @@ -7668,7 +7802,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooFuncWithComment2()", key.usr: "c:@F@fooFuncWithComment2", key.doc.full_as_xml: "fooFuncWithComment2c:@F@fooFuncWithComment2func fooFuncWithComment2() Aaa. fooFuncWithComment2. Bbb.", - key.offset: 4671, + key.offset: 4788, key.length: 26, key.fully_annotated_decl: "func fooFuncWithComment2()" }, @@ -7677,7 +7811,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooFuncWithComment3()", key.usr: "c:@F@fooFuncWithComment3", key.doc.full_as_xml: "fooFuncWithComment3c:@F@fooFuncWithComment3func fooFuncWithComment3() Aaa. fooFuncWithComment3. Bbb. Ccc.", - key.offset: 4698, + key.offset: 4815, key.length: 26, key.fully_annotated_decl: "func fooFuncWithComment3()" }, @@ -7686,7 +7820,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooFuncWithComment4()", key.usr: "c:@F@fooFuncWithComment4", key.doc.full_as_xml: "fooFuncWithComment4c:@F@fooFuncWithComment4func fooFuncWithComment4() Aaa. fooFuncWithComment4. Bbb. Ddd.", - key.offset: 4725, + key.offset: 4842, key.length: 26, key.fully_annotated_decl: "func fooFuncWithComment4()" }, @@ -7695,7 +7829,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooFuncWithComment5()", key.usr: "c:@F@fooFuncWithComment5", key.doc.full_as_xml: "fooFuncWithComment5c:@F@fooFuncWithComment5func fooFuncWithComment5() Aaa. fooFuncWithComment5. Bbb. Ccc. Ddd.", - key.offset: 4752, + key.offset: 4869, key.length: 26, key.fully_annotated_decl: "func fooFuncWithComment5()" }, @@ -7704,7 +7838,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "redeclaredInMultipleModulesFunc1(_:)", key.usr: "c:@F@redeclaredInMultipleModulesFunc1", key.doc.full_as_xml: "redeclaredInMultipleModulesFunc1c:@F@redeclaredInMultipleModulesFunc1@discardableResult func redeclaredInMultipleModulesFunc1(_ a: Int32) -> Int32 Aaa. redeclaredInMultipleModulesFunc1. Bbb.", - key.offset: 4779, + key.offset: 4896, key.length: 58, key.fully_annotated_decl: "@discardableResult func redeclaredInMultipleModulesFunc1(_ a: Int32) -> Int32", key.entities: [ @@ -7712,7 +7846,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 4822, + key.offset: 4939, key.length: 5 } ] @@ -7722,7 +7856,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "FooProtocolBase", key.usr: "c:objc(pl)FooProtocolBase", key.doc.full_as_xml: "FooProtocolBasec:objc(pl)FooProtocolBaseprotocol FooProtocolBase Aaa. FooProtocolBase. Bbb.", - key.offset: 4838, + key.offset: 4955, key.length: 301, key.fully_annotated_decl: "protocol FooProtocolBase", key.entities: [ @@ -7731,7 +7865,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooProtoFunc()", key.usr: "c:objc(pl)FooProtocolBase(im)fooProtoFunc", key.doc.full_as_xml: "fooProtoFuncc:objc(pl)FooProtocolBase(im)fooProtoFuncfunc fooProtoFunc() Aaa. fooProtoFunc. Bbb. Ccc.", - key.offset: 4870, + key.offset: 4987, key.length: 19, key.fully_annotated_decl: "func fooProtoFunc()" }, @@ -7740,7 +7874,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooProtoFuncWithExtraIndentation1()", key.usr: "c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation1", key.doc.full_as_xml: "fooProtoFuncWithExtraIndentation1c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation1func fooProtoFuncWithExtraIndentation1() Aaa. fooProtoFuncWithExtraIndentation1. Bbb. Ccc.", - key.offset: 4895, + key.offset: 5012, key.length: 40, key.fully_annotated_decl: "func fooProtoFuncWithExtraIndentation1()" }, @@ -7749,7 +7883,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "fooProtoFuncWithExtraIndentation2()", key.usr: "c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation2", key.doc.full_as_xml: "fooProtoFuncWithExtraIndentation2c:objc(pl)FooProtocolBase(im)fooProtoFuncWithExtraIndentation2func fooProtoFuncWithExtraIndentation2() Aaa. fooProtoFuncWithExtraIndentation2. Bbb. Ccc.", - key.offset: 4941, + key.offset: 5058, key.length: 40, key.fully_annotated_decl: "func fooProtoFuncWithExtraIndentation2()" }, @@ -7757,7 +7891,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.static, key.name: "fooProtoClassFunc()", key.usr: "c:objc(pl)FooProtocolBase(cm)fooProtoClassFunc", - key.offset: 4987, + key.offset: 5104, key.length: 31, key.fully_annotated_decl: "static func fooProtoClassFunc()" }, @@ -7765,7 +7899,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "fooProperty1", key.usr: "c:objc(pl)FooProtocolBase(py)fooProperty1", - key.offset: 5024, + key.offset: 5141, key.length: 35, key.fully_annotated_decl: "var fooProperty1: Int32 { get set }" }, @@ -7773,7 +7907,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "fooProperty2", key.usr: "c:objc(pl)FooProtocolBase(py)fooProperty2", - key.offset: 5065, + key.offset: 5182, key.length: 35, key.fully_annotated_decl: "var fooProperty2: Int32 { get set }" }, @@ -7781,7 +7915,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "fooProperty3", key.usr: "c:objc(pl)FooProtocolBase(py)fooProperty3", - key.offset: 5106, + key.offset: 5223, key.length: 31, key.fully_annotated_decl: "var fooProperty3: Int32 { get }" } @@ -7791,7 +7925,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.protocol, key.name: "FooProtocolDerived", key.usr: "c:objc(pl)FooProtocolDerived", - key.offset: 5140, + key.offset: 5257, key.length: 49, key.fully_annotated_decl: "protocol FooProtocolDerived : FooProtocolBase", key.conforms: [ @@ -7806,7 +7940,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.class, key.name: "FooClassBase", key.usr: "c:objc(cs)FooClassBase", - key.offset: 5190, + key.offset: 5307, key.length: 422, key.fully_annotated_decl: "class FooClassBase", key.entities: [ @@ -7814,7 +7948,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooBaseInstanceFunc0()", key.usr: "c:objc(cs)FooClassBase(im)fooBaseInstanceFunc0", - key.offset: 5216, + key.offset: 5333, key.length: 27, key.fully_annotated_decl: "func fooBaseInstanceFunc0()" }, @@ -7822,7 +7956,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooBaseInstanceFunc1(_:)", key.usr: "c:objc(cs)FooClassBase(im)fooBaseInstanceFunc1:", - key.offset: 5249, + key.offset: 5366, key.length: 66, key.fully_annotated_decl: "@discardableResult func fooBaseInstanceFunc1(_ anObject: AnyObject!) -> FooClassBase!", key.entities: [ @@ -7830,7 +7964,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "anObject", - key.offset: 5287, + key.offset: 5404, key.length: 10 } ] @@ -7839,7 +7973,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init()", key.usr: "c:objc(cs)FooClassBase(im)init", - key.offset: 5321, + key.offset: 5438, key.length: 7, key.fully_annotated_decl: "init!()" }, @@ -7847,7 +7981,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(float:)", key.usr: "c:objc(cs)FooClassBase(im)initWithFloat:", - key.offset: 5334, + key.offset: 5451, key.length: 33, key.fully_annotated_decl: "convenience init!(float f: Float)", key.entities: [ @@ -7855,7 +7989,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "float", key.name: "f", - key.offset: 5361, + key.offset: 5478, key.length: 5 } ] @@ -7864,7 +7998,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooBaseInstanceFuncOverridden()", key.usr: "c:objc(cs)FooClassBase(im)fooBaseInstanceFuncOverridden", - key.offset: 5373, + key.offset: 5490, key.length: 36, key.fully_annotated_decl: "func fooBaseInstanceFuncOverridden()" }, @@ -7872,7 +8006,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.class, key.name: "fooBaseClassFunc0()", key.usr: "c:objc(cs)FooClassBase(cm)fooBaseClassFunc0", - key.offset: 5415, + key.offset: 5532, key.length: 30, key.fully_annotated_decl: "class func fooBaseClassFunc0()" }, @@ -7880,7 +8014,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "_internalMeth3()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3", - key.offset: 5451, + key.offset: 5568, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth3() -> AnyObject!" }, @@ -7888,7 +8022,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "_internalMeth2()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2", - key.offset: 5492, + key.offset: 5609, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth2() -> AnyObject!" }, @@ -7896,7 +8030,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "nonInternalMeth()", key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth", - key.offset: 5533, + key.offset: 5650, key.length: 36, key.fully_annotated_decl: "@discardableResult func nonInternalMeth() -> AnyObject!" }, @@ -7904,7 +8038,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "_internalMeth1()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1", - key.offset: 5575, + key.offset: 5692, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth1() -> AnyObject!" } @@ -7915,7 +8049,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "FooClassDerived", key.usr: "c:objc(cs)FooClassDerived", key.doc.full_as_xml: "FooClassDerivedc:objc(cs)FooClassDerivedclass FooClassDerived : FooClassBase, FooProtocolDerived Aaa. FooClassDerived. Bbb.", - key.offset: 5613, + key.offset: 5730, key.length: 517, key.fully_annotated_decl: "class FooClassDerived : FooClassBase, FooProtocolDerived", key.inherits: [ @@ -7937,7 +8071,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "fooProperty1", key.usr: "c:objc(cs)FooClassDerived(py)fooProperty1", - key.offset: 5677, + key.offset: 5794, key.length: 23, key.fully_annotated_decl: "var fooProperty1: Int32 { get set }" }, @@ -7945,7 +8079,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "fooProperty2", key.usr: "c:objc(cs)FooClassDerived(py)fooProperty2", - key.offset: 5706, + key.offset: 5823, key.length: 23, key.fully_annotated_decl: "var fooProperty2: Int32 { get set }" }, @@ -7953,7 +8087,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "fooProperty3", key.usr: "c:objc(cs)FooClassDerived(py)fooProperty3", - key.offset: 5735, + key.offset: 5852, key.length: 31, key.fully_annotated_decl: "var fooProperty3: Int32 { get }" }, @@ -7961,7 +8095,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooInstanceFunc0()", key.usr: "c:objc(cs)FooClassDerived(im)fooInstanceFunc0", - key.offset: 5772, + key.offset: 5889, key.length: 23, key.fully_annotated_decl: "func fooInstanceFunc0()" }, @@ -7969,7 +8103,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooInstanceFunc1(_:)", key.usr: "c:objc(cs)FooClassDerived(im)fooInstanceFunc1:", - key.offset: 5801, + key.offset: 5918, key.length: 33, key.fully_annotated_decl: "func fooInstanceFunc1(_ a: Int32)", key.entities: [ @@ -7977,7 +8111,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 5828, + key.offset: 5945, key.length: 5 } ] @@ -7986,7 +8120,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooInstanceFunc2(_:withB:)", key.usr: "c:objc(cs)FooClassDerived(im)fooInstanceFunc2:withB:", - key.offset: 5840, + key.offset: 5957, key.length: 49, key.fully_annotated_decl: "func fooInstanceFunc2(_ a: Int32, withB b: Int32)", key.entities: [ @@ -7994,14 +8128,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 5867, + key.offset: 5984, key.length: 5 }, { key.kind: source.lang.swift.decl.var.local, key.keyword: "withB", key.name: "b", - key.offset: 5883, + key.offset: 6000, key.length: 5 } ] @@ -8010,7 +8144,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "fooBaseInstanceFuncOverridden()", key.usr: "c:objc(cs)FooClassDerived(im)fooBaseInstanceFuncOverridden", - key.offset: 5895, + key.offset: 6012, key.length: 36, key.fully_annotated_decl: "func fooBaseInstanceFuncOverridden()", key.inherits: [ @@ -8025,7 +8159,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.class, key.name: "fooClassFunc0()", key.usr: "c:objc(cs)FooClassDerived(cm)fooClassFunc0", - key.offset: 5937, + key.offset: 6054, key.length: 26, key.fully_annotated_decl: "class func fooClassFunc0()" }, @@ -8034,7 +8168,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth3()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3::SYNTHESIZED::c:objc(cs)FooClassDerived", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth3", - key.offset: 5969, + key.offset: 6086, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth3() -> AnyObject!" }, @@ -8043,7 +8177,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth2()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2::SYNTHESIZED::c:objc(cs)FooClassDerived", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth2", - key.offset: 6010, + key.offset: 6127, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth2() -> AnyObject!" }, @@ -8052,7 +8186,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "nonInternalMeth()", key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth::SYNTHESIZED::c:objc(cs)FooClassDerived", key.original_usr: "c:objc(cs)FooClassBase(im)nonInternalMeth", - key.offset: 6051, + key.offset: 6168, key.length: 36, key.fully_annotated_decl: "@discardableResult func nonInternalMeth() -> AnyObject!" }, @@ -8061,7 +8195,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth1()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1::SYNTHESIZED::c:objc(cs)FooClassDerived", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth1", - key.offset: 6093, + key.offset: 6210, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth1() -> AnyObject!" } @@ -8071,7 +8205,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_1", key.usr: "c:Foo.h@3647@macro@FOO_MACRO_1", - key.offset: 6131, + key.offset: 6248, key.length: 30, key.fully_annotated_decl: "var FOO_MACRO_1: Int32 { get }" }, @@ -8079,7 +8213,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_2", key.usr: "c:Foo.h@3669@macro@FOO_MACRO_2", - key.offset: 6162, + key.offset: 6279, key.length: 30, key.fully_annotated_decl: "var FOO_MACRO_2: Int32 { get }" }, @@ -8087,7 +8221,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_3", key.usr: "c:Foo.h@3691@macro@FOO_MACRO_3", - key.offset: 6193, + key.offset: 6310, key.length: 30, key.fully_annotated_decl: "var FOO_MACRO_3: Int32 { get }" }, @@ -8095,7 +8229,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_4", key.usr: "c:Foo.h@3755@macro@FOO_MACRO_4", - key.offset: 6224, + key.offset: 6341, key.length: 31, key.fully_annotated_decl: "var FOO_MACRO_4: UInt32 { get }" }, @@ -8103,7 +8237,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_5", key.usr: "c:Foo.h@3787@macro@FOO_MACRO_5", - key.offset: 6256, + key.offset: 6373, key.length: 31, key.fully_annotated_decl: "var FOO_MACRO_5: UInt64 { get }" }, @@ -8111,7 +8245,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_REDEF_1", key.usr: "c:Foo.h@3937@macro@FOO_MACRO_REDEF_1", - key.offset: 6288, + key.offset: 6405, key.length: 36, key.fully_annotated_decl: "var FOO_MACRO_REDEF_1: Int32 { get }" }, @@ -8119,7 +8253,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FOO_MACRO_REDEF_2", key.usr: "c:Foo.h@3994@macro@FOO_MACRO_REDEF_2", - key.offset: 6325, + key.offset: 6442, key.length: 36, key.fully_annotated_decl: "var FOO_MACRO_REDEF_2: Int32 { get }" }, @@ -8127,7 +8261,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "theLastDeclInFoo()", key.usr: "c:@F@theLastDeclInFoo", - key.offset: 6362, + key.offset: 6479, key.length: 23, key.fully_annotated_decl: "func theLastDeclInFoo()" }, @@ -8135,7 +8269,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "_internalTopLevelFunc()", key.usr: "c:@F@_internalTopLevelFunc", - key.offset: 6386, + key.offset: 6503, key.length: 28, key.fully_annotated_decl: "func _internalTopLevelFunc()" }, @@ -8143,7 +8277,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.name: "_InternalStruct", key.usr: "c:@S@_InternalStruct", - key.offset: 6415, + key.offset: 6532, key.length: 78, key.fully_annotated_decl: "struct _InternalStruct", key.entities: [ @@ -8151,7 +8285,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "x", key.usr: "c:@S@_InternalStruct@FI@x", - key.offset: 6445, + key.offset: 6562, key.length: 12, key.fully_annotated_decl: "var x: Int32" }, @@ -8159,7 +8293,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init()", key.usr: "s:FVSC15_InternalStructcFT_S_", - key.offset: 6463, + key.offset: 6580, key.length: 6, key.fully_annotated_decl: "init()" }, @@ -8167,7 +8301,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(x:)", key.usr: "s:FVSC15_InternalStructcFT1xVs5Int32_S_", - key.offset: 6475, + key.offset: 6592, key.length: 16, key.fully_annotated_decl: "init(x: Int32)", key.entities: [ @@ -8175,7 +8309,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "x", key.name: "x", - key.offset: 6485, + key.offset: 6602, key.length: 5 } ] @@ -8184,7 +8318,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.class, - key.offset: 6494, + key.offset: 6611, key.length: 67, key.extends: { key.kind: source.lang.swift.ref.class, @@ -8196,7 +8330,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "_internalMeth1()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1", - key.offset: 6524, + key.offset: 6641, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth1() -> AnyObject!" } @@ -8204,7 +8338,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.class, - key.offset: 6562, + key.offset: 6679, key.length: 109, key.extends: { key.kind: source.lang.swift.ref.class, @@ -8216,7 +8350,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "_internalMeth2()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2", - key.offset: 6592, + key.offset: 6709, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth2() -> AnyObject!" }, @@ -8224,7 +8358,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "nonInternalMeth()", key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth", - key.offset: 6633, + key.offset: 6750, key.length: 36, key.fully_annotated_decl: "@discardableResult func nonInternalMeth() -> AnyObject!" } @@ -8232,7 +8366,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } }, { key.kind: source.lang.swift.decl.extension.class, - key.offset: 6672, + key.offset: 6789, key.length: 67, key.extends: { key.kind: source.lang.swift.ref.class, @@ -8244,7 +8378,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "_internalMeth3()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3", - key.offset: 6702, + key.offset: 6819, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth3() -> AnyObject!" } @@ -8254,7 +8388,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.protocol, key.name: "_InternalProt", key.usr: "c:objc(pl)_InternalProt", - key.offset: 6740, + key.offset: 6857, key.length: 26, key.fully_annotated_decl: "protocol _InternalProt" }, @@ -8262,7 +8396,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.class, key.name: "ClassWithInternalProt", key.usr: "c:objc(cs)ClassWithInternalProt", - key.offset: 6767, + key.offset: 6884, key.length: 47, key.fully_annotated_decl: "class ClassWithInternalProt : _InternalProt", key.conforms: [ @@ -8277,7 +8411,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.class, key.name: "FooClassPropertyOwnership", key.usr: "c:objc(cs)FooClassPropertyOwnership", - key.offset: 6815, + key.offset: 6932, key.length: 478, key.fully_annotated_decl: "class FooClassPropertyOwnership : FooClassBase", key.inherits: [ @@ -8292,7 +8426,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "assignable", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)assignable", - key.offset: 6869, + key.offset: 6986, key.length: 42, key.fully_annotated_decl: "unowned(unsafe) var assignable: AnyObject! { get set }" }, @@ -8300,7 +8434,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "unsafeAssignable", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)unsafeAssignable", - key.offset: 6917, + key.offset: 7034, key.length: 48, key.fully_annotated_decl: "unowned(unsafe) var unsafeAssignable: AnyObject! { get set }" }, @@ -8308,7 +8442,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "retainable", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)retainable", - key.offset: 6971, + key.offset: 7088, key.length: 26, key.fully_annotated_decl: "var retainable: AnyObject! { get set }" }, @@ -8316,7 +8450,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "strongRef", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)strongRef", - key.offset: 7003, + key.offset: 7120, key.length: 25, key.fully_annotated_decl: "var strongRef: AnyObject! { get set }" }, @@ -8324,7 +8458,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "copyable", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)copyable", - key.offset: 7034, + key.offset: 7151, key.length: 35, key.fully_annotated_decl: "@NSCopying var copyable: AnyObject! { get set }" }, @@ -8332,7 +8466,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "weakRef", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)weakRef", - key.offset: 7075, + key.offset: 7192, key.length: 28, key.fully_annotated_decl: "weak var weakRef: AnyObject! { get set }" }, @@ -8340,7 +8474,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "scalar", key.usr: "c:objc(cs)FooClassPropertyOwnership(py)scalar", - key.offset: 7109, + key.offset: 7226, key.length: 17, key.fully_annotated_decl: "var scalar: Int32 { get set }" }, @@ -8349,7 +8483,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth3()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth3", - key.offset: 7132, + key.offset: 7249, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth3() -> AnyObject!" }, @@ -8358,7 +8492,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth2()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth2", - key.offset: 7173, + key.offset: 7290, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth2() -> AnyObject!" }, @@ -8367,7 +8501,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "nonInternalMeth()", key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership", key.original_usr: "c:objc(cs)FooClassBase(im)nonInternalMeth", - key.offset: 7214, + key.offset: 7331, key.length: 36, key.fully_annotated_decl: "@discardableResult func nonInternalMeth() -> AnyObject!" }, @@ -8376,7 +8510,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth1()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1::SYNTHESIZED::c:objc(cs)FooClassPropertyOwnership", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth1", - key.offset: 7256, + key.offset: 7373, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth1() -> AnyObject!" } @@ -8386,7 +8520,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.class, key.name: "FooUnavailableMembers", key.usr: "c:objc(cs)FooUnavailableMembers", - key.offset: 7294, + key.offset: 7411, key.length: 661, key.fully_annotated_decl: "class FooUnavailableMembers : FooClassBase", key.inherits: [ @@ -8401,7 +8535,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(int:)", key.usr: "c:objc(cs)FooUnavailableMembers(cm)unavailableMembersWithInt:", - key.offset: 7344, + key.offset: 7461, key.length: 31, key.fully_annotated_decl: "convenience init!(int i: Int32)", key.entities: [ @@ -8409,7 +8543,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "int", key.name: "i", - key.offset: 7369, + key.offset: 7486, key.length: 5 } ] @@ -8418,7 +8552,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.class, key.name: "withInt(_:)", key.usr: "c:objc(cs)FooUnavailableMembers(cm)unavailableMembersWithInt:", - key.offset: 7381, + key.offset: 7498, key.length: 39, key.fully_annotated_decl: "@discardableResult class func withInt(_ i: Int32) -> Self!", key.entities: [ @@ -8426,7 +8560,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "i", - key.offset: 7405, + key.offset: 7522, key.length: 5 } ], @@ -8443,7 +8577,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "unavailable()", key.usr: "c:objc(cs)FooUnavailableMembers(im)unavailable", - key.offset: 7426, + key.offset: 7543, key.length: 18, key.fully_annotated_decl: "func unavailable()", key.attributes: [ @@ -8459,7 +8593,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "swiftUnavailable()", key.usr: "c:objc(cs)FooUnavailableMembers(im)swiftUnavailable", - key.offset: 7450, + key.offset: 7567, key.length: 23, key.fully_annotated_decl: "func swiftUnavailable()", key.attributes: [ @@ -8474,7 +8608,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "deprecated()", key.usr: "c:objc(cs)FooUnavailableMembers(im)deprecated", - key.offset: 7479, + key.offset: 7596, key.length: 17, key.fully_annotated_decl: "func deprecated()", key.attributes: [ @@ -8490,7 +8624,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityIntroduced()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityIntroduced", - key.offset: 7502, + key.offset: 7619, key.length: 29, key.fully_annotated_decl: "func availabilityIntroduced()", key.attributes: [ @@ -8505,7 +8639,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityDeprecated()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityDeprecated", - key.offset: 7537, + key.offset: 7654, key.length: 29, key.fully_annotated_decl: "func availabilityDeprecated()", key.attributes: [ @@ -8524,7 +8658,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityObsoleted()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityObsoleted", - key.offset: 7572, + key.offset: 7689, key.length: 28, key.fully_annotated_decl: "func availabilityObsoleted()", key.attributes: [ @@ -8540,7 +8674,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityUnavailable()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityUnavailable", - key.offset: 7606, + key.offset: 7723, key.length: 30, key.fully_annotated_decl: "func availabilityUnavailable()", key.attributes: [ @@ -8556,7 +8690,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityIntroducedMsg()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityIntroducedMsg", - key.offset: 7642, + key.offset: 7759, key.length: 32, key.fully_annotated_decl: "func availabilityIntroducedMsg()", key.attributes: [ @@ -8572,7 +8706,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityDeprecatedMsg()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityDeprecatedMsg", - key.offset: 7680, + key.offset: 7797, key.length: 32, key.fully_annotated_decl: "func availabilityDeprecatedMsg()", key.attributes: [ @@ -8591,7 +8725,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityObsoletedMsg()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityObsoletedMsg", - key.offset: 7718, + key.offset: 7835, key.length: 31, key.fully_annotated_decl: "func availabilityObsoletedMsg()", key.attributes: [ @@ -8608,7 +8742,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.method.instance, key.name: "availabilityUnavailableMsg()", key.usr: "c:objc(cs)FooUnavailableMembers(im)availabilityUnavailableMsg", - key.offset: 7755, + key.offset: 7872, key.length: 33, key.fully_annotated_decl: "func availabilityUnavailableMsg()", key.attributes: [ @@ -8626,7 +8760,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth3()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth3::SYNTHESIZED::c:objc(cs)FooUnavailableMembers", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth3", - key.offset: 7794, + key.offset: 7911, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth3() -> AnyObject!" }, @@ -8635,7 +8769,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth2()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth2::SYNTHESIZED::c:objc(cs)FooUnavailableMembers", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth2", - key.offset: 7835, + key.offset: 7952, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth2() -> AnyObject!" }, @@ -8644,7 +8778,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "nonInternalMeth()", key.usr: "c:objc(cs)FooClassBase(im)nonInternalMeth::SYNTHESIZED::c:objc(cs)FooUnavailableMembers", key.original_usr: "c:objc(cs)FooClassBase(im)nonInternalMeth", - key.offset: 7876, + key.offset: 7993, key.length: 36, key.fully_annotated_decl: "@discardableResult func nonInternalMeth() -> AnyObject!" }, @@ -8653,7 +8787,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.name: "_internalMeth1()", key.usr: "c:objc(cs)FooClassBase(im)_internalMeth1::SYNTHESIZED::c:objc(cs)FooUnavailableMembers", key.original_usr: "c:objc(cs)FooClassBase(im)_internalMeth1", - key.offset: 7918, + key.offset: 8035, key.length: 35, key.fully_annotated_decl: "@discardableResult func _internalMeth1() -> AnyObject!" } @@ -8663,7 +8797,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.typealias, key.name: "FooCFTypeRef", key.usr: "c:Foo.h@T@FooCFTypeRef", - key.offset: 7956, + key.offset: 8073, key.length: 34, key.fully_annotated_decl: "typealias FooCFTypeRef = FooCFType", key.attributes: [ @@ -8678,7 +8812,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.class, key.name: "FooCFType", key.usr: "c:Foo.h@T@FooCFTypeRef", - key.offset: 7991, + key.offset: 8108, key.length: 19, key.fully_annotated_decl: "class FooCFType" }, @@ -8686,14 +8820,14 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "FooCFTypeRelease(_:)", key.usr: "c:@F@FooCFTypeRelease", - key.offset: 8011, + key.offset: 8128, key.length: 38, key.fully_annotated_decl: "func FooCFTypeRelease(_: FooCFType!)", key.entities: [ { key.kind: source.lang.swift.decl.var.local, key.keyword: "_", - key.offset: 8038, + key.offset: 8155, key.length: 10 } ], @@ -8710,7 +8844,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.free, key.name: "fooSubFunc1(_:)", key.usr: "c:@F@fooSubFunc1", - key.offset: 8050, + key.offset: 8167, key.length: 37, key.fully_annotated_decl: "@discardableResult func fooSubFunc1(_ a: Int32) -> Int32", key.entities: [ @@ -8718,7 +8852,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "a", - key.offset: 8072, + key.offset: 8189, key.length: 5 } ] @@ -8727,7 +8861,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.struct, key.name: "FooSubEnum1", key.usr: "c:@E@FooSubEnum1", - key.offset: 8088, + key.offset: 8205, key.length: 145, key.fully_annotated_decl: "struct FooSubEnum1 : RawRepresentable, Equatable", key.conforms: [ @@ -8747,7 +8881,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(_:)", key.usr: "s:FVSC11FooSubEnum1cFVs6UInt32S_", - key.offset: 8144, + key.offset: 8261, key.length: 24, key.fully_annotated_decl: "init(_ rawValue: UInt32)", key.entities: [ @@ -8755,7 +8889,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "_", key.name: "rawValue", - key.offset: 8161, + key.offset: 8278, key.length: 6 } ] @@ -8764,7 +8898,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.function.constructor, key.name: "init(rawValue:)", key.usr: "s:FVSC11FooSubEnum1cFT8rawValueVs6UInt32_S_", - key.offset: 8174, + key.offset: 8291, key.length: 31, key.fully_annotated_decl: "init(rawValue: UInt32)", key.conforms: [ @@ -8779,7 +8913,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.local, key.keyword: "rawValue", key.name: "rawValue", - key.offset: 8198, + key.offset: 8315, key.length: 6 } ] @@ -8788,7 +8922,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.instance, key.name: "rawValue", key.usr: "s:vVSC11FooSubEnum18rawValueVs6UInt32", - key.offset: 8211, + key.offset: 8328, key.length: 20, key.fully_annotated_decl: "var rawValue: UInt32", key.conforms: [ @@ -8805,7 +8939,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FooSubEnum1X", key.usr: "c:@E@FooSubEnum1@FooSubEnum1X", - key.offset: 8234, + key.offset: 8351, key.length: 37, key.fully_annotated_decl: "var FooSubEnum1X: FooSubEnum1 { get }" }, @@ -8813,7 +8947,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FooSubEnum1Y", key.usr: "c:@E@FooSubEnum1@FooSubEnum1Y", - key.offset: 8272, + key.offset: 8389, key.length: 37, key.fully_annotated_decl: "var FooSubEnum1Y: FooSubEnum1 { get }" }, @@ -8821,7 +8955,7 @@ var FooSubUnnamedEnumeratorA1: Int { get } key.kind: source.lang.swift.decl.var.global, key.name: "FooSubUnnamedEnumeratorA1", key.usr: "c:@Ea@FooSubUnnamedEnumeratorA1@FooSubUnnamedEnumeratorA1", - key.offset: 8310, + key.offset: 8427, key.length: 42, key.fully_annotated_decl: "var FooSubUnnamedEnumeratorA1: Int { get }" } diff --git a/test/SourceKit/DocSupport/doc_swift_module.swift.response b/test/SourceKit/DocSupport/doc_swift_module.swift.response index 3666a3f6e3e..bb5f127a8d0 100644 --- a/test/SourceKit/DocSupport/doc_swift_module.swift.response +++ b/test/SourceKit/DocSupport/doc_swift_module.swift.response @@ -69,6 +69,10 @@ enum MyEnum : Int { init?(_ text: String, radix radix: Int = default) init(_ objectID: ObjectIdentifier) + + init(bitPattern bitPattern: UnsafeMutablePointer?) + + init(bitPattern bitPattern: UnsafePointer?) } extension MyEnum : CustomStringConvertible { @@ -1345,139 +1349,158 @@ func genfooenum MyEnum : Int", key.inherits: [ { @@ -2677,12 +2765,58 @@ func genfooinit<U>(bitPattern: UnsafeMutablePointer<U>?)", + key.entities: [ + { + key.kind: source.lang.swift.decl.var.local, + key.keyword: "bitPattern", + key.name: "bitPattern", + key.offset: 1355, + key.length: 24 + } + ] + }, + { + key.kind: source.lang.swift.decl.function.constructor, + key.name: "init(bitPattern:)", + key.usr: "s:FSicurFT10bitPatternGSqGSPx___Si::SYNTHESIZED::s:O4cake6MyEnum", + key.original_usr: "s:FSicurFT10bitPatternGSqGSPx___Si", + key.generic_params: [ + { + key.name: "U" + } + ], + key.offset: 1386, + key.length: 49, + key.fully_annotated_decl: "init<U>(bitPattern: UnsafePointer<U>?)", + key.entities: [ + { + key.kind: source.lang.swift.decl.var.local, + key.keyword: "bitPattern", + key.name: "bitPattern", + key.offset: 1417, + key.length: 17 + } + ] } ] }, { key.kind: source.lang.swift.decl.extension.enum, - key.offset: 1322, + key.offset: 1439, key.length: 83, key.conforms: [ { @@ -2703,7 +2837,7 @@ func genfoodescriptions:vSi11descriptionSSvar description: String { get }A textual representation of self.", - key.offset: 1372, + key.offset: 1489, key.length: 31, key.fully_annotated_decl: "var description: String { get }", key.conforms: [ @@ -2718,7 +2852,7 @@ func genfoohashValues:vSi9hashValueSivar hashValue: Int { get }The hash value.Axiom: x == y implies x.hashValue == y.hashValue.The hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.", - key.offset: 1442, + key.offset: 1559, key.length: 26, key.fully_annotated_decl: "var hashValue: Int { get }", key.conforms: [ @@ -2754,7 +2888,7 @@ func genfooallZeross:ZvSi8allZerosSistatic var allZeros: Int { get }The empty bitset of type Int.", - key.offset: 1553, + key.offset: 1670, key.length: 32, key.fully_annotated_decl: "static var allZeros: Int { get }", key.conforms: [ @@ -2807,7 +2941,7 @@ func genfoocustomMirrors:vSi12customMirrorVs6Mirrorvar customMirror: Mirror { get }Returns a mirror that reflects self.", - key.offset: 1633, + key.offset: 1750, key.length: 32, key.fully_annotated_decl: "var customMirror: Mirror { get }", key.conforms: [ @@ -2843,7 +2977,7 @@ func genfoovar customPlaygroundQuickLook: PlaygroundQuickLook { get }", key.conforms: [ @@ -2878,7 +3012,7 @@ func genfoo@objc protocol P2", key.entities: [ @@ -2905,7 +3039,7 @@ func genfoooptional func foo1()", key.is_optional: 1 @@ -2916,7 +3050,7 @@ func genfooprotocol Prot", key.entities: [ @@ -2924,7 +3058,7 @@ func genfooassociatedtype Element" }, @@ -2932,7 +3066,7 @@ func genfoovar p: Int { get }" }, @@ -2940,7 +3074,7 @@ func genfoofunc foo()" }, @@ -2948,7 +3082,7 @@ func genfoofunc foo1()" } @@ -2956,7 +3090,7 @@ func genfoofunc foo1()" } @@ -2982,7 +3116,7 @@ func genfoofunc extfoo()" } @@ -3004,7 +3138,7 @@ func genfoostruct S1", key.entities: [ @@ -3012,7 +3146,7 @@ func genfooenum SE", key.entities: [ @@ -3020,7 +3154,7 @@ func genfoocase a" }, @@ -3028,7 +3162,7 @@ func genfoocase b" }, @@ -3036,7 +3170,7 @@ func genfoocase c" } @@ -3046,7 +3180,7 @@ func genfoofunc foo1()" }, @@ -3054,7 +3188,7 @@ func genfoostruct S2", key.entities: [ @@ -3062,7 +3196,7 @@ func genfoolet b: Int" } @@ -3092,7 +3226,7 @@ func genfoofunc genfoo<T1 : Prot, T2 : C1 where T1.Element == Int, T2.Element == T1.Element>(x ix: T1, y iy: T2)", key.entities: [ @@ -3100,14 +3234,14 @@ func genfoo typealias DS = MyType -typealias BadA = MyType // expected-error {{type parameters may not be constrained in typealias argument list}} +typealias BadA = MyType // expected-error {{inheritance from non-protocol, non-class type 'Int'}} typealias BadB = MyType // expected-error {{associated types may not have a generic parameter list}} // expected-error @-1 {{same-type requirement makes generic parameter 'T' non-generic}} @@ -60,7 +60,6 @@ func f() { } - typealias A = MyType // expected-note {{generic type 'A' declared here}} typealias B = MyType // expected-note {{'T1' declared as parameter to type 'B'}} @@ -91,8 +90,6 @@ let _ : D = D(a: 1, b: 2) // expected-error @+1 {{generic parameter 'T3' could not be inferred}} let _ : D = D(a: 1, b: 2) - - let _ : F = { (a : Int) -> Int in a } // Infer the types of F // TODO QoI: Cannot infer T1/T2. @@ -114,6 +111,34 @@ _ = G(a: "foo", b: 42) _ = G(a: "foo", b: 42) +struct MyTypeWithHashable { +} + +typealias MTWHInt = MyTypeWithHashable +typealias MTWHInt2 = MyTypeWithHashable // expected-error {{type 'HT' does not conform to protocol 'Hashable'}} + +func f(a : MyTypeWithHashable) { + f(a: MyTypeWithHashable()) + f(a: MTWHInt()) +} + + + + +// FIXME: Nested generic typealiases aren't working yet. +struct GenericStruct { + typealias TA = MyType + + func testCapture(s : S, t : T) -> TA { // expected-error {{cannot specialize non-generic type 'MyType'}} + return TA(a: t, b : s) + } +} + +let _ = GenericStruct.TA(a: 4.0, b: 1) // expected-error {{'Int' is not convertible to 'Float'}} + +let _ : GenericStruct.TA // expected-error {{cannot specialize non-generic type 'MyType'}} + + extension A {} // expected-error {{non-nominal type 'A' cannot be extended}} extension A {} // expected-error {{generic type 'A' specialized with too few type parameters (got 1, but expected 2)}} diff --git a/test/expr/expressions.swift b/test/expr/expressions.swift index 6c9eae49ebd..da0343ed8bd 100644 --- a/test/expr/expressions.swift +++ b/test/expr/expressions.swift @@ -583,10 +583,10 @@ func iterators() { //===----------------------------------------------------------------------===// func magic_literals() { - _ = __FILE__ // expected-warning {{__FILE__ is deprecated and will be removed in Swift 3, please use #file}} - _ = __LINE__ // expected-warning {{__LINE__ is deprecated and will be removed in Swift 3, please use #line}} - _ = __COLUMN__ // expected-warning {{__COLUMN__ is deprecated and will be removed in Swift 3, please use #column}} - _ = __DSO_HANDLE__ // expected-warning {{__DSO_HANDLE__ is deprecated and will be removed in Swift 3, please use #dsohandle}} + _ = __FILE__ // expected-error {{__FILE__ has been replaced with #file in Swift 3}} + _ = __LINE__ // expected-error {{__LINE__ has been replaced with #line in Swift 3}} + _ = __COLUMN__ // expected-error {{__COLUMN__ has been replaced with #column in Swift 3}} + _ = __DSO_HANDLE__ // expected-error {{__DSO_HANDLE__ has been replaced with #dsohandle in Swift 3}} _ = #file _ = #line + #column @@ -817,18 +817,18 @@ func swift22_deprecation_increment_decrement() { var i = 0 var f = 1.0 - i++ // expected-warning {{'++' is deprecated: it will be removed in Swift 3}} {{4-6= += 1}} - --i // expected-warning {{'--' is deprecated: it will be removed in Swift 3}} {{3-5=}} {{6-6= -= 1}} - _ = i++ // expected-warning {{'++' is deprecated: it will be removed in Swift 3}} + i++ // expected-error {{'++' is unavailable}} {{4-6= += 1}} + --i // expected-error {{'--' is unavailable}} {{3-5=}} {{6-6= -= 1}} + _ = i++ // expected-error {{'++' is unavailable}} - ++f // expected-warning {{'++' is deprecated: it will be removed in Swift 3}} {{3-5=}} {{6-6= += 1}} - f-- // expected-warning {{'--' is deprecated: it will be removed in Swift 3}} {{4-6= -= 1}} - _ = f-- // expected-warning {{'--' is deprecated: it will be removed in Swift 3}} {{none}} + ++f // expected-error {{'++' is unavailable}} {{3-5=}} {{6-6= += 1}} + f-- // expected-error {{'--' is unavailable}} {{4-6= -= 1}} + _ = f-- // expected-error {{'--' is unavailable}} {{none}} // Swift ++fix-it produces bad code in nested expressions // This should not get a fixit hint. var j = 2 - i = ++j // expected-warning {{'++' is deprecated: it will be removed in Swift 3}} {{none}} + i = ++j // expected-error {{'++' is unavailable}} {{none}} } // SR-628 mixing lvalues and rvalues in tuple expression diff --git a/test/lit.cfg b/test/lit.cfg index 187f0dc2440..fce384a673e 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -39,14 +39,14 @@ def darwin_get_sdk_version(sdk_path): system_version_plist_path = os.path.join( sdk_path, "System", "Library", "CoreServices", "SystemVersion.plist") name = subprocess.check_output( - [ "defaults", "read", system_version_plist_path, - "ProductName" ]).rstrip() + ["defaults", "read", system_version_plist_path, + "ProductName"]).rstrip() vers = subprocess.check_output( - [ "defaults", "read", system_version_plist_path, - "ProductVersion" ]).rstrip() + ["defaults", "read", system_version_plist_path, + "ProductVersion"]).rstrip() build = subprocess.check_output( - [ "defaults", "read", system_version_plist_path, - "ProductBuildVersion" ]).rstrip() + ["defaults", "read", system_version_plist_path, + "ProductBuildVersion"]).rstrip() return (name, vers, build) @@ -458,10 +458,10 @@ elif swift_test_mode == 'optimize_unchecked': config.available_features.add("swift_test_mode_optimize_unchecked_" + run_cpu) config.available_features.add("swift_test_mode_optimize_unchecked") swift_execution_tests_extra_flags = '-Ounchecked' -elif swift_test_mode == 'executable': +elif swift_test_mode == 'only_executable': # No extra flags needed. pass -elif swift_test_mode == 'non_executable': +elif swift_test_mode == 'only_non_executable': # No extra flags needed. pass else: @@ -476,6 +476,9 @@ elif swift_run_only_tests == 'executable_tests': config.limit_to_features.add("executable_test") elif swift_run_only_tests == 'non_executable_tests': pass +elif swift_run_only_tests == 'long_tests': + config.available_features.add("long_test") + config.limit_to_features.add("long_test") else: lit_config.fatal("Unknown test mode %r" % swift_run_only_tests) diff --git a/test/stmt/statements.swift b/test/stmt/statements.swift index df3ec335b04..c381e507fa5 100644 --- a/test/stmt/statements.swift +++ b/test/stmt/statements.swift @@ -118,35 +118,6 @@ SomeGeneric .builderProp .builder2() -func for_loop() { - var x = 0 - for ;; { } // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for x = 1; x != 42; x += 1 { } // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for infloopbooltest(); x != 12; infloopbooltest() {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - - for ; { } // expected-error {{expected ';' in 'for' statement}} - - for var y = 1; y != 42; y += 1 {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for (var y = 1; y != 42; y += 1) {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - var z = 10 - for (; z != 0; z -= 1) {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for (z = 10; z != 0; z -= 1) {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for var (a,b) = (0,12); a != b; b -= 1 {a += 1} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for (var (a,b) = (0,12); a != b; b -= 1) {a += 1} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - var j, k : Int - for ((j,k) = (0,10); j != k; k -= 1) {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for var i = 0, j = 0; i * j < 10; i += 1, j += 1 {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - for j = 0, k = 52; j < k; j += 1, k -= 1 { } // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - // rdar://19540536 - // expected-error@+4{{expected var declaration in a 'for' statement}} - // expected-error@+3{{expression resolves to an unused function}} - // expected-error@+2{{expected an attribute name}} - // expected-error@+1{{braced block of statements is an unused closure}} - for @ {} - - // Is increment in for loop optional? - for (let i = 0; i < 10; ) {} // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} -} break // expected-error {{'break' is only allowed inside a loop, if, do, or switch}} continue // expected-error {{'continue' is only allowed inside a loop}} @@ -432,21 +403,6 @@ func testThrowNil() throws { } -// -func for_ignored_lvalue_init() { - var i = 0 - for i; // expected-error {{expression resolves to an unused l-value}} expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - i < 10; i += 1 {} -} - -// rdar://problem/18643692 -func for_loop_multi_iter() { - for (var i = 0, x = 0; i < 10; i += 1, // expected-warning {{C-style for statement is deprecated and will be removed in a future version of Swift}} - x) { // expected-error {{expression resolves to an unused l-value}} - x -= 1 - } -} - // rdar://problem/23684220 // Even if the condition fails to typecheck, save it in the AST anyway; the old // condition may have contained a SequenceExpr. diff --git a/tools/swift-reflection-dump/swift-reflection-dump.cpp b/tools/swift-reflection-dump/swift-reflection-dump.cpp index b55c4aac7ca..83d30eda5a7 100644 --- a/tools/swift-reflection-dump/swift-reflection-dump.cpp +++ b/tools/swift-reflection-dump/swift-reflection-dump.cpp @@ -16,9 +16,8 @@ #include "swift/ABI/MetadataValues.h" #include "swift/Basic/Demangle.h" #include "swift/Basic/LLVMInitialize.h" -#include "swift/Reflection/ReflectionContext.h" -#include "swift/Remote/InProcessMemoryReader.h" #include "swift/Reflection/TypeRef.h" +#include "swift/Reflection/TypeRefBuilder.h" #include "llvm/Object/Archive.h" #include "llvm/Object/MachO.h" #include "llvm/Object/MachOUniversal.h" @@ -204,10 +203,9 @@ static int doDumpReflectionSections(std::string binaryFilename, reinterpret_cast(reflectionStringsSectionContents.end()) }; - // Construct the reflection context - auto reader = std::make_shared(); - ReflectionContext>> RC(reader); - RC.addReflectionInfo({ + // Construct the TypeRefBuilder + TypeRefBuilder builder; + builder.addReflectionInfo({ binaryFilename, fieldSection, associatedTypeSection, @@ -217,7 +215,7 @@ static int doDumpReflectionSections(std::string binaryFilename, }); // Dump everything - RC.dumpAllSections(std::cout); + builder.dumpAllSections(std::cout); return EXIT_SUCCESS; } diff --git a/unittests/Basic/UnicodeGraphemeBreakTest.cpp.gyb b/unittests/Basic/UnicodeGraphemeBreakTest.cpp.gyb index b1f4697390f..ea00562ec7f 100644 --- a/unittests/Basic/UnicodeGraphemeBreakTest.cpp.gyb +++ b/unittests/Basic/UnicodeGraphemeBreakTest.cpp.gyb @@ -46,7 +46,7 @@ static std::vector FindGraphemeClusterBoundaries(StringRef Str) { TEST(ExtractExtendedGraphemeCluster, TestsFromUnicodeSpec) { % for subject_string, expected_boundaries in grapheme_cluster_break_tests: - EXPECT_EQ((std::vector{ ${', '.join([ str(x) for x in expected_boundaries ])} }), + EXPECT_EQ((std::vector{ ${', '.join([str(x) for x in expected_boundaries])} }), FindGraphemeClusterBoundaries("${subject_string}")); % end } diff --git a/utils/SwiftBuildSupport.py b/utils/SwiftBuildSupport.py index cc301b2310b..f7fc57bb32b 100644 --- a/utils/SwiftBuildSupport.py +++ b/utils/SwiftBuildSupport.py @@ -186,7 +186,7 @@ def get_preset_options(substitutions, preset_file_names, preset_name): (build_script_opts, build_script_impl_opts, missing_opts) = \ _get_preset_options_impl(config, substitutions, preset_name) - if not build_script_opts: + if not build_script_opts and not build_script_impl_opts: print_with_argv0("preset '" + preset_name + "' not found") sys.exit(1) if missing_opts: diff --git a/utils/build-presets.ini b/utils/build-presets.ini index b1df6d538e9..5830d5ade6e 100644 --- a/utils/build-presets.ini +++ b/utils/build-presets.ini @@ -169,6 +169,17 @@ skip-test-ios-host skip-test-tvos-host skip-test-watchos-host + +[preset: buildbot,tools=RA,stdlib=RDA,long_test] +mixin-preset= + mixin_buildbot_tools_RA_stdlib_RDA + +test=0 +validation-test=0 +long-test=1 +test-optimized=0 + + [preset: buildbot,tools=RA-flto,stdlib=RDA] mixin-preset= mixin_buildbot_tools_RA_stdlib_RDA @@ -560,6 +571,7 @@ lldb release test validation-test +long-test foundation dash-dash @@ -612,6 +624,27 @@ install-destdir=%(install_destdir)s installable-package=%(installable_package)s +[preset: buildbot_incremental_linux] +release +test +validation-test +llbuild +swiftpm +xctest +foundation + +dash-dash +reconfigure + +[preset: buildbot_incremental_linux,long_test] +mixin-preset=buildbot_incremental_linux + +test=0 +validation-test=0 +long-test=1 +test-optimized=0 + + #===------------------------------------------------------------------------===# # OS X Package Builders #===------------------------------------------------------------------------===# @@ -671,6 +704,7 @@ tvos watchos test validation-test +long-test dash-dash diff --git a/utils/build-script b/utils/build-script index d9912340e4b..e68fb9e3a89 100755 --- a/utils/build-script +++ b/utils/build-script @@ -17,7 +17,6 @@ import os import platform import shutil import sys -import textwrap # FIXME: Instead of modifying the system path in order to enable imports from # other directories, all Python modules related to the build script @@ -48,6 +47,18 @@ import swift_build_support.ninja # noqa (E402) import swift_build_support.tar # noqa (E402) import swift_build_support.targets # noqa (E402) +# A strict parser for bools (unlike Python's `bool()`, where +# `bool('False')` is `True`). +# +# This function can be pased as `type=` argument to argparse to parse values +# passed to command line arguments. +def argparse_bool(string): + if string in ['0', 'false', 'False']: + return False + if string in ['1', 'true', 'True']: + return True + raise argparse.ArgumentTypeError("%r is not a boolean value" % string) + # Main entry point for the preset mode. def main_preset(): @@ -361,22 +372,21 @@ details of the setups of other systems or automated environments.""") "--symbols-package", metavar="PATH", help="if provided, an archive of the symbols directory will be " - "generated at this path") + "generated at this path") build_variant_group = parser.add_mutually_exclusive_group(required=False) build_variant_group.add_argument( "-d", "--debug", - help=""" -build the Debug variant of everything (LLVM, Clang, Swift host tools, target -Swift standard libraries, LLDB (if enabled) -(default)""", + help="build the Debug variant of everything (LLVM, Clang, Swift host " + "tools, target Swift standard libraries, LLDB (if enabled) " + "(default)", action="store_const", const="Debug", dest="build_variant") build_variant_group.add_argument( "-r", "--release-debuginfo", - help=""" -build the RelWithDebInfo variant of everything (default is Debug)""", + help="build the RelWithDebInfo variant of everything (default is " + "Debug)", action="store_const", const="RelWithDebInfo", dest="build_variant") @@ -403,8 +413,8 @@ build the RelWithDebInfo variant of everything (default is Debug)""", dest="swift_build_variant") build_variant_override_group.add_argument( "--debug-swift-stdlib", - help=""" -build the Debug variant of the Swift standard library and SDK overlay""", + help="build the Debug variant of the Swift standard library and SDK " + "overlay", action="store_const", const="Debug", dest="swift_stdlib_build_variant") @@ -530,11 +540,24 @@ build the Debug variant of the Swift standard library and SDK overlay""", run_tests_group.add_argument( "-t", "--test", help="test Swift after building", - action="store_true") + nargs='?', + type=argparse_bool, + default=False, + const=True) run_tests_group.add_argument( "-T", "--validation-test", help="run the validation test suite (implies --test)", - action="store_true") + nargs='?', + type=argparse_bool, + default=False, + const=True) + run_tests_group.add_argument( + "--long-test", + help="run the long test suite", + nargs='?', + type=argparse_bool, + default=False, + const=True) run_tests_group.add_argument( "--host-test", help="run executable tests on host devices (such as iOS or tvOS)", @@ -557,14 +580,17 @@ build the Debug variant of the Swift standard library and SDK overlay""", action="store_true") parser.add_argument( "--build-runtime-with-host-compiler", - help="Use the host compiler, not the self-built one to compile the " + - "Swift runtime", + help="Use the host compiler, not the self-built one to compile the " + "Swift runtime", action="store_true") parser.add_argument( "-o", "--test-optimized", help="run the test suite in optimized mode too (implies --test)", - action="store_true") + nargs='?', + type=argparse_bool, + default=False, + const=True) run_build_group = parser.add_argument_group( title="Run build") @@ -595,7 +621,7 @@ build the Debug variant of the Swift standard library and SDK overlay""", skip_test_group.add_argument( "--skip-test-ios", help="skip testing all iOS targets. Equivalent to specifying both " - "--skip-test-ios-simulator and --skip-test-ios-host", + "--skip-test-ios-simulator and --skip-test-ios-host", action="store_true") skip_test_group.add_argument( "--skip-test-ios-simulator", @@ -604,12 +630,12 @@ build the Debug variant of the Swift standard library and SDK overlay""", skip_test_group.add_argument( "--skip-test-ios-host", help="skip testing iOS device targets on the host machine (the phone " - "itself)", + "itself)", action="store_true") skip_test_group.add_argument( "--skip-test-tvos", help="skip testing all tvOS targets. Equivalent to specifying both " - "--skip-test-tvos-simulator and --skip-test-tvos-host", + "--skip-test-tvos-simulator and --skip-test-tvos-host", action="store_true") skip_test_group.add_argument( "--skip-test-tvos-simulator", @@ -618,12 +644,12 @@ build the Debug variant of the Swift standard library and SDK overlay""", skip_test_group.add_argument( "--skip-test-tvos-host", help="skip testing tvOS device targets on the host machine (the TV " - "itself)", + "itself)", action="store_true") skip_test_group.add_argument( "--skip-test-watchos", help="skip testing all tvOS targets. Equivalent to specifying both " - "--skip-test-watchos-simulator and --skip-test-watchos-host", + "--skip-test-watchos-simulator and --skip-test-watchos-host", action="store_true") skip_test_group.add_argument( "--skip-test-watchos-simulator", @@ -632,25 +658,25 @@ build the Debug variant of the Swift standard library and SDK overlay""", skip_test_group.add_argument( "--skip-test-watchos-host", help="skip testing watchOS device targets on the host machine (the " - "watch itself)", + "watch itself)", action="store_true") parser.add_argument( "-i", "--ios", - help=""" -also build for iOS, but disallow tests that require an iOS device""", + help="also build for iOS, but disallow tests that require an iOS " + "device", action="store_true") parser.add_argument( "--tvos", - help=""" -also build for tvOS, but disallow tests that require a tvos device""", + help="also build for tvOS, but disallow tests that require a tvos " + "device", action="store_true") parser.add_argument( "--watchos", - help=""" -also build for watchOS, but disallow tests that require an watchOS device""", + help="also build for watchOS, but disallow tests that require an " + "watchOS device", action="store_true") parser.add_argument( @@ -660,22 +686,21 @@ also build for watchOS, but disallow tests that require an watchOS device""", parser.add_argument( "--swift-analyze-code-coverage", - help="""enable code coverage analysis in Swift (false, not-merged, - merged).""", + help="enable code coverage analysis in Swift (false, not-merged, " + "merged).", choices=["false", "not-merged", "merged"], default="false", # so CMake can see the inert mode as a false value dest="swift_analyze_code_coverage") parser.add_argument( "--build-subdir", - help=""" -name of the directory under $SWIFT_BUILD_ROOT where the build products will be -placed""", + help="name of the directory under $SWIFT_BUILD_ROOT where the build " + "products will be placed", metavar="PATH") parser.add_argument( "--install-prefix", help="The installation prefix. This is where built Swift products " - "(like bin, lib, and include) will be installed.", + "(like bin, lib, and include) will be installed.", metavar="PATH", default=swift_build_support.targets.install_prefix()) parser.add_argument( @@ -685,8 +710,7 @@ placed""", parser.add_argument( "-j", "--jobs", - help=""" -the number of parallel build jobs to use""", + help="the number of parallel build jobs to use", type=int, dest="build_jobs", default=multiprocessing.cpu_count()) @@ -697,19 +721,19 @@ the number of parallel build jobs to use""", default="default") parser.add_argument( "--cmake", - help="the path to a CMake executable that will be " - "used to build Swift") + help="the path to a CMake executable that will be used to build " + "Swift") parser.add_argument( "--show-sdks", help="print installed Xcode and SDK versions", action="store_true") parser.add_argument( - "--extra-swift-args", help=textwrap.dedent(""" - Pass through extra flags to swift in the form of a cmake list - 'module_regexp;flag'. Can be called multiple times to add multiple such - module_regexp flag pairs. All semicolons in flags must be escaped with - a '\'"""), + "--extra-swift-args", + help="Pass through extra flags to swift in the form of a cmake list " + "'module_regexp;flag'. Can be called multiple times to add " + "multiple such module_regexp flag pairs. All semicolons in flags " + "must be escaped with a '\\'", action="append", dest="extra_swift_args", default=[]) android_group = parser.add_argument_group( @@ -748,10 +772,10 @@ the number of parallel build jobs to use""", metavar="PATH") parser.add_argument( - "--extra-cmake-options", help=textwrap.dedent(""" - Pass through extra options to CMake in the form of comma separated options - '-DCMAKE_VAR1=YES,-DCMAKE_VAR2=/tmp'. Can be called multiple times to add - multiple such options."""), + "--extra-cmake-options", + help="Pass through extra options to CMake in the form of comma " + "separated options '-DCMAKE_VAR1=YES,-DCMAKE_VAR2=/tmp'. Can be " + "called multiple times to add multiple such options.", action="append", dest="extra_cmake_options", default=[]) parser.add_argument( @@ -900,7 +924,7 @@ the number of parallel build jobs to use""", "--export-compile-commands" ] - if not args.test: + if not args.test and not args.validation_test and not args.long_test: build_script_impl_inferred_args += [ "--skip-test-cmark", "--skip-test-lldb", @@ -922,9 +946,14 @@ the number of parallel build jobs to use""", "--skip-test-watchos-host", ] - if not args.validation_test: + if args.validation_test: build_script_impl_inferred_args += [ - "--skip-test-validation" + "--validation-test" + ] + + if args.long_test: + build_script_impl_inferred_args += [ + "--long-test" ] if not args.host_test: diff --git a/utils/build-script-impl b/utils/build-script-impl index 6e3eeb0d912..b8b051d2c0d 100755 --- a/utils/build-script-impl +++ b/utils/build-script-impl @@ -149,7 +149,8 @@ KNOWN_SETTINGS=( skip-test-tvos-host "" "set to skip testing the host parts of the tvOS toolchain" skip-test-watchos-simulator "" "set to skip testing Swift stdlibs for Apple watchOS simulators (i.e. test devices only)" skip-test-watchos-host "" "set to skip testing the host parts of the watchOS toolchain" - skip-test-validation "" "set to skip validation test suite" + validation-test "0" "set to run the validation test suite" + long-test "0" "set to run the long test suite" skip-test-benchmarks "" "set to skip running Swift Benchmark Suite" skip-test-optimized "" "set to skip testing the test suite in optimized mode" stress-test-sourcekit "" "set to run the stress-SourceKit target" @@ -1069,10 +1070,10 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do if [[ "${BUILD_SWIFT_STDLIB_UNITTEST_EXTRA}" == "1" ]] ; then SWIFT_STDLIB_TARGETS+=("swift-stdlib-${deployment_target}") else - if [[ "${SKIP_TEST_VALIDATION}" ]] ; then - SWIFT_STDLIB_TARGETS+=("swift-test-stdlib-${deployment_target}") - else + if [[ "${VALIDATION_TEST}" == "1" ]] ; then SWIFT_STDLIB_TARGETS+=("swift-stdlib-${deployment_target}") + else + SWIFT_STDLIB_TARGETS+=("swift-test-stdlib-${deployment_target}") fi fi fi @@ -1083,20 +1084,27 @@ for deployment_target in "${STDLIB_DEPLOYMENT_TARGETS[@]}"; do fi fi if [[ "${test_this_target}" ]] ; then + test_target_suffix="" if [[ -n "${test_host_only}" ]] ; then test_target_suffix="-non-executable" fi - if [[ "${SKIP_TEST_VALIDATION}" ]] ; then - SWIFT_TEST_TARGETS+=("check-swift${test_target_suffix}-${deployment_target}") - if [[ $(not ${SKIP_TEST_OPTIMIZED}) && ! -n "${test_host_only}" ]] ; then - SWIFT_TEST_TARGETS+=("check-swift-optimize-${deployment_target}") + + test_subset_target_suffix="" + if [[ "${VALIDATION_TEST}" == "1" ]] ; then + if [[ "${LONG_TEST}" == "1" ]] ; then + test_subset_target_suffix="-all" + else + test_subset_target_suffix="-validation" fi else - SWIFT_TEST_TARGETS+=("check-swift-all${test_target_suffix}-${deployment_target}") - if [[ $(not ${SKIP_TEST_OPTIMIZED}) && ! -n "${test_host_only}" ]] ; then - SWIFT_TEST_TARGETS+=("check-swift-all-optimize-${deployment_target}") + if [[ "${LONG_TEST}" == "1" ]] ; then + test_subset_target_suffix="-only_long" fi fi + SWIFT_TEST_TARGETS+=("check-swift${test_subset_target_suffix}${test_target_suffix}-${deployment_target}") + if [[ $(not ${SKIP_TEST_OPTIMIZED}) && ! -n "${test_host_only}" ]] ; then + SWIFT_TEST_TARGETS+=("check-swift${test_subset_target_suffix}-optimize-${deployment_target}") + fi fi done @@ -1564,32 +1572,8 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}" echo "${product}: using standard linker" fi - PRODUCT=$(toupper ${product}) llvm_build_dir=$(build_directory ${deployment_target} llvm) module_cache="${build_dir}/module-cache" - swift_cmake_options=( - "${swift_cmake_options[@]}" - -DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}" - -DLLVM_CONFIG:PATH="$(build_directory_bin ${deployment_target} llvm)/llvm-config" - -D${PRODUCT}_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}" - -D${PRODUCT}_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}" - -D${PRODUCT}_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}" - -D${PRODUCT}_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}" - -D${PRODUCT}_PATH_TO_CMARK_SOURCE:PATH="${CMARK_SOURCE_DIR}" - -D${PRODUCT}_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${deployment_target} cmark)" - ) - - if [[ "${CMAKE_GENERATOR}" == "Xcode" ]] ; then - swift_cmake_options=( - "${swift_cmake_options[@]-}" - -D${PRODUCT}_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src/${CMARK_BUILD_TYPE} - ) - else - swift_cmake_options=( - "${swift_cmake_options[@]-}" - -D${PRODUCT}_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src - ) - fi case ${product} in cmark) @@ -1747,8 +1731,32 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}" -DSWIFT_ENABLE_LTO:BOOL=$(true_false "${SWIFT_ENABLE_LTO}") -DSWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER:BOOL=$(true_false "${BUILD_RUNTIME_WITH_HOST_COMPILER}") "${swift_cmake_options[@]}" - "${SWIFT_SOURCE_DIR}" ) + + cmake_options=( + "${cmake_options[@]}" + -DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}" + -DLLVM_CONFIG:PATH="$(build_directory_bin ${deployment_target} llvm)/llvm-config" + -DSWIFT_PATH_TO_CLANG_SOURCE:PATH="${CLANG_SOURCE_DIR}" + -DSWIFT_PATH_TO_CLANG_BUILD:PATH="${llvm_build_dir}" + -DSWIFT_PATH_TO_LLVM_SOURCE:PATH="${LLVM_SOURCE_DIR}" + -DSWIFT_PATH_TO_LLVM_BUILD:PATH="${llvm_build_dir}" + -DSWIFT_PATH_TO_CMARK_SOURCE:PATH="${CMARK_SOURCE_DIR}" + -DSWIFT_PATH_TO_CMARK_BUILD:PATH="$(build_directory ${deployment_target} cmark)" + ) + + if [[ "${CMAKE_GENERATOR}" == "Xcode" ]] ; then + cmake_options=( + "${cmake_options[@]}" + -DSWIFT_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src/${CMARK_BUILD_TYPE} + ) + else + cmake_options=( + "${cmake_options[@]}" + -DSWIFT_CMARK_LIBRARY_DIR:PATH=$(build_directory ${deployment_target} cmark)/src + ) + fi + if [[ "${SWIFT_SDKS}" ]] ; then cmake_options=( "${cmake_options[@]}" @@ -1773,6 +1781,12 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}" build_targets=("${build_targets[@]}" "${SWIFT_BENCHMARK_TARGETS[@]}") fi + + cmake_options=( + "${cmake_options[@]}" + "${SWIFT_SOURCE_DIR}" + ) + skip_build=${SKIP_BUILD_SWIFT} ;; lldb) @@ -2037,10 +2051,12 @@ for deployment_target in "${HOST_TARGET}" "${CROSS_TOOLS_DEPLOYMENT_TARGETS[@]}" fi # Configure if necessary. - if [[ "${RECONFIGURE}" || ! -f "${build_dir}/CMakeCache.txt" || \ + cmake_cache_path="${build_dir}/CMakeCache.txt" + if [[ "${RECONFIGURE}" || ! -f "${cmake_cache_path}" || \ ( ! -z "${generator_output_path}" && ! -f "${generator_output_path}" ) ]] ; then - mkdir -p "${build_dir}" set -x + mkdir -p "${build_dir}" + rm -f "${cmake_cache_path}" (cd "${build_dir}" && "${CMAKE}" "${cmake_options[@]}" ${USER_CONFIG_ARGS}) { set +x; } 2>/dev/null fi diff --git a/validation-test/IDE/crashers/037-swift-typechecker-resolvetypeincontext.swift b/validation-test/IDE/crashers/037-swift-typechecker-resolvetypeincontext.swift index ebdb3c9c8ae..24ffeb9df5b 100644 --- a/validation-test/IDE/crashers/037-swift-typechecker-resolvetypeincontext.swift +++ b/validation-test/IDE/crashers/037-swift-typechecker-resolvetypeincontext.swift @@ -1,4 +1,7 @@ // RUN: not --crash %target-swift-ide-test -code-completion -code-completion-token=A -source-filename=%s + +// REQUIRES: asserts + A{extension{ class A{func c var d=c let t{#^A^# diff --git a/validation-test/SIL/Inputs/gen_parse_stdlib_tests.sh b/validation-test/SIL/Inputs/gen_parse_stdlib_tests.sh index a318049da73..1df14bcc929 100755 --- a/validation-test/SIL/Inputs/gen_parse_stdlib_tests.sh +++ b/validation-test/SIL/Inputs/gen_parse_stdlib_tests.sh @@ -14,6 +14,7 @@ for id in $(seq 0 $process_id_max); do // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=$process_count -ast-verifier-process-id=$id > /dev/null +// REQUIRES: long_test __EOF__ done diff --git a/validation-test/SIL/parse_stdlib_0.sil b/validation-test/SIL/parse_stdlib_0.sil index 27120997ebb..73562b574e0 100644 --- a/validation-test/SIL/parse_stdlib_0.sil +++ b/validation-test/SIL/parse_stdlib_0.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=0 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_1.sil b/validation-test/SIL/parse_stdlib_1.sil index 58a9e516818..f7ebf09fd4b 100644 --- a/validation-test/SIL/parse_stdlib_1.sil +++ b/validation-test/SIL/parse_stdlib_1.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=1 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_10.sil b/validation-test/SIL/parse_stdlib_10.sil index de06650f40f..93e1bd28e70 100644 --- a/validation-test/SIL/parse_stdlib_10.sil +++ b/validation-test/SIL/parse_stdlib_10.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=10 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_11.sil b/validation-test/SIL/parse_stdlib_11.sil index 53d4091d2ad..cf2276f633f 100644 --- a/validation-test/SIL/parse_stdlib_11.sil +++ b/validation-test/SIL/parse_stdlib_11.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=11 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_12.sil b/validation-test/SIL/parse_stdlib_12.sil index 28dc449d10a..88b5564c546 100644 --- a/validation-test/SIL/parse_stdlib_12.sil +++ b/validation-test/SIL/parse_stdlib_12.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=12 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_13.sil b/validation-test/SIL/parse_stdlib_13.sil index f480618c12c..d1f1fd2de98 100644 --- a/validation-test/SIL/parse_stdlib_13.sil +++ b/validation-test/SIL/parse_stdlib_13.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=13 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_14.sil b/validation-test/SIL/parse_stdlib_14.sil index b545b0f09f3..beb9b5e8bd7 100644 --- a/validation-test/SIL/parse_stdlib_14.sil +++ b/validation-test/SIL/parse_stdlib_14.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=14 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_15.sil b/validation-test/SIL/parse_stdlib_15.sil index c2cf12c8a63..c21d400488f 100644 --- a/validation-test/SIL/parse_stdlib_15.sil +++ b/validation-test/SIL/parse_stdlib_15.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=15 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_16.sil b/validation-test/SIL/parse_stdlib_16.sil index d29f63e173e..18f7f45a3cd 100644 --- a/validation-test/SIL/parse_stdlib_16.sil +++ b/validation-test/SIL/parse_stdlib_16.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=16 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_2.sil b/validation-test/SIL/parse_stdlib_2.sil index 6942f8068a8..d46184ece84 100644 --- a/validation-test/SIL/parse_stdlib_2.sil +++ b/validation-test/SIL/parse_stdlib_2.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=2 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_3.sil b/validation-test/SIL/parse_stdlib_3.sil index e92e10df380..b03036ef205 100644 --- a/validation-test/SIL/parse_stdlib_3.sil +++ b/validation-test/SIL/parse_stdlib_3.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=3 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_4.sil b/validation-test/SIL/parse_stdlib_4.sil index 6165e3d5e60..cfde09698af 100644 --- a/validation-test/SIL/parse_stdlib_4.sil +++ b/validation-test/SIL/parse_stdlib_4.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=4 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_5.sil b/validation-test/SIL/parse_stdlib_5.sil index 8f718aaa48a..6038fb14c45 100644 --- a/validation-test/SIL/parse_stdlib_5.sil +++ b/validation-test/SIL/parse_stdlib_5.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=5 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_6.sil b/validation-test/SIL/parse_stdlib_6.sil index bde1430e5ee..debaf5ccc96 100644 --- a/validation-test/SIL/parse_stdlib_6.sil +++ b/validation-test/SIL/parse_stdlib_6.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=6 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_7.sil b/validation-test/SIL/parse_stdlib_7.sil index e5b43f38745..6ffa0e0bf5e 100644 --- a/validation-test/SIL/parse_stdlib_7.sil +++ b/validation-test/SIL/parse_stdlib_7.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=7 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_8.sil b/validation-test/SIL/parse_stdlib_8.sil index 7f50bcb8c41..f23083d3327 100644 --- a/validation-test/SIL/parse_stdlib_8.sil +++ b/validation-test/SIL/parse_stdlib_8.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=8 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/parse_stdlib_9.sil b/validation-test/SIL/parse_stdlib_9.sil index 726746add0e..f1e90d1a045 100644 --- a/validation-test/SIL/parse_stdlib_9.sil +++ b/validation-test/SIL/parse_stdlib_9.sil @@ -6,3 +6,4 @@ // RUN: rm -f %t.* // RUN: %target-sil-opt -enable-sil-verify-all -sil-disable-ast-dump %platform-module-dir/Swift.swiftmodule -module-name=Swift -o %t.sil // RUN: %target-sil-opt -enable-sil-verify-all %t.sil -ast-verifier-process-count=17 -ast-verifier-process-id=9 > /dev/null +// REQUIRES: long_test diff --git a/validation-test/SIL/verify_all_overlays.sil b/validation-test/SIL/verify_all_overlays.sil index 7ee63b90230..906fbbdf41f 100644 --- a/validation-test/SIL/verify_all_overlays.sil +++ b/validation-test/SIL/verify_all_overlays.sil @@ -1,3 +1,5 @@ // RUN: for x in %platform-sdk-overlay-dir/*.swiftmodule; do [[ $(basename "$x") = Swift.swiftmodule ]] && continue; llvm-bcanalyzer $x | FileCheck %s; %target-sil-opt -enable-sil-verify-all $x > /dev/null; done // CHECK-NOT: Unknown + +// REQUIRES: long_test diff --git a/validation-test/compiler_crashers_2/0038-lowering-CheckedCastEmitter-emitConditional.swift b/validation-test/compiler_crashers_2/0038-lowering-CheckedCastEmitter-emitConditional.swift index a33cb7f7952..9b9359aece2 100644 --- a/validation-test/compiler_crashers_2/0038-lowering-CheckedCastEmitter-emitConditional.swift +++ b/validation-test/compiler_crashers_2/0038-lowering-CheckedCastEmitter-emitConditional.swift @@ -1,4 +1,6 @@ // RUN: not --crash %target-swift-frontend %s -emit-silgen +// REQUIRES: asserts + let a: () -> Int? = { return nil } a as? Int diff --git a/validation-test/compiler_crashers_2_fixed/0022-rdar21625478.swift b/validation-test/compiler_crashers_2_fixed/0022-rdar21625478.swift index d9ecf273eb2..fd1009ce163 100644 --- a/validation-test/compiler_crashers_2_fixed/0022-rdar21625478.swift +++ b/validation-test/compiler_crashers_2_fixed/0022-rdar21625478.swift @@ -205,7 +205,7 @@ public struct LoggingIterator } public mutating func next() -> Base.Element? { - ++Log.next[selfType] + Log.next[selfType] += 1 return base.next() } @@ -236,7 +236,7 @@ public protocol LoggingSequenceType : MySequence, LoggingType { extension LoggingSequenceType { public var underestimatedCount: Int { - ++SequenceLog.underestimatedCount[selfType] + SequenceLog.underestimatedCount[selfType] += 1 return base.underestimatedCount } } @@ -244,28 +244,28 @@ extension LoggingSequenceType { extension LoggingSequenceType where Log == SequenceLog, Iterator == LoggingIterator { public func makeIterator() -> LoggingIterator { - ++Log.iterator[selfType] + Log.iterator[selfType] += 1 return LoggingIterator(base.makeIterator()) } public func map( @noescape _ transform: (Base.Iterator.Element) -> T ) -> [T] { - ++Log.map[selfType] + Log.map[selfType] += 1 return base.map(transform) } public func filter( @noescape _ includeElement: (Base.Iterator.Element) -> Bool ) -> [Base.Iterator.Element] { - ++Log.filter[selfType] + Log.filter[selfType] += 1 return base.filter(includeElement) } public func _customContainsEquatableElement( _ element: Base.Iterator.Element ) -> Bool? { - ++Log._customContainsEquatableElement[selfType] + Log._customContainsEquatableElement[selfType] += 1 return base._customContainsEquatableElement(element) } @@ -275,7 +275,7 @@ extension LoggingSequenceType public func _preprocessingPass( @noescape _ preprocess: (Self) -> R ) -> R? { - ++Log._preprocessingPass[selfType] + Log._preprocessingPass[selfType] += 1 return base._preprocessingPass { _ in preprocess(self) } } @@ -283,7 +283,7 @@ extension LoggingSequenceType /// in the same order. public func _copyToNativeArrayBuffer() -> _ContiguousArrayBuffer { - ++Log._copyToNativeArrayBuffer[selfType] + Log._copyToNativeArrayBuffer[selfType] += 1 return base._copyToNativeArrayBuffer() } @@ -291,7 +291,7 @@ extension LoggingSequenceType public func _copyContents( initializing ptr: UnsafeMutablePointer ) -> UnsafeMutablePointer { - ++Log._copyContents[selfType] + Log._copyContents[selfType] += 1 return base._copyContents(initializing: ptr) } } @@ -333,41 +333,41 @@ public protocol LoggingCollectionType : LoggingSequenceType, MyCollection { extension LoggingCollectionType where Index == Base.Index { public var startIndex: Base.Index { - ++CollectionLog.startIndex[selfType] + CollectionLog.startIndex[selfType] += 1 return base.startIndex } public var endIndex: Base.Index { - ++CollectionLog.endIndex[selfType] + CollectionLog.endIndex[selfType] += 1 return base.endIndex } public subscript(position: Base.Index) -> Base.Iterator.Element { - ++CollectionLog.subscriptIndex[selfType] + CollectionLog.subscriptIndex[selfType] += 1 return base[position] } public subscript(_prext_bounds: MyRange) -> Base.SubSequence { - ++CollectionLog.subscriptRange[selfType] + CollectionLog.subscriptRange[selfType] += 1 return base[_prext_bounds] } public var isEmpty: Bool { - ++CollectionLog.isEmpty[selfType] + CollectionLog.isEmpty[selfType] += 1 return base.isEmpty } public var count: Base.Index.Distance { - ++CollectionLog.count[selfType] + CollectionLog.count[selfType] += 1 return base.count } public func _customIndexOfEquatableElement(_ element: Base.Iterator.Element) -> Base.Index?? { - ++CollectionLog._customIndexOfEquatableElement[selfType] + CollectionLog._customIndexOfEquatableElement[selfType] += 1 return base._customIndexOfEquatableElement(element) } public var first: Base.Iterator.Element? { - ++CollectionLog.first[selfType] + CollectionLog.first[selfType] += 1 return base.first } } diff --git a/validation-test/stdlib/Algorithm.swift b/validation-test/stdlib/Algorithm.swift index 2c5f0280b17..a458b342ac2 100644 --- a/validation-test/stdlib/Algorithm.swift +++ b/validation-test/stdlib/Algorithm.swift @@ -79,13 +79,13 @@ Algorithm.test("sorted/strings") "https://bugs.swift.org/browse/SR-530")) .code { expectEqual( - [ "Banana", "apple", "cherry" ], - [ "apple", "Banana", "cherry" ].sorted()) + ["Banana", "apple", "cherry"], + ["apple", "Banana", "cherry"].sorted()) let s = ["apple", "Banana", "cherry"].sorted() { $0.characters.count > $1.characters.count } - expectEqual([ "Banana", "cherry", "apple" ], s) + expectEqual(["Banana", "cherry", "apple"], s) } // A wrapper around Array that disables any type-specific algorithm diff --git a/validation-test/stdlib/ArrayBridging.swift b/validation-test/stdlib/ArrayBridging.swift index ba4c3ef8a8b..68b06ed8926 100644 --- a/validation-test/stdlib/ArrayBridging.swift +++ b/validation-test/stdlib/ArrayBridging.swift @@ -2,7 +2,7 @@ // RUN: mkdir -p %t // // RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o -// RUN: echo '#line 1 "%s"' > "%t/main.swift" && cat "%s" >> "%t/main.swift" && chmod -w "%t/main.swift" +// RUN: echo '#sourceLocation(file: "%s", line: 1)' > "%t/main.swift" && cat "%s" >> "%t/main.swift" && chmod -w "%t/main.swift" // RUN: %target-build-swift -Xfrontend -disable-access-control -I %S/Inputs/SlurpFastEnumeration/ %t/main.swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift -Xlinker %t/SlurpFastEnumeration.o -o %t.out -O // RUN: %target-run %t.out // REQUIRES: executable_test diff --git a/validation-test/stdlib/ArrayNew.swift.gyb b/validation-test/stdlib/ArrayNew.swift.gyb index 212f65f74e8..c830cca8531 100644 --- a/validation-test/stdlib/ArrayNew.swift.gyb +++ b/validation-test/stdlib/ArrayNew.swift.gyb @@ -58,11 +58,11 @@ func withInoutT(_ x: inout T, body: (x: inout T) -> Void) { % for array_type in all_array_types: ArrayTestSuite.test("${array_type}<${element_type}>/subscript(_: Int)/COW") { - var a: ${array_type}<${array_type}<${element_type}>> = [ [ + var a: ${array_type}<${array_type}<${element_type}>> = [[ ${element_type}(10), ${element_type}(20), ${element_type}(30), ${element_type}(40), ${element_type}(50), ${element_type}(60), ${element_type}(70) - ] ] + ]] let identityOuter = a.identity var identityInner = a[0].identity @@ -128,11 +128,11 @@ ArrayTestSuite.test("${array_type}<${element_type}>/subscript(_: Int)/COW") { } ArrayTestSuite.test("${array_type}<${element_type}>/subscript(_: Range)/COW") { - var a: ${array_type}<${array_type}<${element_type}>> = [ [ + var a: ${array_type}<${array_type}<${element_type}>> = [[ ${element_type}(10), ${element_type}(20), ${element_type}(30), ${element_type}(40), ${element_type}(50), ${element_type}(60), ${element_type}(70), ${element_type}(80), ${element_type}(90), - ] ] + ]] let identityOuter = a.identity var identityInner = a[0].identity diff --git a/validation-test/stdlib/Arrays.swift.gyb b/validation-test/stdlib/Arrays.swift.gyb index 04f6c72ac54..29c372d8ce6 100644 --- a/validation-test/stdlib/Arrays.swift.gyb +++ b/validation-test/stdlib/Arrays.swift.gyb @@ -207,7 +207,7 @@ ArrayTestSuite.test("${array_type}/Sliceable/Enums") { typealias E = EnumWithoutPayloads do { - let expected = [ E.A, E.B, E.C, E.D ] + let expected = [E.A, E.B, E.C, E.D] let sliceable = ${array_type}(expected) checkSliceableWithBidirectionalIndex(expected, sliceable) } @@ -215,7 +215,7 @@ ArrayTestSuite.test("${array_type}/Sliceable/Enums") { /* FIXME: add this test when Array can be conditionally Equatable. do { - let expected = [ [ E.A, E.B ], [ E.B, E.C ], [ E.D ], [ E.A, E.B, E.D ] ] + let expected = [[E.A, E.B], [E.B, E.C], [E.D], [E.A, E.B, E.D]] let sliceable = ${array_type}(expected) checkSliceableWithBidirectionalIndex( expected, sliceable, SourceLocStack().withCurrentLoc()) diff --git a/validation-test/stdlib/Dictionary.swift b/validation-test/stdlib/Dictionary.swift index 6a0d6d13967..a572ee5b6ec 100644 --- a/validation-test/stdlib/Dictionary.swift +++ b/validation-test/stdlib/Dictionary.swift @@ -55,7 +55,7 @@ DictionaryTestSuite.test("AssociatedTypes") { } DictionaryTestSuite.test("sizeof") { - var dict = [ 1: "meow", 2: "meow" ] + var dict = [1: "meow", 2: "meow"] #if arch(i386) || arch(arm) expectEqual(4, sizeofValue(dict)) #else @@ -1172,7 +1172,7 @@ func getAsNSMutableDictionary(_ d: Dictionary) -> NSMutableDictionary } func getBridgedVerbatimDictionary() -> Dictionary { - let nsd = getAsNSDictionary([ 10: 1010, 20: 1020, 30: 1030 ]) + let nsd = getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]) return convertNSDictionaryToDictionary(nsd) } @@ -1183,12 +1183,12 @@ func getBridgedVerbatimDictionary(_ d: Dictionary) -> Dictionary (Dictionary, NSMutableDictionary) { - let nsd = getAsNSMutableDictionary([ 10: 1010, 20: 1020, 30: 1030 ]) + let nsd = getAsNSMutableDictionary([10: 1010, 20: 1020, 30: 1030]) return (convertNSDictionaryToDictionary(nsd), nsd) } func getBridgedNonverbatimDictionary() -> Dictionary { - let nsd = getAsNSDictionary([ 10: 1010, 20: 1020, 30: 1030 ]) + let nsd = getAsNSDictionary([10: 1010, 20: 1020, 30: 1030 ]) return Swift._forceBridgeFromObjectiveC(nsd, Dictionary.self) } @@ -1199,7 +1199,7 @@ func getBridgedNonverbatimDictionary(_ d: Dictionary) -> Dictionary (Dictionary, NSMutableDictionary) { - let nsd = getAsNSMutableDictionary([ 10: 1010, 20: 1020, 30: 1030 ]) + let nsd = getAsNSMutableDictionary([10: 1010, 20: 1020, 30: 1030]) return (Swift._forceBridgeFromObjectiveC(nsd, Dictionary.self), nsd) } @@ -1329,12 +1329,12 @@ class CustomImmutableNSDictionary : NSDictionary { override func object(forKey aKey: AnyObject) -> AnyObject? { CustomImmutableNSDictionary.timesObjectForKeyWasCalled += 1 - return getAsNSDictionary([ 10: 1010, 20: 1020, 30: 1030 ]).object(forKey: aKey) + return getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]).object(forKey: aKey) } override func keyEnumerator() -> NSEnumerator { CustomImmutableNSDictionary.timesKeyEnumeratorWasCalled += 1 - return getAsNSDictionary([ 10: 1010, 20: 1020, 30: 1030 ]).keyEnumerator() + return getAsNSDictionary([10: 1010, 20: 1020, 30: 1030]).keyEnumerator() } override var count: Int { @@ -1401,7 +1401,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.DictionaryIsCopied") { DictionaryTestSuite.test("BridgedFromObjC.Verbatim.NSDictionaryIsRetained") { var nsd: NSDictionary = NSDictionary(dictionary: - getAsNSDictionary([ 10: 1010, 20: 1020, 30: 1030 ])) + getAsNSDictionary([10: 1010, 20: 1020, 30: 1030])) var d: [NSObject : AnyObject] = convertNSDictionaryToDictionary(nsd) @@ -1418,7 +1418,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.NSDictionaryIsRetained") { DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.NSDictionaryIsCopied") { var nsd: NSDictionary = NSDictionary(dictionary: - getAsNSDictionary([ 10: 1010, 20: 1020, 30: 1030 ])) + getAsNSDictionary([10: 1010, 20: 1020, 30: 1030])) var d: [TestBridgedKeyTy : TestBridgedValueTy] = convertNSDictionaryToDictionary(nsd) @@ -2448,40 +2448,40 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.EqualityTest_Small") { helper([:], [:], true) - helper([ 10: 1010 ], - [ 10: 1010 ], + helper([10: 1010], + [10: 1010], true) - helper([ 10: 1010, 20: 1020 ], - [ 10: 1010, 20: 1020 ], + helper([10: 1010, 20: 1020], + [10: 1010, 20: 1020], true) - helper([ 10: 1010, 20: 1020, 30: 1030 ], - [ 10: 1010, 20: 1020, 30: 1030 ], + helper([10: 1010, 20: 1020, 30: 1030], + [10: 1010, 20: 1020, 30: 1030], true) - helper([ 10: 1010, 20: 1020, 30: 1030 ], - [ 10: 1010, 20: 1020, 1111: 1030 ], + helper([10: 1010, 20: 1020, 30: 1030], + [10: 1010, 20: 1020, 1111: 1030], false) - helper([ 10: 1010, 20: 1020, 30: 1030 ], - [ 10: 1010, 20: 1020, 30: 1111 ], + helper([10: 1010, 20: 1020, 30: 1030], + [10: 1010, 20: 1020, 30: 1111], false) - helper([ 10: 1010, 20: 1020, 30: 1030 ], - [ 10: 1010, 20: 1020 ], + helper([10: 1010, 20: 1020, 30: 1030], + [10: 1010, 20: 1020], false) - helper([ 10: 1010, 20: 1020, 30: 1030 ], - [ 10: 1010 ], + helper([10: 1010, 20: 1020, 30: 1030], + [10: 1010], false) - helper([ 10: 1010, 20: 1020, 30: 1030 ], + helper([10: 1010, 20: 1020, 30: 1030], [:], false) - helper([ 10: 1010, 20: 1020, 30: 1030 ], - [ 10: 1010, 20: 1020, 30: 1030, 40: 1040 ], + helper([10: 1010, 20: 1020, 30: 1030], + [10: 1010, 20: 1020, 30: 1030, 40: 1040], false) } @@ -2490,7 +2490,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Verbatim.ArrayOfDictionaries") { var nsa = NSMutableArray() for i in 0..<3 { nsa.add( - getAsNSDictionary([ 10: 1010 + i, 20: 1020 + i, 30: 1030 + i ])) + getAsNSDictionary([10: 1010 + i, 20: 1020 + i, 30: 1030 + i])) } var a = nsa as [AnyObject] as! [Dictionary] @@ -2511,7 +2511,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.ArrayOfDictionaries") { var nsa = NSMutableArray() for i in 0..<3 { nsa.add( - getAsNSDictionary([ 10: 1010 + i, 20: 1020 + i, 30: 1030 + i ])) + getAsNSDictionary([10: 1010 + i, 20: 1020 + i, 30: 1030 + i])) } var a = nsa as [AnyObject] as! [Dictionary] @@ -3756,7 +3756,7 @@ DictionaryTestSuite.test( DictionaryTestSuite.test("misc") { do { // Dictionary literal - var dict = [ "Hello": 1, "World": 2 ] + var dict = ["Hello": 1, "World": 2] // Insertion dict["Swift"] = 3 diff --git a/validation-test/stdlib/DictionaryBridging.swift b/validation-test/stdlib/DictionaryBridging.swift index 98239f29bea..f01e2a8be8b 100644 --- a/validation-test/stdlib/DictionaryBridging.swift +++ b/validation-test/stdlib/DictionaryBridging.swift @@ -2,7 +2,7 @@ // RUN: mkdir -p %t // // RUN: %target-clang -fobjc-arc %S/Inputs/SlurpFastEnumeration/SlurpFastEnumeration.m -c -o %t/SlurpFastEnumeration.o -// RUN: echo '#line 1 "%s"' > "%t/main.swift" && cat "%s" >> "%t/main.swift" && chmod -w "%t/main.swift" +// RUN: echo '#sourceLocation(file: "%s", line: 1)' > "%t/main.swift" && cat "%s" >> "%t/main.swift" && chmod -w "%t/main.swift" // RUN: %target-build-swift -Xfrontend -disable-access-control -I %S/Inputs/SlurpFastEnumeration/ %t/main.swift %S/Inputs/DictionaryKeyValueTypes.swift %S/Inputs/DictionaryKeyValueTypesObjC.swift -Xlinker %t/SlurpFastEnumeration.o -o %t.out -O // RUN: %target-run %t.out // REQUIRES: executable_test diff --git a/validation-test/stdlib/SequenceType.swift.gyb b/validation-test/stdlib/SequenceType.swift.gyb index e1deb7a2619..dc737b7dce6 100644 --- a/validation-test/stdlib/SequenceType.swift.gyb +++ b/validation-test/stdlib/SequenceType.swift.gyb @@ -662,7 +662,7 @@ SequenceTypeTests.test("reduce") { (partialResult: OpaqueValue<[Int]>, element: OpaqueValue) -> OpaqueValue<[Int]> in timesClosureWasCalled += 1 - return OpaqueValue<[Int]>(partialResult.value + [ element.value ]) + return OpaqueValue<[Int]>(partialResult.value + [element.value]) } expectEqual(test.sequence, result.value) expectEqual([], s.map { $0.value }, "sequence should be consumed") diff --git a/validation-test/stdlib/Set.swift b/validation-test/stdlib/Set.swift index 1f7146654b0..1a1cdfd2ab2 100644 --- a/validation-test/stdlib/Set.swift +++ b/validation-test/stdlib/Set.swift @@ -2103,7 +2103,7 @@ SetTestSuite.test("BridgedFromObjC.Verbatim.ArrayOfSets") { var nsa = NSMutableArray() for i in 0..<3 { nsa.add( - getAsNSSet([ 1 + i, 2 + i, 3 + i ])) + getAsNSSet([1 + i, 2 + i, 3 + i])) } var a = nsa as [AnyObject] as! [Set] @@ -2115,7 +2115,7 @@ SetTestSuite.test("BridgedFromObjC.Verbatim.ArrayOfSets") { let v = (value as! TestObjCKeyTy).value items.append(v) } - var expectedItems = [ 1 + i, 2 + i, 3 + i ] + var expectedItems = [1 + i, 2 + i, 3 + i] expectTrue(equalsUnordered(items, expectedItems)) } } @@ -2124,7 +2124,7 @@ SetTestSuite.test("BridgedFromObjC.Nonverbatim.ArrayOfSets") { var nsa = NSMutableArray() for i in 0..<3 { nsa.add( - getAsNSSet([ 1 + i, 2 + i, 3 + i ])) + getAsNSSet([1 + i, 2 + i, 3 + i])) } var a = nsa as [AnyObject] as! [Set] @@ -2135,7 +2135,7 @@ SetTestSuite.test("BridgedFromObjC.Nonverbatim.ArrayOfSets") { while let value = iter.next() { items.append(value.value) } - var expectedItems = [ 1 + i, 2 + i, 3 + i ] + var expectedItems = [1 + i, 2 + i, 3 + i] expectTrue(equalsUnordered(items, expectedItems)) } } @@ -2173,7 +2173,7 @@ SetTestSuite.test("BridgingRoundtrip") { let v = (value as! TestObjCKeyTy).value items.append(v) } - expectTrue(equalsUnordered([ 1010, 2020, 3030 ], items)) + expectTrue(equalsUnordered([1010, 2020, 3030], items)) } SetTestSuite.test("BridgedToObjC.Verbatim.ObjectEnumerator.FastEnumeration.UseFromSwift") { @@ -2336,7 +2336,7 @@ SetTestSuite.test("BridgedToObjC.MemberTypesCustomBridged") { while let nextObject = enumerator.nextObject() { members.append((nextObject as! TestObjCKeyTy).value) } - expectTrue(equalsUnordered([ 1010, 2020, 3030 ], members)) + expectTrue(equalsUnordered([1010, 2020, 3030], members)) expectAutoreleasedKeysAndValues(unopt: (3, 0)) } @@ -3448,7 +3448,7 @@ class MockSetWithCustomCount : NSSet { override func objectEnumerator() -> NSEnumerator { expectUnreachable() - return getAsNSSet([ 1010, 1020, 1030 ]).objectEnumerator() + return getAsNSSet([1010, 1020, 1030]).objectEnumerator() } override var count: Int { @@ -3697,37 +3697,37 @@ SetTestSuite.test("Operator.Precedence") { //===--- SetTestSuite.test("mutationDoesNotAffectIterator/remove,1") { - var set = Set([ 1010, 1020, 1030 ]) + var set = Set([1010, 1020, 1030]) var iter = set.makeIterator() expectOptionalEqual(1010, set.remove(1010)) - expectEqualsUnordered([ 1010, 1020, 1030 ], Array(IteratorSequence(iter))) + expectEqualsUnordered([1010, 1020, 1030], Array(IteratorSequence(iter))) } SetTestSuite.test("mutationDoesNotAffectIterator/remove,all") { - var set = Set([ 1010, 1020, 1030 ]) + var set = Set([1010, 1020, 1030]) var iter = set.makeIterator() expectOptionalEqual(1010, set.remove(1010)) expectOptionalEqual(1020, set.remove(1020)) expectOptionalEqual(1030, set.remove(1030)) - expectEqualsUnordered([ 1010, 1020, 1030 ], Array(IteratorSequence(iter))) + expectEqualsUnordered([1010, 1020, 1030], Array(IteratorSequence(iter))) } SetTestSuite.test("mutationDoesNotAffectIterator/removeAll,keepingCapacity=false") { - var set = Set([ 1010, 1020, 1030 ]) + var set = Set([1010, 1020, 1030]) var iter = set.makeIterator() set.removeAll(keepingCapacity: false) - expectEqualsUnordered([ 1010, 1020, 1030 ], Array(IteratorSequence(iter))) + expectEqualsUnordered([1010, 1020, 1030], Array(IteratorSequence(iter))) } SetTestSuite.test("mutationDoesNotAffectIterator/removeAll,keepingCapacity=true") { - var set = Set([ 1010, 1020, 1030 ]) + var set = Set([1010, 1020, 1030]) var iter = set.makeIterator() set.removeAll(keepingCapacity: true) - expectEqualsUnordered([ 1010, 1020, 1030 ], Array(IteratorSequence(iter))) + expectEqualsUnordered([1010, 1020, 1030], Array(IteratorSequence(iter))) } runAllTests() diff --git a/validation-test/stdlib/String.swift b/validation-test/stdlib/String.swift index 05ed2d0fee2..bd9bd0463ad 100644 --- a/validation-test/stdlib/String.swift +++ b/validation-test/stdlib/String.swift @@ -342,8 +342,8 @@ StringTests.test("literalConcatenation") { StringTests.test("appendToSubstring") { for initialSize in 1..<16 { - for sliceStart in [ 0, 2, 8, initialSize ] { - for sliceEnd in [ 0, 2, 8, sliceStart + 1 ] { + for sliceStart in [0, 2, 8, initialSize] { + for sliceEnd in [0, 2, 8, sliceStart + 1] { if sliceStart > initialSize || sliceEnd > initialSize || sliceEnd < sliceStart { continue @@ -907,7 +907,7 @@ StringTests.test("growth") { } StringTests.test("Construction") { - expectEqual("abc", String([ "a", "b", "c" ] as [Character])) + expectEqual("abc", String(["a", "b", "c"] as [Character])) } StringTests.test("Conversions") { @@ -1116,26 +1116,26 @@ StringTests.test("String.append(_: UnicodeScalar)") { // U+0061 LATIN SMALL LETTER A let input: UnicodeScalar = "\u{61}" s.append(input) - expectEqual([ "\u{61}" ], Array(s.unicodeScalars)) + expectEqual(["\u{61}"], Array(s.unicodeScalars)) } do { // U+304B HIRAGANA LETTER KA let input: UnicodeScalar = "\u{304b}" s.append(input) - expectEqual([ "\u{61}", "\u{304b}" ], Array(s.unicodeScalars)) + expectEqual(["\u{61}", "\u{304b}"], Array(s.unicodeScalars)) } do { // U+3099 COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK let input: UnicodeScalar = "\u{3099}" s.append(input) - expectEqual([ "\u{61}", "\u{304b}", "\u{3099}" ], Array(s.unicodeScalars)) + expectEqual(["\u{61}", "\u{304b}", "\u{3099}"], Array(s.unicodeScalars)) } do { // U+1F425 FRONT-FACING BABY CHICK let input: UnicodeScalar = "\u{1f425}" s.append(input) expectEqual( - [ "\u{61}", "\u{304b}", "\u{3099}", "\u{1f425}" ], + ["\u{61}", "\u{304b}", "\u{3099}", "\u{1f425}"], Array(s.unicodeScalars)) } } @@ -1174,7 +1174,7 @@ StringTests.test("String.append(_: Character)") { // U+0303 COMBINING TILDE "\u{61}\u{0300}\u{0301}\u{0302}\u{0303}", ] - let baseStrings = [ "" ] + baseCharacters.map { String($0) } + let baseStrings = [""] + baseCharacters.map { String($0) } for baseIdx in baseStrings.indices { for prefix in ["", " "] { @@ -1184,7 +1184,7 @@ StringTests.test("String.append(_: Character)") { var s = base s.append(input) expectEqualSequence( - Array(base.characters) + [ input ], + Array(base.characters) + [input], Array(s.characters), "baseIdx=\(baseIdx) inputIdx=\(inputIdx)") } diff --git a/validation-test/stdlib/UnicodeTrie.swift.gyb b/validation-test/stdlib/UnicodeTrie.swift.gyb index 75585fd19d0..4de9b8a1631 100644 --- a/validation-test/stdlib/UnicodeTrie.swift.gyb +++ b/validation-test/stdlib/UnicodeTrie.swift.gyb @@ -134,7 +134,7 @@ func checkGraphemeClusterSegmentation( for c in subject.characters { let currentClusterSize = String(c).unicodeScalars.count unicodeScalarCount += currentClusterSize - actualBoundaries += [ unicodeScalarCount ] + actualBoundaries += [unicodeScalarCount] } expectEqual( expectedBoundaries, actualBoundaries, @@ -168,9 +168,9 @@ UnicodeTrie.test("GraphemeClusterSegmentation/UnicodeSpec") { % for code_points, expected_boundaries in grapheme_cluster_break_tests: do { let scalars: [UInt32] = - [ ${", ".join([ str(cp) for cp in code_points ])} ] + [ ${", ".join([str(cp) for cp in code_points])} ] let expectedBoundaries: [Int] = - [ ${", ".join([ str(x) for x in expected_boundaries ])} ] + [ ${", ".join([str(x) for x in expected_boundaries])} ] checkGraphemeClusterSegmentation(expectedBoundaries, scalars: scalars, SourceLocStack().withCurrentLoc()) }