summary refs log blame commit diff stats
path: root/tests/generics/tuninstantiated_failure.nim
blob: f09b115d65a0195f667fc8e4b731888f5df88197 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                
discard """
cmd: "nim check $file"
"""

type
  Test[T, K] = object
    name: string
  Something = Test[int]

func `[]`[T, K](x: var Test[T, K], idx: int): var Test[T, K] =
  x

var b: Something
# Should give a type-mismatch since Something isn't a valid Test
b[0].name = "Test" #[tt.Error
            ^  type mismatch]#