tcalltype.nim 469 B

123456789101112131415161718192021222324252627
  1. discard """
  2. joinable: false # breaks everything because of #23977
  3. """
  4. # issue #23406
  5. template helper(_: untyped): untyped =
  6. int
  7. type # Each of them should always be `int`.
  8. GenA[T] = helper int
  9. GenB[T] = helper(int)
  10. GenC[T] = helper helper(int)
  11. block:
  12. template helper(_: untyped): untyped =
  13. float
  14. type
  15. A = GenA[int]
  16. B = GenB[int]
  17. C = GenC[int]
  18. assert A is int # OK.
  19. assert B is int # Fails; it is `float`!
  20. assert C is int # OK.