[NO ISSUE][COMP] Fix TypeComputeUtils.getResultType

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fix TypeComputeUtils.getResultType to either return
  unknowable or missable type.

Change-Id: Id881f2a5ad8134a3e86b2b08ce1acdc53c4948a2
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2928
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/TypeComputeUtils.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/TypeComputeUtils.java
index 806235c..448ab4c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/TypeComputeUtils.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/TypeComputeUtils.java
@@ -169,8 +169,7 @@
         IAType resultType = type;
         if ((category & NULLABLE) != 0 || (category & NULL) != 0) {
             resultType = AUnionType.createUnknownableType(resultType);
-        }
-        if ((category & MISSABLE) != 0 || (category & MISSING) != 0) {
+        } else if ((category & MISSABLE) != 0 || (category & MISSING) != 0) {
             resultType = AUnionType.createMissableType(resultType);
         }
         return resultType;