undeclared_routime_compiles.nim 219 B

123456789101112
  1. # D20180828T234921:here
  2. template foo*(iter: untyped): untyped =
  3. when compiles(iter.unexistingField): 0
  4. elif compiles(iter.len): 1
  5. else: 2
  6. proc foo[A]()=
  7. let a2 = @[10, 11]
  8. let a3 = foo(pairs(a2))
  9. foo[int]()