You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7df15c8
Browse filesBrowse the repository at this point in the historyBrowse files
Widen sortTasksUnderHeading + getStringArrayValue for array invariance (19 -> 18)
jgclark.RepeatExtensions could not call dwertheimer.TaskSorting's sortTasksUnderHeading
without a suppression, for two independent reasons the call site had documented:
- `_noteOverride: TNote | typeof Editor | null` -> `CoreNoteFields | null`. The body only
does `_noteOverride || Editor.note`, so CoreNoteFields covers both cases it accepts.
- `_sortOrder: ?(string | Array<mixed>)` -> `?(string | $ReadOnlyArray<mixed>)`. Flow arrays
are invariant, so an Array<string> is not an Array<mixed>; $ReadOnlyArray is covariant.
That second change pushed the same invariance one level down into
helpers/dataManipulation.js getStringArrayValue, which had the identical problem (and
already carried an `(defaultValue: any)` cast acknowledging it). Widened its input to
$ReadOnlyArray too. getArrayValue below it was deliberately NOT widened: it returns its
input as-is, so making it read-only would change its return type and ripple through every
caller. Instead getStringArrayValue copies the array before passing it down -- free in
practice, since the .map() on the next line already allocates.
flow check: 6 (unchanged). jest: 198 suites / 4,621 tests.
0 commit comments