tsubtypegenericconstraint.nim 234 B

123456789101112
  1. block: # issue #18314
  2. type
  3. A = ref object of RootObj
  4. B = ref object of A
  5. C = ref object of B
  6. proc foo[T: A](a: T): string = "got A"
  7. proc foo[T: B](b: T): string = "got B"
  8. var c = C()
  9. doAssert foo(c) == "got B"