Permalink
Browse files

Merge pull request #956 from mxcl/final

Add `final` where possible
  • Loading branch information...
mxcl committed Nov 7, 2018
2 parents a4b4de8 + 41699e2 commit ff97aa9dcbd8453b39c9aa40ccfd9db93b59e119
Showing with 73 additions and 17 deletions.
  1. +11 −11 .travis.yml
  2. +28 −0 PromiseKit copy-Info.plist
  3. +28 −0 PromiseKit copy2-Info.plist
  4. +3 −3 Sources/Box.swift
  5. +1 −1 Sources/Guarantee.swift
  6. +1 −1 Sources/Promise.swift
  7. +1 −1 Sources/Resolver.swift
@@ -23,7 +23,7 @@ jobs:
osx_image: xcode9.4
name: Carthage / Xcode 9.4
- <<: *carthage
osx_image: xcode10
osx_image: xcode10.1
name: Carthage / Xcode 10.0
- &pod
@@ -46,7 +46,7 @@ jobs:
env: SWIFT=3.3
name: pod lib lint --swift-version=3.3
- <<: *pod
osx_image: xcode10
osx_image: xcode10.1
env: SWIFT=3.4
name: pod lib lint --swift-version=3.4
- <<: *pod
@@ -58,7 +58,7 @@ jobs:
env: SWIFT=4.1
name: pod lib lint --swift-version=4.1
- <<: *pod
osx_image: xcode10
osx_image: xcode10.1
env: SWIFT=4.2
name: pod lib lint --swift-version=4.2
@@ -77,7 +77,7 @@ jobs:
env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.1.2
name: Linux / Swift 3.3
- <<: *linux
env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.2
env: SWIFT_BUILD_VERSION=3 SWIFT_VERSION=4.2.1
name: Linux / Swift 3.4
- <<: *linux
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.0.3
@@ -88,7 +88,7 @@ jobs:
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.1.2
name: Linux / Swift 4.1
- <<: *linux
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2
env: SWIFT_BUILD_VERSION=4 SWIFT_VERSION=4.2.1
name: Linux / Swift 4.2
stage: test
script: swift test -Xswiftc -swift-version -Xswiftc 4
@@ -121,25 +121,25 @@ jobs:
xcodebuild -scheme PromiseKit -destination="$DST" -enableCodeCoverage YES SWIFT_VERSION=4 test | xcpretty
- <<: *test
name: macOS / Xcode 10.0
osx_image: xcode10
osx_image: xcode10.1
script:
xcodebuild -scheme PromiseKit -destination="$DST" -enableCodeCoverage YES SWIFT_VERSION=4 test | xcpretty
- <<: *test
name: iOS / Xcode 10.0
osx_image: xcode10
osx_image: xcode10.1
env: DST='OS=12.0,name=iPhone SE'
- <<: *test
name: tvOS / Xcode 10.0
env: DST='OS=12.0,name=Apple TV'
osx_image: xcode10
osx_image: xcode10.1
- stage: test
name: Promises/A+ (via WebKit JavaScript Bridge)
language: objective-c
os: osx
osx_image: xcode10
osx_image: xcode10.1
before_install: |
set -eo pipefail
npm install -g npm
@@ -162,7 +162,7 @@ jobs:
osx_image: xcode9.4
script: swift build
- <<: *swiftpm
osx_image: xcode10
osx_image: xcode10.1
name: SwiftPM / macOS / Xcode 10.0
- stage: deploy
@@ -173,5 +173,5 @@ jobs:
# AND `pod` defaults to hardly any output
# BUT `--verbose` generates so much output that Travis kills our script due to *too much* output!
os: osx
osx_image: xcode10
osx_image: xcode10.1
language: objective-c
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
@@ -5,7 +5,7 @@ enum Sealant<R> {
case resolved(R)
}
class Handlers<R> {
final class Handlers<R> {
var bodies: [(R) -> Void] = []
func append(_ item: @escaping(R) -> Void) { bodies.append(item) }
}
@@ -17,7 +17,7 @@ class Box<T> {
func seal(_: T) {}
}
class SealedBox<T>: Box<T> {
final class SealedBox<T>: Box<T> {
let value: T
init(value: T) {
@@ -29,7 +29,7 @@ class SealedBox<T>: Box<T> {
}
}
class EmptyBox<T>: Box<T> {
final class EmptyBox<T>: Box<T> {
private var sealant = Sealant<T>.pending(.init())
private let barrier = DispatchQueue(label: "org.promisekit.barrier", attributes: .concurrent)
@@ -5,7 +5,7 @@ import Dispatch
A `Guarantee` is a functional abstraction around an asynchronous operation that cannot error.
- See: `Thenable`
*/
public class Guarantee<T>: Thenable {
public final class Guarantee<T>: Thenable {
let box: Box<T>
fileprivate init(box: SealedBox<T>) {
@@ -5,7 +5,7 @@ import Dispatch
A `Promise` is a functional abstraction around a failable asynchronous operation.
- See: `Thenable`
*/
public class Promise<T>: Thenable, CatchMixin {
public final class Promise<T>: Thenable, CatchMixin {
let box: Box<Result<T>>
fileprivate init(box: SealedBox<Result<T>>) {
@@ -1,5 +1,5 @@
/// An object for resolving promises
public class Resolver<T> {
public final class Resolver<T> {
let box: Box<Result<T>>
init(_ box: Box<Result<T>>) {

0 comments on commit ff97aa9

Please sign in to comment.