tmismatch.nim 349 B

123456789101112131415161718
  1. # issue #17779
  2. {.experimental: "dotOperators".}
  3. type
  4. Flag = enum
  5. A
  6. Flags = set[Flag]
  7. template `.=`*(flags: Flags, key: Flag, val: bool) =
  8. if val: flags.incl key else: flags.excl key
  9. var flags: Flags
  10. flags.A = 123 #[tt.Error
  11. ^ undeclared field: 'A=' for type tmismatch.Flags [type declared in tmismatch.nim(9, 5)]]#