├── .gitignore ├── README.md ├── Swift Compiler Bug.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata └── Swift Compiler Tests ├── AppDelegate.swift ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist └── ViewController.swift /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | 28 | ## Playgrounds 29 | timeline.xctimeline 30 | playground.xcworkspace 31 | 32 | # Swift Package Manager 33 | # 34 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 35 | # Packages/ 36 | .build/ 37 | 38 | # CocoaPods 39 | # 40 | # We recommend against adding the Pods directory to your .gitignore. However 41 | # you should judge for yourself, the pros and cons are mentioned at: 42 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 43 | # 44 | # Pods/ 45 | 46 | # Carthage 47 | # 48 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 49 | # Carthage/Checkouts 50 | 51 | Carthage/Build 52 | 53 | # fastlane 54 | # 55 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 56 | # screenshots whenever they are needed. 57 | # For more information about the recommended setup visit: 58 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 59 | 60 | fastlane/report.xml 61 | fastlane/Preview.html 62 | fastlane/screenshots 63 | fastlane/test_output 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Swift Type Inference Bug 2 | 3 | This project contains code the reproduces the Swift compiler bug described [here](https://bugs.swift.org/browse/SR-305). The bug involves the compiler not being able to efficiently perform type inference on semi-simple dictionary/array literals. 4 | 5 | I have also written about this issue [here](https://spin.atomicobject.com/2016/04/26/swift-long-compile-time/), and it has been discussed on [Reddit](https://www.reddit.com/r/programming/comments/4givdg/go_home_swift_compiler_youre_drunk/) and [Hacker News](https://news.ycombinator.com/item?id=11573213) 6 | 7 | The only code of interest in this project is in the `AppDelegate`, which contains the following 8 | 9 | // remove employee's in the below literal to speed up compilation time 10 | let myCompany = [ 11 | "employees": [ 12 | "employee 1": ["attribute": "value"], 13 | "employee 2": ["attribute": "value"], 14 | "employee 3": ["attribute": "value"], 15 | "employee 4": ["attribute": "value"], 16 | "employee 5": ["attribute": "value"], 17 | "employee 6": ["attribute": "value"], 18 | "employee 7": ["attribute": "value"], 19 | "employee 8": ["attribute": "value"], 20 | "employee 9": ["attribute": "value"], 21 | "employee 10": ["attribute": "value"], 22 | "employee 11": ["attribute": "value"], 23 | "employee 12": ["attribute": "value"], 24 | "employee 13": ["attribute": "value"], 25 | "employee 14": ["attribute": "value"], 26 | "employee 15": ["attribute": "value"], 27 | "employee 16": ["attribute": "value"], 28 | "employee 17": ["attribute": "value"], 29 | "employee 18": ["attribute": "value"], 30 | "employee 19": ["attribute": "value"], 31 | "employee 20": ["attribute": "value"] 32 | ] 33 | ] 34 | 35 | This code takes a very long time to compile. My estimate is between 12 and 55 hours. The compilation time grows exponentially as each `employee` is added to the dictionary. Removing `employee` entries allows the code to build faster. 36 | -------------------------------------------------------------------------------- /Swift Compiler Bug.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C91A95131CC982B100C55F68 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91A95121CC982B100C55F68 /* AppDelegate.swift */; }; 11 | C91A95151CC982B100C55F68 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C91A95141CC982B100C55F68 /* ViewController.swift */; }; 12 | C91A95181CC982B100C55F68 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C91A95161CC982B100C55F68 /* Main.storyboard */; }; 13 | C91A951A1CC982B100C55F68 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C91A95191CC982B100C55F68 /* Assets.xcassets */; }; 14 | C91A951D1CC982B100C55F68 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C91A951B1CC982B100C55F68 /* LaunchScreen.storyboard */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | C91A95241CC982B100C55F68 /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = C91A95071CC982B100C55F68 /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = C91A950E1CC982B100C55F68; 23 | remoteInfo = "Swift Compiler Tests"; 24 | }; 25 | C91A952F1CC982B100C55F68 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = C91A95071CC982B100C55F68 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = C91A950E1CC982B100C55F68; 30 | remoteInfo = "Swift Compiler Tests"; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | C91A950F1CC982B100C55F68 /* Swift Compiler Bug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Swift Compiler Bug.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | C91A95121CC982B100C55F68 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | C91A95141CC982B100C55F68 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 38 | C91A95171CC982B100C55F68 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | C91A95191CC982B100C55F68 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 40 | C91A951C1CC982B100C55F68 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 41 | C91A951E1CC982B100C55F68 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | C91A95231CC982B100C55F68 /* Swift Compiler Bug.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Swift Compiler Bug.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | C91A952E1CC982B100C55F68 /* Swift Compiler Bug.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Swift Compiler Bug.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | /* End PBXFileReference section */ 45 | 46 | /* Begin PBXFrameworksBuildPhase section */ 47 | C91A950C1CC982B100C55F68 /* Frameworks */ = { 48 | isa = PBXFrameworksBuildPhase; 49 | buildActionMask = 2147483647; 50 | files = ( 51 | ); 52 | runOnlyForDeploymentPostprocessing = 0; 53 | }; 54 | C91A95201CC982B100C55F68 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | C91A952B1CC982B100C55F68 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | C91A95061CC982B100C55F68 = { 72 | isa = PBXGroup; 73 | children = ( 74 | C91A95111CC982B100C55F68 /* Swift Compiler Bug */, 75 | C91A95101CC982B100C55F68 /* Products */, 76 | ); 77 | sourceTree = ""; 78 | }; 79 | C91A95101CC982B100C55F68 /* Products */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | C91A950F1CC982B100C55F68 /* Swift Compiler Bug.app */, 83 | C91A95231CC982B100C55F68 /* Swift Compiler Bug.xctest */, 84 | C91A952E1CC982B100C55F68 /* Swift Compiler Bug.xctest */, 85 | ); 86 | name = Products; 87 | sourceTree = ""; 88 | }; 89 | C91A95111CC982B100C55F68 /* Swift Compiler Bug */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | C91A95121CC982B100C55F68 /* AppDelegate.swift */, 93 | C91A95141CC982B100C55F68 /* ViewController.swift */, 94 | C91A95161CC982B100C55F68 /* Main.storyboard */, 95 | C91A95191CC982B100C55F68 /* Assets.xcassets */, 96 | C91A951B1CC982B100C55F68 /* LaunchScreen.storyboard */, 97 | C91A951E1CC982B100C55F68 /* Info.plist */, 98 | ); 99 | name = "Swift Compiler Bug"; 100 | path = "Swift Compiler Tests"; 101 | sourceTree = ""; 102 | }; 103 | /* End PBXGroup section */ 104 | 105 | /* Begin PBXNativeTarget section */ 106 | C91A950E1CC982B100C55F68 /* Swift Compiler Bug */ = { 107 | isa = PBXNativeTarget; 108 | buildConfigurationList = C91A95371CC982B100C55F68 /* Build configuration list for PBXNativeTarget "Swift Compiler Bug" */; 109 | buildPhases = ( 110 | C91A950B1CC982B100C55F68 /* Sources */, 111 | C91A950C1CC982B100C55F68 /* Frameworks */, 112 | C91A950D1CC982B100C55F68 /* Resources */, 113 | ); 114 | buildRules = ( 115 | ); 116 | dependencies = ( 117 | ); 118 | name = "Swift Compiler Bug"; 119 | productName = "Swift Compiler Tests"; 120 | productReference = C91A950F1CC982B100C55F68 /* Swift Compiler Bug.app */; 121 | productType = "com.apple.product-type.application"; 122 | }; 123 | C91A95221CC982B100C55F68 /* Swift Compiler BugTests */ = { 124 | isa = PBXNativeTarget; 125 | buildConfigurationList = C91A953A1CC982B100C55F68 /* Build configuration list for PBXNativeTarget "Swift Compiler BugTests" */; 126 | buildPhases = ( 127 | C91A951F1CC982B100C55F68 /* Sources */, 128 | C91A95201CC982B100C55F68 /* Frameworks */, 129 | C91A95211CC982B100C55F68 /* Resources */, 130 | ); 131 | buildRules = ( 132 | ); 133 | dependencies = ( 134 | C91A95251CC982B100C55F68 /* PBXTargetDependency */, 135 | ); 136 | name = "Swift Compiler BugTests"; 137 | productName = "Swift Compiler TestsTests"; 138 | productReference = C91A95231CC982B100C55F68 /* Swift Compiler Bug.xctest */; 139 | productType = "com.apple.product-type.bundle.unit-test"; 140 | }; 141 | C91A952D1CC982B100C55F68 /* Swift Compiler BugUITests */ = { 142 | isa = PBXNativeTarget; 143 | buildConfigurationList = C91A953D1CC982B100C55F68 /* Build configuration list for PBXNativeTarget "Swift Compiler BugUITests" */; 144 | buildPhases = ( 145 | C91A952A1CC982B100C55F68 /* Sources */, 146 | C91A952B1CC982B100C55F68 /* Frameworks */, 147 | C91A952C1CC982B100C55F68 /* Resources */, 148 | ); 149 | buildRules = ( 150 | ); 151 | dependencies = ( 152 | C91A95301CC982B100C55F68 /* PBXTargetDependency */, 153 | ); 154 | name = "Swift Compiler BugUITests"; 155 | productName = "Swift Compiler TestsUITests"; 156 | productReference = C91A952E1CC982B100C55F68 /* Swift Compiler Bug.xctest */; 157 | productType = "com.apple.product-type.bundle.ui-testing"; 158 | }; 159 | /* End PBXNativeTarget section */ 160 | 161 | /* Begin PBXProject section */ 162 | C91A95071CC982B100C55F68 /* Project object */ = { 163 | isa = PBXProject; 164 | attributes = { 165 | LastSwiftUpdateCheck = 0730; 166 | LastUpgradeCheck = 0730; 167 | ORGANIZATIONNAME = None; 168 | TargetAttributes = { 169 | C91A950E1CC982B100C55F68 = { 170 | CreatedOnToolsVersion = 7.3; 171 | }; 172 | C91A95221CC982B100C55F68 = { 173 | CreatedOnToolsVersion = 7.3; 174 | TestTargetID = C91A950E1CC982B100C55F68; 175 | }; 176 | C91A952D1CC982B100C55F68 = { 177 | CreatedOnToolsVersion = 7.3; 178 | TestTargetID = C91A950E1CC982B100C55F68; 179 | }; 180 | }; 181 | }; 182 | buildConfigurationList = C91A950A1CC982B100C55F68 /* Build configuration list for PBXProject "Swift Compiler Bug" */; 183 | compatibilityVersion = "Xcode 3.2"; 184 | developmentRegion = English; 185 | hasScannedForEncodings = 0; 186 | knownRegions = ( 187 | en, 188 | Base, 189 | ); 190 | mainGroup = C91A95061CC982B100C55F68; 191 | productRefGroup = C91A95101CC982B100C55F68 /* Products */; 192 | projectDirPath = ""; 193 | projectRoot = ""; 194 | targets = ( 195 | C91A950E1CC982B100C55F68 /* Swift Compiler Bug */, 196 | C91A95221CC982B100C55F68 /* Swift Compiler BugTests */, 197 | C91A952D1CC982B100C55F68 /* Swift Compiler BugUITests */, 198 | ); 199 | }; 200 | /* End PBXProject section */ 201 | 202 | /* Begin PBXResourcesBuildPhase section */ 203 | C91A950D1CC982B100C55F68 /* Resources */ = { 204 | isa = PBXResourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | C91A951D1CC982B100C55F68 /* LaunchScreen.storyboard in Resources */, 208 | C91A951A1CC982B100C55F68 /* Assets.xcassets in Resources */, 209 | C91A95181CC982B100C55F68 /* Main.storyboard in Resources */, 210 | ); 211 | runOnlyForDeploymentPostprocessing = 0; 212 | }; 213 | C91A95211CC982B100C55F68 /* Resources */ = { 214 | isa = PBXResourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | C91A952C1CC982B100C55F68 /* Resources */ = { 221 | isa = PBXResourcesBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | /* End PBXResourcesBuildPhase section */ 228 | 229 | /* Begin PBXSourcesBuildPhase section */ 230 | C91A950B1CC982B100C55F68 /* Sources */ = { 231 | isa = PBXSourcesBuildPhase; 232 | buildActionMask = 2147483647; 233 | files = ( 234 | C91A95151CC982B100C55F68 /* ViewController.swift in Sources */, 235 | C91A95131CC982B100C55F68 /* AppDelegate.swift in Sources */, 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | C91A951F1CC982B100C55F68 /* Sources */ = { 240 | isa = PBXSourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | ); 244 | runOnlyForDeploymentPostprocessing = 0; 245 | }; 246 | C91A952A1CC982B100C55F68 /* Sources */ = { 247 | isa = PBXSourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | ); 251 | runOnlyForDeploymentPostprocessing = 0; 252 | }; 253 | /* End PBXSourcesBuildPhase section */ 254 | 255 | /* Begin PBXTargetDependency section */ 256 | C91A95251CC982B100C55F68 /* PBXTargetDependency */ = { 257 | isa = PBXTargetDependency; 258 | target = C91A950E1CC982B100C55F68 /* Swift Compiler Bug */; 259 | targetProxy = C91A95241CC982B100C55F68 /* PBXContainerItemProxy */; 260 | }; 261 | C91A95301CC982B100C55F68 /* PBXTargetDependency */ = { 262 | isa = PBXTargetDependency; 263 | target = C91A950E1CC982B100C55F68 /* Swift Compiler Bug */; 264 | targetProxy = C91A952F1CC982B100C55F68 /* PBXContainerItemProxy */; 265 | }; 266 | /* End PBXTargetDependency section */ 267 | 268 | /* Begin PBXVariantGroup section */ 269 | C91A95161CC982B100C55F68 /* Main.storyboard */ = { 270 | isa = PBXVariantGroup; 271 | children = ( 272 | C91A95171CC982B100C55F68 /* Base */, 273 | ); 274 | name = Main.storyboard; 275 | sourceTree = ""; 276 | }; 277 | C91A951B1CC982B100C55F68 /* LaunchScreen.storyboard */ = { 278 | isa = PBXVariantGroup; 279 | children = ( 280 | C91A951C1CC982B100C55F68 /* Base */, 281 | ); 282 | name = LaunchScreen.storyboard; 283 | sourceTree = ""; 284 | }; 285 | /* End PBXVariantGroup section */ 286 | 287 | /* Begin XCBuildConfiguration section */ 288 | C91A95351CC982B100C55F68 /* Debug */ = { 289 | isa = XCBuildConfiguration; 290 | buildSettings = { 291 | ALWAYS_SEARCH_USER_PATHS = NO; 292 | CLANG_ANALYZER_NONNULL = YES; 293 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 294 | CLANG_CXX_LIBRARY = "libc++"; 295 | CLANG_ENABLE_MODULES = YES; 296 | CLANG_ENABLE_OBJC_ARC = YES; 297 | CLANG_WARN_BOOL_CONVERSION = YES; 298 | CLANG_WARN_CONSTANT_CONVERSION = YES; 299 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 300 | CLANG_WARN_EMPTY_BODY = YES; 301 | CLANG_WARN_ENUM_CONVERSION = YES; 302 | CLANG_WARN_INT_CONVERSION = YES; 303 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 304 | CLANG_WARN_UNREACHABLE_CODE = YES; 305 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 306 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 307 | COPY_PHASE_STRIP = NO; 308 | DEBUG_INFORMATION_FORMAT = dwarf; 309 | ENABLE_STRICT_OBJC_MSGSEND = YES; 310 | ENABLE_TESTABILITY = YES; 311 | GCC_C_LANGUAGE_STANDARD = gnu99; 312 | GCC_DYNAMIC_NO_PIC = NO; 313 | GCC_NO_COMMON_BLOCKS = YES; 314 | GCC_OPTIMIZATION_LEVEL = 0; 315 | GCC_PREPROCESSOR_DEFINITIONS = ( 316 | "DEBUG=1", 317 | "$(inherited)", 318 | ); 319 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 320 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 321 | GCC_WARN_UNDECLARED_SELECTOR = YES; 322 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 323 | GCC_WARN_UNUSED_FUNCTION = YES; 324 | GCC_WARN_UNUSED_VARIABLE = YES; 325 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 326 | MTL_ENABLE_DEBUG_INFO = YES; 327 | ONLY_ACTIVE_ARCH = YES; 328 | SDKROOT = iphoneos; 329 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 330 | }; 331 | name = Debug; 332 | }; 333 | C91A95361CC982B100C55F68 /* Release */ = { 334 | isa = XCBuildConfiguration; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_CONSTANT_CONVERSION = YES; 344 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 345 | CLANG_WARN_EMPTY_BODY = YES; 346 | CLANG_WARN_ENUM_CONVERSION = YES; 347 | CLANG_WARN_INT_CONVERSION = YES; 348 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 349 | CLANG_WARN_UNREACHABLE_CODE = YES; 350 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 351 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 352 | COPY_PHASE_STRIP = NO; 353 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 354 | ENABLE_NS_ASSERTIONS = NO; 355 | ENABLE_STRICT_OBJC_MSGSEND = YES; 356 | GCC_C_LANGUAGE_STANDARD = gnu99; 357 | GCC_NO_COMMON_BLOCKS = YES; 358 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 359 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 360 | GCC_WARN_UNDECLARED_SELECTOR = YES; 361 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 362 | GCC_WARN_UNUSED_FUNCTION = YES; 363 | GCC_WARN_UNUSED_VARIABLE = YES; 364 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 365 | MTL_ENABLE_DEBUG_INFO = NO; 366 | SDKROOT = iphoneos; 367 | VALIDATE_PRODUCT = YES; 368 | }; 369 | name = Release; 370 | }; 371 | C91A95381CC982B100C55F68 /* Debug */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 375 | INFOPLIST_FILE = "Swift Compiler Tests/Info.plist"; 376 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 377 | PRODUCT_BUNDLE_IDENTIFIER = "None.Swift-Compiler-Tests"; 378 | PRODUCT_NAME = "Swift Compiler Bug"; 379 | }; 380 | name = Debug; 381 | }; 382 | C91A95391CC982B100C55F68 /* Release */ = { 383 | isa = XCBuildConfiguration; 384 | buildSettings = { 385 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 386 | INFOPLIST_FILE = "Swift Compiler Tests/Info.plist"; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 388 | PRODUCT_BUNDLE_IDENTIFIER = "None.Swift-Compiler-Tests"; 389 | PRODUCT_NAME = "Swift Compiler Bug"; 390 | }; 391 | name = Release; 392 | }; 393 | C91A953B1CC982B100C55F68 /* Debug */ = { 394 | isa = XCBuildConfiguration; 395 | buildSettings = { 396 | BUNDLE_LOADER = "$(TEST_HOST)"; 397 | INFOPLIST_FILE = "Swift Compiler TestsTests/Info.plist"; 398 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 399 | PRODUCT_BUNDLE_IDENTIFIER = "None.Swift-Compiler-TestsTests"; 400 | PRODUCT_NAME = "Swift Compiler Bug"; 401 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Swift Compiler Bug.app/Swift Compiler Bug"; 402 | }; 403 | name = Debug; 404 | }; 405 | C91A953C1CC982B100C55F68 /* Release */ = { 406 | isa = XCBuildConfiguration; 407 | buildSettings = { 408 | BUNDLE_LOADER = "$(TEST_HOST)"; 409 | INFOPLIST_FILE = "Swift Compiler TestsTests/Info.plist"; 410 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 411 | PRODUCT_BUNDLE_IDENTIFIER = "None.Swift-Compiler-TestsTests"; 412 | PRODUCT_NAME = "Swift Compiler Bug"; 413 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Swift Compiler Bug.app/Swift Compiler Bug"; 414 | }; 415 | name = Release; 416 | }; 417 | C91A953E1CC982B100C55F68 /* Debug */ = { 418 | isa = XCBuildConfiguration; 419 | buildSettings = { 420 | INFOPLIST_FILE = "Swift Compiler TestsUITests/Info.plist"; 421 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 422 | PRODUCT_BUNDLE_IDENTIFIER = "None.Swift-Compiler-TestsUITests"; 423 | PRODUCT_NAME = "Swift Compiler Bug"; 424 | TEST_TARGET_NAME = "Swift Compiler Tests"; 425 | }; 426 | name = Debug; 427 | }; 428 | C91A953F1CC982B100C55F68 /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | INFOPLIST_FILE = "Swift Compiler TestsUITests/Info.plist"; 432 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 433 | PRODUCT_BUNDLE_IDENTIFIER = "None.Swift-Compiler-TestsUITests"; 434 | PRODUCT_NAME = "Swift Compiler Bug"; 435 | TEST_TARGET_NAME = "Swift Compiler Tests"; 436 | }; 437 | name = Release; 438 | }; 439 | /* End XCBuildConfiguration section */ 440 | 441 | /* Begin XCConfigurationList section */ 442 | C91A950A1CC982B100C55F68 /* Build configuration list for PBXProject "Swift Compiler Bug" */ = { 443 | isa = XCConfigurationList; 444 | buildConfigurations = ( 445 | C91A95351CC982B100C55F68 /* Debug */, 446 | C91A95361CC982B100C55F68 /* Release */, 447 | ); 448 | defaultConfigurationIsVisible = 0; 449 | defaultConfigurationName = Release; 450 | }; 451 | C91A95371CC982B100C55F68 /* Build configuration list for PBXNativeTarget "Swift Compiler Bug" */ = { 452 | isa = XCConfigurationList; 453 | buildConfigurations = ( 454 | C91A95381CC982B100C55F68 /* Debug */, 455 | C91A95391CC982B100C55F68 /* Release */, 456 | ); 457 | defaultConfigurationIsVisible = 0; 458 | }; 459 | C91A953A1CC982B100C55F68 /* Build configuration list for PBXNativeTarget "Swift Compiler BugTests" */ = { 460 | isa = XCConfigurationList; 461 | buildConfigurations = ( 462 | C91A953B1CC982B100C55F68 /* Debug */, 463 | C91A953C1CC982B100C55F68 /* Release */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | }; 467 | C91A953D1CC982B100C55F68 /* Build configuration list for PBXNativeTarget "Swift Compiler BugUITests" */ = { 468 | isa = XCConfigurationList; 469 | buildConfigurations = ( 470 | C91A953E1CC982B100C55F68 /* Debug */, 471 | C91A953F1CC982B100C55F68 /* Release */, 472 | ); 473 | defaultConfigurationIsVisible = 0; 474 | }; 475 | /* End XCConfigurationList section */ 476 | }; 477 | rootObject = C91A95071CC982B100C55F68 /* Project object */; 478 | } 479 | -------------------------------------------------------------------------------- /Swift Compiler Bug.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Swift Compiler Tests/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Swift Compiler Tests 4 | // 5 | // Created by Matt on 4/21/16. 6 | // Copyright © 2016 None. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 17 | 18 | // remove employee's in the below literal to speed up compilation time 19 | let myCompany = [ 20 | "employees": [ 21 | "employee 1": ["attribute": "value"], 22 | "employee 2": ["attribute": "value"], 23 | "employee 3": ["attribute": "value"], 24 | "employee 4": ["attribute": "value"], 25 | "employee 5": ["attribute": "value"], 26 | "employee 6": ["attribute": "value"], 27 | "employee 7": ["attribute": "value"], 28 | "employee 8": ["attribute": "value"], 29 | "employee 9": ["attribute": "value"], 30 | "employee 10": ["attribute": "value"], 31 | "employee 11": ["attribute": "value"], 32 | "employee 12": ["attribute": "value"], 33 | "employee 13": ["attribute": "value"], 34 | "employee 14": ["attribute": "value"], 35 | "employee 15": ["attribute": "value"], 36 | "employee 16": ["attribute": "value"], 37 | "employee 17": ["attribute": "value"], 38 | "employee 18": ["attribute": "value"], 39 | "employee 19": ["attribute": "value"], 40 | "employee 20": ["attribute": "value"] 41 | ] 42 | ] 43 | 44 | return true 45 | } 46 | 47 | func applicationWillResignActive(application: UIApplication) { 48 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 49 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 50 | } 51 | 52 | func applicationDidEnterBackground(application: UIApplication) { 53 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 54 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 55 | } 56 | 57 | func applicationWillEnterForeground(application: UIApplication) { 58 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 59 | } 60 | 61 | func applicationDidBecomeActive(application: UIApplication) { 62 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 63 | } 64 | 65 | func applicationWillTerminate(application: UIApplication) { 66 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /Swift Compiler Tests/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Swift Compiler Tests/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Swift Compiler Tests/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Swift Compiler Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Swift Compiler Tests/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Swift Compiler Tests 4 | // 5 | // Created by Matt on 4/21/16. 6 | // Copyright © 2016 None. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | --------------------------------------------------------------------------------