tfail_object_is_generic.nim 350 B

1234567891011121314151617
  1. discard """
  2. errormsg: "ambiguous call"
  3. """
  4. #[
  5. As of the time of writing `object` needs some special
  6. treament in order to be considered "generic" in the right
  7. context when used implicitly
  8. ]#
  9. type
  10. C = object
  11. proc test[T: object](param: T): bool = false
  12. proc test(param: object): bool = true
  13. doAssert test(C()) == true # previously would pass