tambtype.nim 569 B

123456789101112131415161718192021
  1. import ./mambtype2
  2. block: # issue #23893
  3. discard default(K(0)) # works
  4. discard default(mambtype2.B(0)) # works
  5. discard default(mambtype2.K(0)) # doesn't work
  6. block: # issue #23898, in template
  7. template r() =
  8. discard default(B(0)) # compiles
  9. discard default(mambtype2.B(0)) # compiles
  10. discard default(K(0)) # does not compile
  11. r()
  12. block: # in generics
  13. proc foo[T]() =
  14. discard default(B(0)) # compiles
  15. discard default(mambtype2.B(0)) # compiles
  16. discard default(K(0)) # does not compile
  17. foo[int]()