0001 // 0002 // Rx.swift 0003 // Rx 0004 // 0005 // Created by Krunoslav Zaher on 2/14/15. 0006 // Copyright © 2015 Krunoslav Zaher. All rights reserved. 0007 // 0008 0009 import Foundation 0010 0011 #if TRACE_RESOURCES 0012 /** 0013 Counts internal Rx resources (Observables, Observers, Disposables ...). 0014 0015 It provides a really simple way to detect leaks early during development. 0016 */ 0017 public var resourceCount: AtomicInt = 0 0018 #endif 0019 0020 // Swift doesn't have a concept of abstract metods. 0021 // This function is being used as a runtime check that abstract methods aren't being called. 0022 @noreturn func abstractMethod() -> Void { 0023 rxFatalError("Abstract method") 0024 } 0025 0026 @noreturn func rxFatalError
CombineLatest.swift:39 abstractMethod()ConnectableObservable.swift:24 abstractMethod()Merge.swift:296 abstractMethod()Observable.swift:29 abstractMethod()ObserverBase.swift:33 abstractMethod()Producer.swift:28 abstractMethod()ReplaySubject.swift:26 abstractMethod()ReplaySubject.swift:35 abstractMethod()ReplaySubject.swift:88 abstractMethod()ReplaySubject.swift:92 abstractMethod()ReplaySubject.swift:96 abstractMethod()Switch.swift:43 abstractMethod()TailRecursiveSink.swift:67 abstractMethod()TailRecursiveSink.swift:136 abstractMethod()Zip.swift:36 abstractMethod()Zip.swift:40 abstractMethod()(lastMessage: String) { 0027 // The temptation to comment this line is great, but please don't, it's for your own good. The choice is yours. 0028 fatalError(lastMessage) 0029 } 0030 0031 func incrementChecked
ElementAt.swift:66 rxFatalError("index can't be negative")MainScheduler.swift:42 rxFatalError("Executing on backgound thread. Please use `MainScheduler.instance.schedule` to schedule work on main thread.")Range.swift:18 rxFatalError("count can't be negative")Range.swift:22 rxFatalError("overflow of count")RefCount.swift:49 rxFatalError("Something went wrong with RefCount disposing mechanism")RefCountDisposable.swift:50 rxFatalError("RefCountDisposable increment failed")RefCountDisposable.swift:90 rxFatalError("RefCountDisposable decrement on release failed")RefCountDisposable.swift:94 rxFatalError("RefCountDisposable counter is lower than 0")Rx.swift:23 rxFatalError("Abstract method")SingleAssignmentDisposable.swift:57 rxFatalError("oldState.disposable != nil")Take.swift:58 rxFatalError("count can't be negative")TakeLast.swift:52 rxFatalError("count can't be negative")Zip+arity.swift:56 rxFatalError("Unhandled case (Function)")Zip+arity.swift:151 rxFatalError("Unhandled case (Function)")Zip+arity.swift:254 rxFatalError("Unhandled case (Function)")Zip+arity.swift:365 rxFatalError("Unhandled case (Function)")Zip+arity.swift:484 rxFatalError("Unhandled case (Function)")Zip+arity.swift:611 rxFatalError("Unhandled case (Function)")Zip+arity.swift:746 rxFatalError("Unhandled case (Function)")(inout i: Int) throws -> Int { 0032 if i == Int.max { 0033 throw RxError.Overflow 0034 } 0035 let result = i 0036 i += 1 0037 return result 0038 } 0039 0040 func decrementChecked
Map.swift:65 let mappedElement = try _selector(element, try incrementChecked(&_index))Merge.swift:203 return try _selector(element, try incrementChecked(&_index))RefCountDisposable.swift:48 try incrementChecked(&_count)SkipWhile.swift:65 try incrementChecked(&_index)TakeWhile.swift:80 try incrementChecked(&_index)Window.swift:69 try incrementChecked(&_count)(inout i: Int) throws -> Int { 0041 if i == Int.min { 0042 throw RxError.Overflow 0043 } 0044 let result = i 0045 i -= 1 0046 return result 0047 } 0048
ElementAt.swift:36 try decrementChecked(&_i)RefCountDisposable.swift:88 try decrementChecked(&_count)