tobjconstr_msgs.nim 334 B

123456789101112131415161718192021222324
  1. discard """
  2. cmd: "nim check $file"
  3. """
  4. import mobjconstr_msgs
  5. block:
  6. discard PrivateField(
  7. priv: "test" #[tt.Error
  8. ^ the field 'priv' is not accessible]#
  9. )
  10. block:
  11. type
  12. Foo = object
  13. field: string
  14. discard Foo(
  15. field: "test",
  16. field: "test" #[tt.Error
  17. ^ field initialized twice: 'field']#
  18. )