summaryrefslogtreecommitdiff
path: root/tiger-compiler/tests/type/test21.tig
blob: 5e466a371beee83896555ab7932b71845f2b906f (plain)
1
2
3
4
5
6
7
8
9
10
11
/* error : procedure returns value  and procedure is used in arexpr */
let
  /* calculate n! */
  function nfactor(n : int) =
    if  n = 0
        then 1
        else n * nfactor(n-1)

in
  nfactor(10)
end