tuninstantiated_failure.nim 320 B

1234567891011121314151617
  1. discard """
  2. cmd: "nim check $file"
  3. """
  4. type
  5. Test[T, K] = object
  6. name: string
  7. Something = Test[int]
  8. func `[]`[T, K](x: var Test[T, K], idx: int): var Test[T, K] =
  9. x
  10. var b: Something
  11. # Should give a type-mismatch since Something isn't a valid Test
  12. b[0].name = "Test" #[tt.Error
  13. ^ type mismatch]#