tdefaultfieldscheck.nim 485 B

12345678910111213141516171819
  1. discard """
  2. cmd: "nim check --hints:off $file"
  3. errormsg: ""
  4. nimout:
  5. '''
  6. tdefaultfieldscheck.nim(14, 17) Error: type mismatch: got <string> but expected 'int'
  7. tdefaultfieldscheck.nim(15, 20) Error: type mismatch: got <int literal(12)> but expected 'string'
  8. tdefaultfieldscheck.nim(17, 16) Error: type mismatch: got <float64> but expected 'int'
  9. '''
  10. """
  11. type
  12. Date* = object
  13. name: int = "string"
  14. time: string = 12
  15. goal: float = 7
  16. fun: int = 1.4
  17. echo default(Date)