like method

List<IndexComparisonWarning> like(
  1. IndexElementDefinition other
)

Compares this index element with other, returning a list of mismatches.

Implementation

List<IndexComparisonWarning> like(IndexElementDefinition other) {
  List<IndexComparisonWarning> mismatches = [];

  if (type != other.type) {
    mismatches.add(
      IndexComparisonWarning(
        name: 'element type',
        expected: '$type',
        found: '${other.type}',
      ),
    );
  }

  if (definition != other.definition) {
    mismatches.add(
      IndexComparisonWarning(
        name: 'element definition',
        expected: definition,
        found: other.definition,
      ),
    );
  }

  return mismatches;
}