Skip to content

Commit

Permalink
consistently call fatalError() in previously named methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim committed Sep 13, 2016
1 parent 308f0c8 commit 525d65f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion RealmSwift/LinkingObjects.swift
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ extension LinkingObjects : RealmCollection {

extension LinkingObjects {
@available(*, unavailable, renamed: "isInvalidated")
public var invalidated : Bool { fatalError() }
public var invalidated: Bool { fatalError() }

@available(*, unavailable, renamed: "index(matching:)")
public func index(of predicate: NSPredicate) -> Int? { fatalError() }
Expand Down
4 changes: 2 additions & 2 deletions RealmSwift/List.swift
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,10 @@ extension List {
public func appendContentsOf<S: Sequence>(_ objects: S) where S.Iterator.Element == T { fatalError() }

@available(*, unavailable, renamed: "remove(objectAtIndex:)")
public func remove(at index: Int) { }
public func remove(at index: Int) { fatalError() }

@available(*, unavailable, renamed: "isInvalidated")
public var invalidated : Bool { fatalError() }
public var invalidated: Bool { fatalError() }

@available(*, unavailable, renamed: "index(matching:)")
public func index(of predicate: NSPredicate) -> Int? { fatalError() }
Expand Down
4 changes: 2 additions & 2 deletions RealmSwift/Migration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ internal func accessorMigrationBlock(_ migrationBlock: @escaping MigrationBlock)

extension Migration {
@available(*, unavailable, renamed: "enumerateObjects(ofType:_:)")
public func enumerate(_ objectClassName: String, _ block: MigrationObjectEnumerateBlock) { }
public func enumerate(_ objectClassName: String, _ block: MigrationObjectEnumerateBlock) { fatalError() }

@available(*, unavailable, renamed: "deleteData(forType:)")
public func deleteData(_ objectClassName: String) -> Bool {
fatalError()
}

@available(*, unavailable, renamed: "renameProperty(onType:from:to:)")
public func renamePropertyForClass(_ className: String, oldName: String, newName: String) { }
public func renamePropertyForClass(_ className: String, oldName: String, newName: String) { fatalError() }
}

#else
Expand Down
4 changes: 2 additions & 2 deletions RealmSwift/Property.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ public func == (lhs: Property, rhs: Property) -> Bool { // swiftlint:disable:thi

extension Property {
@available(*, unavailable, renamed: "isIndexed")
public var indexed : Bool { fatalError() }
public var indexed: Bool { fatalError() }

@available(*, unavailable, renamed: "isOptional")
public var optional : Bool { fatalError() }
public var optional: Bool { fatalError() }
}

#else
Expand Down
8 changes: 1 addition & 7 deletions RealmSwift/Realm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,7 @@ public typealias NotificationBlock = (_ notification: Notification, _ realm: Rea
extension Realm {

@available(*, unavailable, renamed: "isInWriteTransaction")
public var inWriteTransaction : Bool { fatalError() }

@available(*, unavailable, renamed: "delete(_:)")
public func delete<T: Object>(objects: List<T>) { }

@available(*, unavailable, renamed: "delete(_:)")
public func delete<T: Object>(objects: Results<T>) { }
public var inWriteTransaction: Bool { fatalError() }

@available(*, unavailable, renamed: "object(ofType:forPrimaryKey:)")
public func objectForPrimaryKey<T: Object>(_ type: T.Type, key: AnyObject) -> T? { fatalError() }
Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/RealmCollectionType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ public final class AnyRealmCollection<T: Object>: RealmCollection {

extension AnyRealmCollection {
@available(*, unavailable, renamed: "isInvalidated")
public var invalidated : Bool { fatalError() }
public var invalidated: Bool { fatalError() }

@available(*, unavailable, renamed: "index(matching:)")
public func index(of predicate: NSPredicate) -> Int? { fatalError() }
Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/Results.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ extension Results: RealmCollection {

extension Results {
@available(*, unavailable, renamed: "isInvalidated")
public var invalidated : Bool { fatalError() }
public var invalidated: Bool { fatalError() }

@available(*, unavailable, renamed: "index(matching:)")
public func index(of predicate: NSPredicate) -> Int? { fatalError() }
Expand Down

0 comments on commit 525d65f

Please sign in to comment.