       (setq data (merlin-send-command `(expand prefix ,ident at ,pos)))
       (setq entries (cdr (assoc 'entries data)))
       (setq prefix ""))
-    ; Type information
-    (when application
-      (merlin--type-display nil (cdr (assoc 'argument_type application)) t))
     ; Concat results
-    (append
-      labels
-      (mapcar (lambda (entry)
-                (list (concat prefix (cdr (assoc 'name entry)))
-                      (merlin--completion-format-entry entry)
-                      (cdr (assoc 'kind entry))
-                      (cdr (assoc 'info entry))))
-              entries))))
-
-; Alias returning only entries, eventually called by external code, while
-; merlin--completion-data is free to change the format of returned values.
-(defalias 'merlin-completion-data 'merlin--completion-data)
+    (let ((result (append labels entries)))
+      (if expected-ty
+        (mapcar (lambda (x) (append x `((argument_type . ,expected-ty))))
+                result)
+        result))))
+
+; Here for backward compatibility: this function is called by external code, the
+; format of merlin--completion-data changed, this function translates it back to
+; the old format.
+(defun merlin-completion-data (ident)
+  "Backward compatible version of merlin--completion-data"
+  (let (entries (merlin--completion-data ident))
+    (mapcar (lambda (entry)
+              (list (concat prefix (cdr (assoc 'name entry)))
+                    (merlin--completion-format-entry entry)
+                    (cdr (assoc 'kind entry))
+                    (cdr (assoc 'info entry))))
+            entries)))
 
 (defun merlin--completion-lookup (string state)
   "Lookup the entry STRING inside the completion table."

                                        (aset name 0 ?~)
                                        (string-prefix-p suffix name)))))
                              labels))
  ; Format labels
  (mapcar (lambda (x) (list (cdr (assoc 'name x)) (cdr (assoc 'type x)) "Label" nil))
          labels))

(defun merlin--completion-data (ident)
  "Return the data for completion of IDENT, i.e. a list of pairs (NAME . TYPE)."


(defcustom merlin-completion-types t
  "If non-nil, print the types of the variables during completion with `auto-complete'."
  :group 'merlin :type 'boolean)

(defcustom merlin-completion-arg-type t
  "If non-nil, print the type of the expected argument during completion on an application."
  :group 'merlin :type 'boolean)

(defcustom merlin-debug nil
