tdistinct_nil.nim 457 B

123456789101112131415161718192021222324
  1. discard """
  2. cmd: "nim check $file"
  3. action: reject
  4. nimout: '''
  5. tdistinct_nil.nim(23, 4) Error: type mismatch: got <typeof(nil)>
  6. but expected one of:
  7. proc foo(x: DistinctPointer)
  8. first type mismatch at position: 1
  9. required type for x: DistinctPointer
  10. but expression 'nil' is of type: typeof(nil)
  11. expression: foo(nil)
  12. '''
  13. """
  14. type
  15. DistinctPointer = distinct pointer
  16. proc foo(x: DistinctPointer) =
  17. discard
  18. foo(DistinctPointer(nil))
  19. foo(nil)