texplicitgenericconstraint.nim 251 B

123456789101112131415
  1. # issue #23020
  2. proc n[T: bool](k: int | int) =
  3. #static:
  4. # doAssert T is bool
  5. # doAssert T isnot int
  6. # And runtime
  7. block:
  8. doAssert T is bool
  9. doAssert T isnot int
  10. n[int](0) #[tt.Error
  11. ^ type mismatch: got <int literal(0)>]#