funptr1.golden 569 B

12345678910111213141516171819202122232425
  1. ********** source program **********
  2. fn add1 Int: x -> Int {
  3. return (x + 1);
  4. }
  5. fn main () -> Int {
  6. var fn Int -> Int: f = add1;
  7. return f(0 = (- 1));
  8. }
  9. ********** type checking **********
  10. --- step exp Int --->
  11. --- step exp Int --->
  12. --- step exp Int --->
  13. --- step exp Int --->
  14. --- step exp Int --->
  15. --- step exp Int --->
  16. --- step exp fn Int -> Int --->
  17. --- step exp Int --->
  18. --- handle value Int with fn Int -> Int<1>(Int,) --->
  19. --- step exp Int --->
  20. --- handle value Int with fn Int -> Int<2>(Int,Int,) --->
  21. 11: type error in call
  22. expected: Int
  23. actual: Tuple(0 = Int)