diff --git a/Source/Charts/Data/Implementations/ChartBaseDataSet.swift b/Source/Charts/Data/Implementations/ChartBaseDataSet.swift index ccb82de6b4..c2915abb84 100644 --- a/Source/Charts/Data/Implementations/ChartBaseDataSet.swift +++ b/Source/Charts/Data/Implementations/ChartBaseDataSet.swift @@ -116,12 +116,12 @@ open class ChartBaseDataSet: NSObject, ChartDataSetProtocol, NSCopying fatalError("entryIndex(entry) is not implemented in ChartBaseDataSet") } - open func addEntry(_ e: ChartDataEntry) -> Bool + @discardableResult open func addEntry(_ e: ChartDataEntry) -> Bool { fatalError("addEntry is not implemented in ChartBaseDataSet") } - open func addEntryOrdered(_ e: ChartDataEntry) -> Bool + @discardableResult open func addEntryOrdered(_ e: ChartDataEntry) -> Bool { fatalError("addEntryOrdered is not implemented in ChartBaseDataSet") } diff --git a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift index 2286f9cc94..7d4c0b2d2a 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift @@ -300,7 +300,7 @@ open class ChartDataSet: ChartBaseDataSet /// - Returns: True // TODO: This should return `Void` to follow Swift convention @available(*, deprecated, message: "Use `append(_:)` instead", renamed: "append(_:)") - open override func addEntry(_ e: ChartDataEntry) -> Bool + @discardableResult open override func addEntry(_ e: ChartDataEntry) -> Bool { append(e) return true @@ -313,8 +313,8 @@ open class ChartDataSet: ChartBaseDataSet /// - Parameters: /// - e: the entry to add /// - Returns: True - @discardableResult - open override func addEntryOrdered(_ e: ChartDataEntry) -> Bool + // TODO: This should return `Void` to follow Swift convention + @discardableResult open override func addEntryOrdered(_ e: ChartDataEntry) -> Bool { if let last = last, last.x > e.x {