Github user stevedlawrence commented on a diff in the pull request:
https://github.com/apache/incubator-daffodil/pull/6#discussion_r153195913
--- Diff:
daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/TermEncodingMixin.scala
---
@@ -177,6 +177,7 @@ trait TermEncodingMixin extends KnownEncodingMixin {
self: Term =>
case (_, Binary) => Mixed
case (NoText, x) => x
case (x, NoText) => x
+ case (NamedEncoding(x), NamedEncoding(y)) if x == y => s1
--- End diff --
It seems like this should be covered by the first case
```
case (x, y) if (x == y) => x
```
I assume the issue here is that NamedEncoding does not have an equals
method, and so it's not seeing the two as equal? Perhaps adding that would be
the right fix? That way other places that check if summary encodings are the
same would also behave as expected.
Related, I think the ``case (Binary, Binary)`` case should not be needed,
since that should also be covered by the first case. In fact, I think the whole
lattice could be simplified so something like thIs:
```
case (x, y) if (x ==y) => x
case (NoText, x) => x
case (x, NoText) => x
case _ => Mixed
```
I think this is a little more legible and clear. Either they encodings are
the same, so the combined is the same, one is NoText, which combines to the
other, or it's mixed.
---