ttypedesc3.nim 364 B

1234567891011121314151617181920
  1. import typetraits
  2. type
  3. Base = object of RootObj
  4. Child = object of Base
  5. proc pr(T: type[Base]) = echo "proc " & T.name
  6. method me(T: type[Base]) = echo "method " & T.name
  7. iterator it(T: type[Base]): auto = yield "yield " & T.name
  8. Base.pr
  9. Child.pr
  10. Base.me
  11. when false:
  12. Child.me #<- bug #2710
  13. for s in Base.it: echo s
  14. for s in Child.it: echo s #<- bug #2662