tsetrange.nim 447 B

123456789101112131415161718
  1. # issue #24736
  2. import std/setutils
  3. type CcsCatType = enum cctNone, cctHeader, cctIndex, cctSetup, cctUnk1, cctStream
  4. block: # original issue
  5. const CCS_CAT_TYPES = fullSet(CcsCatType)
  6. proc test(t: int): bool = t.CcsCatType in CCS_CAT_TYPES
  7. discard test(5)
  8. block: # minimized
  9. func foo(): set[CcsCatType] =
  10. {cctNone..cctHeader}
  11. const CCS_CAT_TYPES = foo()
  12. proc test(t: int): bool = t.CcsCatType in CCS_CAT_TYPES
  13. discard test(5)