Skip to content

tree<y>.calculatePatch(otherTree<x>) types could be improved, so that it returns a Patch<Y | X> #95

@stefanpenner

Description

@stefanpenner

When using calculatePatch today, the resulting patches incorrectly type their entry as DefaultEntry, when ideally the resulting Patch[] would be generic based on the actually tree's being used. Basically something like: Patch<T | K>[]

today:

class FSTree<T> {
  calculatePatch<K extends BaseEntry>(theirFSTree: FSTree<K>, isEqual?: (a: T, b: K) => boolean): FSTree.Patch {
  
  }
}

Proposed:

class FSTree<T> {
  calculatePatch<K extends BaseEntry>(theirFSTree: FSTree<K>, isEqual?: (a: T, b: K) => boolean): FSTree.Patch<T | K> {
  
  }
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions