tgenericalias.nim 332 B

1234567891011121314
  1. block: # issue #13799
  2. type
  3. X[A, B] = object
  4. a: A
  5. b: B
  6. Y[A] = X[A, int]
  7. template s(T: type X): X = T()
  8. template t[A, B](T: type X[A, B]): X[A, B] = T()
  9. proc works1(): Y[int] = s(X[int, int])
  10. proc works2(): Y[int] = t(X[int, int])
  11. proc works3(): Y[int] = t(Y[int])
  12. proc broken(): Y[int] = s(Y[int])