tpointerprocs.nim 761 B

12345678910111213141516171819202122232425262728
  1. discard """
  2. cmd: "nim check $options --hints:off $file"
  3. action: "reject"
  4. nimout:'''
  5. tpointerprocs.nim(15, 11) Error: 'foo' doesn't have a concrete type, due to unspecified generic parameters.
  6. tpointerprocs.nim(27, 11) Error: cannot instantiate: 'foo[int]'; got 1 typeof(s) but expected 2
  7. tpointerprocs.nim(27, 14) Error: expression 'foo[int]' has no type (or is ambiguous)
  8. tpointerprocs.nim(28, 11) Error: expression 'bar' has no type (or is ambiguous)
  9. '''
  10. """
  11. block:
  12. proc foo(x: int | float): float = result = 1.0
  13. let
  14. bar = foo
  15. baz = bar
  16. block:
  17. proc foo(x: int | float): float = result = 1.0
  18. let
  19. bar = foo[int]
  20. baz = bar
  21. block:
  22. proc foo(x: int | float, y: int or string): float = result = 1.0
  23. let
  24. bar = foo[int]
  25. baz = bar