Prefer fully resolved roots when unifying
Prefer fully resolved roots when unifying

Summary:
A fully resolved root comes with a strong invariant: that all tvars reachable
from the resolved type are also fully resolved. This invariant makes it possible
to skip over fully resolved roots during some operations that visit the
structure of types, like concretization and context optimization.

Before this change, unification could replace a fully resolved root with a
simply resolved one. This is undesirable because it (1) potentially breaks the
invariant above, and (2) prevents that tvar from enjoying the optimizations
described above.

This diff ensures that the surviving root of a unification involving a fully
resolved root is also fully resolved.

Reviewed By: dsainati1

Differential Revision: D26958026

fbshipit-source-id: f461747d9ef5ba141b275429e7fdc09fe5554c9a

nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow,nmote/flow