tcStmt ret (IfStatement l condE thenS Nothing) = tcStmtBlock l "if statement" $ do
    condE' <- tcStmtBlock l "if statement guard" $ tcGuard condE
    (thenS',StmtType cs) <- tcLocal l "tcStmt if then" $ tcNonEmptyStmt ret thenS
    -- an if statement falls through if the condition is not satisfied
    let t = StmtType $ Set.insert (StmtFallthru $ ComplexT Void) cs
    return (IfStatement (notTyped "tcStmt" l) condE' thenS' Nothing,t)
tcStmt ret (IfStatement l condE thenS Nothing) = tcStmtBlock l "if statement" $ do
    condE' <- tcStmtBlock l "if statement guard" $ tcGuard condE
    (thenS',StmtType cs) <- tcLocal l "tcStmt if then" $ tcNonEmptyStmt ret thenS
    -- an if statement falls through if the condition is not satisfied
    let t = StmtType $ Set.insert (StmtFallthru $ ComplexT Void) cs
    return (IfStatement (notTyped "tcStmt" l) condE' thenS' Nothing,t)
tcStmt ret (IfStatement l condE thenS Nothing) = tcStmtBlock l "if statement" $ do
    condE' <- tcStmtBlock l "if statement guard" $ tcGuard condE
    (thenS',StmtType cs) <- tcLocal l "tcStmt if then" $ tcNonEmptyStmt ret thenS
    -- an if statement falls through if the condition is not satisfied
    let t = StmtType $ Set.insert (StmtFallthru $ ComplexT Void) cs
    return (IfStatement (notTyped "tcStmt" l) condE' thenS' Nothing,t)