Files
Nim/tests/generics/tuninstantiated_failure.nim
ringabout 642ac0c1c3 fixes #22753; Nimsuggest segfault with invalid assignment to table (#22781)
fixes #22753

## Future work
We should turn all the error nodes into nodes of a nkError kind, which
could be a industrious task. But perhaps we can add a special treatment
for error nodes to make the transition smooth.
2023-10-02 14:45:04 -04:00

17 lines
332 B
Nim

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 an error since Something isn't a valid Test
b[0].name = "Test" #[tt.Error
^ expression '' has no type (or is ambiguous)]#