t23434.nim 407 B

1234567891011121314151617
  1. discard """
  2. cmd:"nim cpp $file"
  3. errormsg: "type mismatch: got <proc (self: SomeObject){.member, gcsafe.}>"
  4. line: 17
  5. """
  6. type SomeObject = object
  7. value: int
  8. proc printValue(self: SomeObject) {.virtual.} =
  9. echo "The value is ", self.value
  10. proc callAProc(p: proc(self: SomeObject){.noconv.}) =
  11. let someObj = SomeObject(value: 4)
  12. echo "calling param proc"
  13. p(someObj)
  14. callAProc(printValue)