t7600_1.nim 494 B

12345678910111213141516171819202122
  1. discard """
  2. errormsg: "type mismatch: got <Thin[system.int]>"
  3. nimout: '''t7600_1.nim(21, 6) Error: type mismatch: got <Thin[system.int]>
  4. but expected one of:
  5. proc test[T](x: Paper[T])
  6. first type mismatch at position: 1
  7. required type for x: Paper[test.T]
  8. but expression 'tn' is of type: Thin[system.int]
  9. expression: test tn'''
  10. """
  11. type
  12. Paper[T] = ref object of RootObj
  13. thickness: T
  14. Thin[T] = object of Paper[T]
  15. proc test[T](x: Paper[T]) = discard
  16. var tn = Thin[int]()
  17. test tn