tcannot_pass_empty_seq_to_generic.nim 281 B

123456789101112131415161718
  1. discard """
  2. errormsg: "type mismatch: got <seq[empty]>"
  3. line: 16
  4. """
  5. # bug #836
  6. type
  7. TOption*[T] = object
  8. case FIsSome: bool
  9. of false: nil
  10. of true: FData: T
  11. proc some*[T](value: T): TOption[T] = TOption[T](FIsSome: true, FData: value)
  12. echo some(@[]).FIsSome