X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=compiler%2Ftestcases%2Ftest21.tig;fp=compiler%2Ftestcases%2Ftest21.tig;h=45018545a8cf9b1b5602165bb8ca9a7566c0a0a9;hb=38ffcb1fc99ecb7a48097cbcf97b9a3062c8bfa0;hp=0000000000000000000000000000000000000000;hpb=4f2aaee3ef5f70f7769931032fd50af0403c51ae;p=tiger.ml.git diff --git a/compiler/testcases/test21.tig b/compiler/testcases/test21.tig new file mode 100644 index 0000000..4501854 --- /dev/null +++ b/compiler/testcases/test21.tig @@ -0,0 +1,13 @@ +/* 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 +