;;; TOOL: wat2wasm
;;; ERROR: 1
(module
  (import "foo" "bar" (func $import (result f32)))
  (func $direct (result i64) (i64.const 0))
  (type $indirect (func (result i64)))
  (table funcref (elem $direct))

  (func
    if
      call $direct
    else
      nop
    end
    if
      call $import
    else
      nop
    end
    if
      i32.const 0
      call_indirect (type $indirect)
    else
      nop
    end))
(;; STDERR ;;;
out/test/typecheck/bad-call-result-mismatch.txt:10:5: error: type mismatch in if, expected [i32] but got []
    if
    ^^
out/test/typecheck/bad-call-result-mismatch.txt:11:7: error: type mismatch at end of `if true` branch, expected [] but got [i64]
      call $direct
      ^^^^
out/test/typecheck/bad-call-result-mismatch.txt:15:5: error: type mismatch in if, expected [i32] but got []
    if
    ^^
out/test/typecheck/bad-call-result-mismatch.txt:16:7: error: type mismatch at end of `if true` branch, expected [] but got [f32]
      call $import
      ^^^^
out/test/typecheck/bad-call-result-mismatch.txt:20:5: error: type mismatch in if, expected [i32] but got []
    if
    ^^
out/test/typecheck/bad-call-result-mismatch.txt:22:7: error: type mismatch at end of `if true` branch, expected [] but got [i64]
      call_indirect (type $indirect)
      ^^^^^^^^^^^^^
;;; STDERR ;;)
