Commit c117fd19 authored by Drew's avatar Drew

Convert Task.allKeys to computed property

Currently, allKeys can get out of sync with the actual task.  This can occur if you use the subscript setter.

This does not arise very often, but can occur if you have an attool (which has no fixed set of keys, so it uses allKeys) *and* you are setting keys from overlays or via some other method that modifies the keys for tasks after their creation.
parent 8bc9044e
Pipeline #1972 passed with stage
......@@ -35,7 +35,9 @@ final public class Task {
var declaredOverlays: [String: [String: ParseValue]] = [:] ///The overlays this task declares
public var allKeys: [String]
public var allKeys: [String] {
return [String](self.kvp.keys)
}
private var kvp: [String:ParseValue]
......@@ -66,7 +68,6 @@ final public class Task {
self.kvp = kvp
self.unqualifiedName = unqualifiedName
self.package = package
self.allKeys = [String](kvp.keys)
guard let tool = kvp[Option.Tool.rawValue]?.string else {
self.tool = "invalid"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment