code: function getAssignmentReducedType(declaredType, assignedType) {
              if (declaredType !== assignedType) {
                  var reducedType = filterType(declaredType, function (t) { return typeMaybeAssignableTo(assignedType, t); });
                  if (reducedType !== neverType) {
                      return reducedType;
                  }
              }
              return declaredType;
          }
docs: Remove those constituent types of declaredType to which no constituent type of assignedType is assignable. For example, when a variable of type number | string | boolean is assigned a value of type number | boolean, we remove type string.