texplicitgenericcount.nim 681 B

12345678910111213141516171819202122232425
  1. discard """
  2. cmd: "nim check -d:testsConciseTypeMismatch $file"
  3. """
  4. proc foo[T, U](x: T, y: U): (T, U) = (x, y)
  5. let x = foo[int](1, 2) #[tt.Error
  6. ^ type mismatch
  7. Expression: foo[int](1, 2)
  8. [1] 1: int literal(1)
  9. [2] 2: int literal(2)
  10. Expected one of (first mismatch at [position]):
  11. [2] proc foo[T, U](x: T; y: U): (T, U)
  12. missing generic parameter: U]#
  13. let y = foo[int, float, string](1, 2) #[tt.Error
  14. ^ type mismatch
  15. Expression: foo[int, float, string](1, 2)
  16. [1] 1: int literal(1)
  17. [2] 2: int literal(2)
  18. Expected one of (first mismatch at [position]):
  19. [3] proc foo[T, U](x: T; y: U): (T, U)
  20. extra generic param given]#